|
From: Uwe K. <uw...@da...> - 2011-12-15 23:10:11
|
Hi!
I have example output from Ruby 1.8 that fails to parse with SnakeYAML:
"36L\tDIESEL" dumped from Ruby 1.8 gives "--- 36L\tDIESEL\n"
When loaded with SnakeYAML it throws an exception:
Exception in thread "main" while scanning for the next token
found character '\t' that cannot start any token
in "<string>", line 1, column 8:
--- 36L DIESEL
^
at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:358)
at org.yaml.snakeyaml.scanner.ScannerImpl.peekToken(ScannerImpl.java:202)
at org.yaml.snakeyaml.parser.ParserImpl$ParseDocumentEnd.produce(ParserImpl.java:265)
at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:161)
at org.yaml.snakeyaml.parser.ParserImpl.getEvent(ParserImpl.java:171)
at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:125)
at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:106)
at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:121)
at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:296)
at org.yaml.snakeyaml.Yaml.load(Yaml.java:266)
at
Issue136.main(Issue136.java:5)
This is currently being tracked at http://code.google.com/p/snakeyaml/issues/detail?id=136
The question is wether the example is legal YAML.
I have read the specs, and I find them inconclusive. Ruby 1.8 has been around for a long while, and the use of YAML with Ruby is widespread, being in the standard library and all. So I assumed that the output is legal YAML and that SnakeYAML should accept it.
Anybody got an answer on this?
--
Uwe Kubosch
Systems Developer
Datek Wireless AS
uw...@da...
http://datek.no/
|