Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The parser have trouble parsing list with no trailing space before the closing bracket #8

Open
Godzil opened this issue Mar 10, 2020 · 1 comment

Comments

@Godzil
Copy link
Contributor

Godzil commented Mar 10, 2020

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.

Godzil added a commit to Godzil/lua-yaml that referenced this issue Mar 10, 2020
@Sebaestschjin
Copy link

Sebaestschjin commented Jan 13, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants