yaml scientific notation syntax -


while working yaml document, found 1 of values getting parsed string snakeyaml:

-8e-05

i found ros, uses yaml-cpp write yamls using following code write array

out << yaml::beginseq; (int = 0; < m.rows*m.cols; ++i)   out << m.data[i]; out << yaml::endseq; 

but c++ code above (copied ros "parse_yml.cpp" in camera_calibration package) creates -8e-05 while snakeyaml parses string.

so who's right, should there bug report? if who? 1.2 yaml specification seems allow optional decimal, couldn't figure out if 1.1 yaml spec allows snakeyaml implements.

the output should parsed !!float according yaml 1.2, !!str in yaml 1.1; @psr says, match json spec.

the yaml 1.2 spec gives json schema , extension, "core schema". in both cases, !!float regular expression is:

[-+]? ( \. [0-9]+ | [0-9]+ ( \. [0-9]* )? ) ( [ee] [-+]? [0-9]+ )? 

which allows optional decimal. (the core schema adds support infinity , not-a-number.)

the yaml 1.1 spec didn't specify type of tag resolution directly, gave several related pages each type. !!float page lists regular expression:

[-+]?([0-9][0-9_]*)?\.[0-9.]*([ee][-+][0-9]+)? 

(as versions base-60, infinity, , not-a-number). appears require decimal.

this has been fixed in snakeyaml (see http://code.google.com/p/snakeyaml/issues/detail?id=130), of version 1.9.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -