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

Add grammar for ternary exp and union member access #513

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

thetarnav
Copy link
Contributor

Fixes #512

The issue was caused by the : char which is used to trigger a type-annotation expression, but is also used in other syntaxes.

This adds grammar for ternaries (a ? b : c), union member accesses (a.? and a.(b)), slicing [:] and inferring the array length [?]

@DanielGavin DanielGavin merged commit 5b9fa49 into DanielGavin:master Sep 25, 2024
5 checks passed
@thetarnav thetarnav deleted the fix-ternary-grammar branch September 25, 2024 15:18
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.

VSCode extension highlights an enum field as a type when used with the ternary if operator after the colon.
2 participants