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

Parser crashes when function-like define does not end with semicolon #148

Open
unjello opened this issue Jul 12, 2021 · 1 comment
Open

Comments

@unjello
Copy link
Contributor

unjello commented Jul 12, 2021

Parser cannot handle a case with function-like preprocessor being called without a semicolon, even if it's not technically required if proper preprocessor were run, because the semicolon is inside the definition:

#define X(x) x = 1.;

void main() {
    float f;
    X(f)
}

or it's not even required, because the definition is a for-loop:

#define X for(float i=0.; i<1.; i+= 1.) {}
void main() {
    X
}
@unjello
Copy link
Contributor Author

unjello commented Jul 12, 2021

I actually have no idea how to fix it other than introducing define's lookup table and adding actual logic to the parser, which is why I've decided to work around this for now, and not to fix it this very moment. Any thoughts?

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

1 participant