【发布时间】:2013-11-28 00:18:03
【问题描述】:
@ 是 YAML 中的保留符号吗?当我强迫它成为一个字符串时,一切都很好
require 'yaml'
k = "test: @hello"
YAML.load(k)
# => {"test"=>"@hello"}
但是,如果我不加引号,它会给我Psych::SyntaxError。这是为什么? @<something>在YAML中有什么特殊含义吗?
require 'yaml'
k = "test: @hello"
YAML.load(k)
# => Psych::SyntaxError: (<unknown>): found character that cannot start any token while scanning for the next token ...
【问题讨论】: