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

Windows-style line endings cause panic on Lua 5.1 example #1

Closed
Fuwn opened this issue Apr 22, 2021 · 2 comments
Closed

Windows-style line endings cause panic on Lua 5.1 example #1

Fuwn opened this issue Apr 22, 2021 · 2 comments

Comments

@Fuwn
Copy link

Fuwn commented Apr 22, 2021

Haven't experimented much with the core package yet but right off the bat I noticed that when running the Lua example using Unix-style line endings, it works fine however, running the example using Windows-style line endings, it panics.

@osa1
Copy link
Owner

osa1 commented Apr 23, 2021

Thanks for trying this and reporting. I'm not sure what you mean by panics, I couldn't make it panic when I inserted some random \r\ns in the Lua files distributed with Lua 5.1.5 tarball. I get lexer errors, but no panics. Could you show me the full output please?

I just pushed a commit for treating \r\n as whitespace in the Lua lexer, which fixes the lexer errors when the file uses \r\n as line endings.

For the record, the Lua parser is not supposed to be a production-ready Lua lexer. It's just an example that demonstrates all features of lexgen (lexer and users states, use of the handler type etc.). I'm still happy to fix any bugs in it though.

@Fuwn
Copy link
Author

Fuwn commented Apr 23, 2021

My fault, I did mean a lex' error not a panic. Nonetheless, thank you for fixing and I understand about the production-ready aspect, just didn't want someone to come across this repository and the first thing they get is a lex'ing error when experimenting.

@Fuwn Fuwn closed this as completed Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants