Tabs inside scalars

Uwe Kubosch <[email protected]>
Newsgroups gmane.text.yaml.general
Message-ID <[email protected]>
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
[email protected]
http://datek.no/



------------------------------------------------------------------------------
10 Tips for Better Server Consolidation
Server virtualization is being driven by many needs.  
But none more important than the need to reduce IT complexity 
while improving strategic productivity.  Learn More! 
http://www.accelacomm.com/jaw/sdnl/114/51507609/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.