According to the specification, Yaml 1.1 1:16 is an integer in the format sexagesimal (base 60).
See also http://yaml.org/type/int.html , which states:
Using ":" allows you to express integers in the base 60, which is convenient for the values of time and angle.
Yaml, Ruby, Psych, (, 1:16 shoud be 71 - Psych , a:b:c, ). Perl ( , YAML:: XS, ) , . YAML:: XS , . YAML:: XS (, ), Psych.
(, Yaml 1.2 .)
Psych - YAML.load_file - .
parse Psych yaml, Ruby, ScalarScanner ( , Ruby):
require('yaml')
class MyScalarScanner < Psych::ScalarScanner
def tokenize string
return string if string =~ /^[-+]?[0-9][0-9_]*(:[0-5]?[0-9])+$/
super
end
end
tree = YAML::parse_file 'test.yaml'
foo = Psych::Visitors::ToRuby.new(MyScalarScanner.new).accept tree
, YAML.load_file, , .
ScalarScanner tokenize . load_file, :
class Psych::ScalarScanner
alias :orig_tokenize :tokenize
def tokenize string
return string if string =~ /^[-+]?[0-9][0-9_]*(:[0-5]?[0-9])+$/
orig_tokenize string
end
end
foo = YAML.load_file 'test.yaml'
, 1:16. , Perl, . , , , , float floaceimal (, 1:16.44).