Bwidget Source Code
View Ticket
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.
Ticket UUID: 3052576
Title: Lines starting with # in block scalars are ignored
Type: Bug Version: None
Submitter: mpr8 Created on: 2010-08-24 22:25:10
Subsystem: yaml Assigned To: kanryu6
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2013-07-04 17:43:47
Resolution: Not Applicable Here Closed By:
    Closed on:
Description:
See http://yaml.org/ypaste/674/index.yaml
User Comments: mpr8 added on 2010-09-29 11:01:57:
If I understand you right: You think, that lines beginning with # (regardless of indentation level) should be ignored. But that's plain wrong (according to the specification). In your example (that's only readable by e-mail; for other readers: first three content lines are indented by 2 spaces, fourth line is indented by 1 space), the first line prefixed with # is part of the content, the second is of course treated as comment (because it falls out of indentation level). This applies in general to all literal scalar #-lines, regardless where (first line or not) they show up. In my posted real-life complex example (http://yaml.org/ypaste/674/; compare with parse tree to the left) all #-lines are on the same indentation level as all other scalar lines, so they may not be treated as comments, they're part of the scalar content. It would help a lot if you would admit that those lines aren't comments (and start fixing the implementation). ;)

What do you mean with "Please show me the complete examples for the specification."?

kanryu6 added on 2010-08-26 22:44:37:
hmm...

I find a mistake that should'nt ignore "# comment" just next of "|",
for example,

|
  # comment
  literals
  literals
 # ignored as comment

but other problems has been left there?

Please show me the complete examples for the specification.

mpr8 added on 2010-08-26 20:01:24:
#-lines that are otherwise treated as comments (i.e. ignored) should not be treated as comments but literal. In your implementation, those lines completely go missing, but shouldn't. That's my point.
To cite: "The literal style is the simplest, most restricted and most readable scalar style. It is especially suitable for source code or other text containing significant use of indicators, escape sequences and line breaks. In particular, literal content lines may begin with a tab or a “#” character."

kanryu6 added on 2010-08-26 19:33:10:
to see yaml-1.1
http://yaml.org/spec/1.1/#id928558
in the Literal Block Scalar, 
# comment
lins are ignored.