-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Incorrect parsing behavior with --preprocess
option enabled
#310
Comments
Thanks for the report! |
@laurentlb I could work on it, but I don't know F# at all 🥲 |
If you want, you can write a few more input test files (similar to https://github.com/laurentlb/Shader_Minifier/blob/master/tests/unit/preprocess.frag and https://github.com/laurentlb/Shader_Minifier/blob/master/tests/unit/preprocess_if.frag), without the .expected files. |
@laurentlb Yeah, I could perhaps formulate multiple levels of support for preprocessor and case coverage by supplying test shader codes. Also, I got a question. Does the preprocessor run during the parsing? Because I tried to minify this code: #define BBB 1
void main() {
vec4 frag = vec4(1);
frag.rgb =
#if BBB
vec3(1)
#else
vec3(0)
#endif
;
gl_FragColor = frag;
} And if failed with:
|
It works with At the moment, the condition after |
For some reason if shader doesn't end with an empty line it throws:
Test code:
Notice there's no whitespace after last
}
Test command:
Current workaround is just to add a new line at the end of the file
The text was updated successfully, but these errors were encountered: