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

[BUG] cannot parse expression with const int #84

Open
1m1-github opened this issue Apr 14, 2023 · 1 comment
Open

[BUG] cannot parse expression with const int #84

1m1-github opened this issue Apr 14, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@1m1-github
Copy link

Describe the bug

int x = 1
const int X = 1
int y = 1
 # next line is ok
_ = x * y
 # next line is NOT ok
_ = X * y

Error: Cannot parse "X * y" as Expression

To Reproduce
Steps to reproduce the behavior.

Expected behavior
both lines should compile

Additional context
Add any other context about the problem here.

@1m1-github 1m1-github added the bug Something isn't working label Apr 14, 2023
@fergalwalsh
Copy link
Collaborator

I think there is an inconsistency in the parsing rules for const names. The declaration allows 1 character names but the rest of the code expects >1 character in the name.
The solution for now is to use multi character names.
I'll look into it in more detail to check if we really want to support 1 character names for consts.

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

No branches or pull requests

2 participants