-
Notifications
You must be signed in to change notification settings - Fork 28
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
#if and #ifdef fail to parse #64
Comments
Yes, CPP is not yet supported. Only a very few subset of it is currently supported. I don’t really know whether |
I’m going to work on this. I will likely provide a new feature for parsing with options. |
that would be great thanks! |
Do you have a rough idea how you want to implement preprocessing? It seems difficult to fit into the current parser which doesn't seem to have a separate lexing stage. |
Yes it doesn’t. At first I thought to use a different crate for this, because the CPP used is exactly the same as the C one, plus some specific pragma for GLSL. |
Using an existing cpp preprocessing crate will need some modification as the GLSL preprocessor allows white space before '#'. There might be other differences as well. |
See #95. |
#96 is going to bring those to the next release. :) |
that's great, haven't had a chance to test it yet but will report as soon as i do if i find any problem. should i close this issue? thanks for looking into it! |
Nah leave it open, we’ll close it whenever we have more test data and usage. You’re very welcome. |
Feel free to tell me whenever you have time if your issue is fixed with |
using v4.0.0
the following fails to parse void make_drawbuffer() {
#ifdef GL_RENDERER_GEFORCE
vec3 temp = clamp(scenecol, 1.0/65530.0, 65535.0); //NaN fix on nvidia
#else
vec3 temp = clamp(scenecol, 0.0, 65535.0);
#endif
} with error:
|
Yes, unfortunately, those are currently only supported at the top-level of your shader. |
Closes hadronized#64. Closes hadronized#117.
Closes hadronized#64. Closes hadronized#117.
Closes hadronized#64. Closes hadronized#117.
Closes hadronized#64. Closes hadronized#117.
Closes hadronized#64. Closes hadronized#117.
Any input with #if or #ifdef fails to parse with an error of ErrorKind Custom(0).
eg:
panics with error Custom(0). removing the ifs makes the parser work correctly
The text was updated successfully, but these errors were encountered: