tealish
tealish copied to clipboard
[BUG] cannot parse expression with `const int`
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.
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.