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

Improve switch handling of brackets and integer/long #216

Conversation

kjonescertinia
Copy link
Contributor

This fixes the handling of brackets around switch then literals, the parser has supported these for a while but apex-ls was broken if you tried to use them.

While working on that I noticed the handling of + & - before integer and long literals was broken. To fix this requires the change in apex-dev-tools/apex-parser#29 which allows for sequences of + & - before either integer or long literals. Only alternating sequences of + and - are supported, + can be treated as a no-op as can an even number of -. Where a long control value is used the when value may be an integer but the reverse is not supported even if the long value may fit in an int.

@kjonescertinia kjonescertinia merged commit fcc79aa into main Sep 6, 2023
@kjonescertinia kjonescertinia deleted the 213-using-brackets-on-switch-when-expressions-that-are-expecting-literals-causes-an-exception branch October 10, 2023 16:43
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

Successfully merging this pull request may close these issues.

Using brackets on switch when expressions that are expecting literals causes an exception
2 participants