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

CONST does not produce an error on invalid syntax such as two digits in a row #192

Closed
mkilgore opened this issue Sep 25, 2022 · 1 comment · Fixed by #435
Closed

CONST does not produce an error on invalid syntax such as two digits in a row #192

mkilgore opened this issue Sep 25, 2022 · 1 comment · Fixed by #435
Labels
bug Something isn't working const-issues

Comments

@mkilgore
Copy link
Contributor

This is fairly simple, the line CONST foobar = 2 3 4 5 should be invalid syntax, but instead it is treated as though you wrote CONST foobar = 2345. This is due to some logic in PreParse, which is part of the Evaluate_Expression$ logic. Early on in PreParse all spaces are removed from the expression and for invalid expressions such as this example that ends up producing valid syntax and thus no error is produced.

@mkilgore
Copy link
Contributor Author

I'm not entirely sure how related this is to my above example, but CONST foobar = OR 2 is also incorrectly treated as valid. It seems any boolean expression can be used in this fashion and it seemingly treats the first argument as zero (but that may not stay the case in more complex scenarios).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working const-issues
Projects
Development

Successfully merging a pull request may close this issue.

1 participant