The parser have trouble parsing list with no trailing space before the closing bracket
Godzil opened this issue · comments
Manoël Trapier commented
So it seems the parser is confused when an inline list does not have space juste before the ]
:
item:
test: [ 1, 0, 1 ]
will work fine, but the other valid
item:
test: [ 1, 0, 1]
will end with an error about a missing comma because it think that 1]
is a string token instead of a number followed by ]
I'm trying to find a way to solve the issue as it prevent to parse some perfectly valid YAML files.
Sebastian Stern commented
Probably related to the fix: Parsing an empty list with whitespace causes an error.
a: [ ]
Will cause the error
lua.exe: ... <file>: ParseError: unexpected token ']'
stack traceback:
[C]: in function 'error'
... yaml.lua:340: in function 'parse'
Tested with Lua 5.1.