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

Use the custom scanner to split ! from . #84

Merged
merged 1 commit into from
Jan 1, 2022
Merged

Conversation

alex-pinkus
Copy link
Owner

So far, we've tolerated the parser treating !. as one operator when it
should really be two. This changes that behavior so that we better match
the actual semantics of !., which is a bang-operator followed by
navigation.

We do this by adding ! to the custom scanner, but this also requires
us to generalize the custom scanner's operators and indicate that they
are not all cross-semi operators. That's because ! at the start of a
line is valid (although it will usually result in a warning) - it gives
us a standalone expression that negates what comes after the !.

So far, we've tolerated the parser treating `!.` as one operator when it
should really be two. This changes that behavior so that we better match
the actual semantics of `!.`, which is a bang-operator followed by
navigation.

We do this by adding `!` to the custom scanner, but this also requires
us to generalize the custom scanner's operators and indicate that they
are not all cross-semi operators. That's because `!` at the start of a
line is valid (although it will usually result in a warning) - it gives
us a standalone expression that negates what comes after the `!`.
@alex-pinkus alex-pinkus merged commit b2ac123 into main Jan 1, 2022
@alex-pinkus alex-pinkus deleted the bang-custom-scanner branch January 1, 2022 00:47
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.

1 participant