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

Quoted error messages are parsed incorrectly #46

Open
fintelia opened this issue Aug 20, 2021 · 1 comment
Open

Quoted error messages are parsed incorrectly #46

fintelia opened this issue Aug 20, 2021 · 1 comment

Comments

@fintelia
Copy link
Contributor

This code for some reason generates an UnexpectedCharacter error instead of producing empty output:

#if 0
#error "abc"
#endif
@Kangz
Copy link
Owner

Kangz commented Aug 23, 2021

This is because the lexer only parses valid GLSL tokens and # (for the preprocessor). Looking at two open-source GLSL preprocessors:

  • ANGLE (WebGL) accepts #error "abc" because " gets tagged as an "other" token here and later the handling of #error appends all the token text until the next newline.
  • glslang has pretty decent string parsing that's used both for #error and #include

We should define how good a string parsing we want to do, then use it for #error.

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