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

Generated parser.c includes '0x1a' literal which fails compilation on windows #452

Closed
blinker29 opened this issue Sep 25, 2019 · 1 comment
Labels

Comments

@blinker29
Copy link

Code generator should avoid '0x1a' literals in source code because (I believe) standard IO libs for windows in non-binary mode interpret '0x1a' as EOF regardless of where it shows up, which causes compilation to fail.

1704] if (lookahead == '<0x19>') ADVANCE(39);
1705] if (lookahead == '<0x1a>') ADVANCE(40);
1706] if (lookahead == '<0x1b>') ADVANCE(41);

Details:
Parser compilation failed.
Stdout: parser.c
...\src\parser.c(1705): fatal error C1004: unexpected end-of-file found

Converting to integer literal works around the problem.

1704] if (lookahead == '<0x19>') ADVANCE(39);
1705] if (lookahead == 26) ADVANCE(40);
1706] if (lookahead == '<0x1b>') ADVANCE(41);

To automate, I needed to implement a post-processor after "tree-sitter generate". I know this is not a problem on Linux, and I'm not a Windows guy, but this is a defect and should probably be fixed at some point when convenient for the maintainers.

@issue-label-bot issue-label-bot bot added the bug label Sep 25, 2019
@maxbrunsfeld
Copy link
Contributor

I believe this was fixed by 5767bbc. The fix will go out in 0.15.13.

@tree-sitter tree-sitter deleted a comment from issue-label-bot bot Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants