A Multi-Column Listbox
View Ticket
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Ticket UUID: 3475081
Title: Parser accepts invalid YAML input, mistranslates others
Type: Bug Version: None
Submitter: andreas_kupries Created on: 2012-01-17 20:09:20
Subsystem: yaml Assigned To: kanryu6
Priority: 8 Severity:
Status: Deleted Last Modified: 2013-07-04 17:49:28
Resolution: Not Applicable Here Closed By:
    Closed on:
The yaml parser v0.3.6 (tcllib cvs head) accepts the following invalid YAML text:

    list-no-comma: [ "a" "b" "c" ]

It returns {list-no-comma {a b c}} whereas it should throw an error complaining about the lack of commas between the quoted list elements.
Entering the above string into the online YAML validator/parser at




while parsing a flow sequence
  in "<unicode string>", line 1, column 16:
    list-no-comma: [ "a" "b" "c" ]
expected ',' or ']', but got '<scalar>'
  in "<unicode string>", line 1, column 22:
    list-no-comma: [ "a" "b" "c" ]

The second block in the error report is the important one.
User Comments: andreas_kupries added on 2012-01-19 04:17:32:
The valid YAML
    x: [ "a": "b", "c": "d" ]

is mis-translated as          {x {a b c d}}
It should be translated as {x {{a b} {c d}}
I.e. the value x is mapped to is a sequence of pair-mappings, not a plain sequence.