2013-11-28 24 views
0

@ YAML中的保留符號嗎?當我強迫它是一個字符串,一切都很好「@」在YAML中的含義是什麼(導致Psych :: SyntaxError)?

require 'yaml' 
k = "test: @hello" 
YAML.load(k) 
# => {"test"=>"@hello"} 

但是,如果我把它寫不帶,它給了我Psych::SyntaxError。這是爲什麼? YAML中@<something>有什麼特別的含義嗎?

require 'yaml' 
k = "test: @hello" 
YAML.load(k) 
# => Psych::SyntaxError: (<unknown>): found character that cannot start any token while scanning for the next token ... 

回答

0

從YAML屬,指示器字符(link):

的「@」(#X40,AT)和「`」(#X60,重音符)被保留以供將來使用。

相關問題