-
Notifications
You must be signed in to change notification settings - Fork 9
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
GLSL preprocessor: support for #define, #ifdef etc. #4
Comments
Being a preprocessor, I thought it could (or even should) be implemented separately from the main parser (provided by language-glsl). But it seems it would be better to include it in language-glsl: for instance error messages have to take the I don't think it should be a problem for language-glsl to parse the preprocessor directives and expose them as top-level data types in the resulting parse tree. Or maybe even interpret them and push the result (e.g. optimization hint) into the existing (but then enriched) data types. Conceptually mixing the line-oriented nature of the preprocessor with the rest of the language is a bit weird but I don't think it would prevent it to be part of the parser. |
@nphollon I don't think I will have time to work on this but would happily accept a patch. |
The preprocessor is part of the GLSL spec, section 3.4 of https://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf
Is it even possible to handle #define and #ifdef properly in language-glsl?
The text was updated successfully, but these errors were encountered: