youxinren / snakeyaml

Automatically exported from code.google.com/p/snakeyaml
Apache License 2.0
0 stars 0 forks source link

Is it possible to parse and retrieve comments? #70

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello, I use snake parser to represent YAML files in a graphic way with radio 
buttons, combos, lists and input boxes widgets. User is able to add/remove/edit 
elements in the YML file that way. The problem is that, parser is not returning 
me any information about comments in the file, so I am losing all of them after 
I rebuild the YML file with the information of the graphic editor. Is it 
possible to retrieve comments information from the file using the parser and 
store them for later? Thanks.

Original issue reported on code.google.com by ErD...@gmail.com on 8 Jul 2010 at 10:40

GoogleCodeExporter commented 9 years ago
Short answer: no it is not possible at the moment.

Long answer: this is indeed an issue. Unfortunately the YAML specification 
requires that content of the comments is excluded from the further processing. 
SnakeYAML simply follows the specification. I would recommend you to raise a 
question in the YAML list to give the spec authors an indication that keeping 
comments may be important. You may also get a reply why this is done like this 
now. Once there is an agreement how to treat the comments SnakeYAML can 
implement them in its parser.

(Please indicate whether the answer is sufficient to close the issue)

-
Andrey

Original comment by py4fun@gmail.com on 8 Jul 2010 at 2:40

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by py4fun@gmail.com on 9 Jul 2010 at 10:15

GoogleCodeExporter commented 9 years ago
Thanks for the answer.

It seems quite clear, will move the answer to the YAML list.

Regards.

Original comment by ErD...@gmail.com on 9 Jul 2010 at 11:39