Skip to content

Fix parsing ambiguity around adjacent > and = tokens #335

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

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

Cirras
Copy link
Collaborator

@Cirras Cirras commented Feb 10, 2025

This PR fixes a grammar ambiguity around adjacent > and = tokens. (Fixes #318)

We now create >= tokens during parsing by combining the >/= tokens, instead of combining them at the lexing stage.
(For consistently, we're doing this for "less than equal" tokens as well)

This allows us to only create >= tokens when we're parsing a binary expression.

As a result, we can now successfully parse code that looks like this:

const Foo: TArray<Byte>=[1, 2, 3];

Previously this would create a >= token in the middle and make everything fall over.

@Cirras Cirras requested a review from fourls February 10, 2025 04:50
Copy link
Collaborator

@fourls fourls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! A couple questions.

@Cirras Cirras force-pushed the gte_tokens_are_stupid_and_i_hate_them branch from 2762071 to e83aa79 Compare February 10, 2025 22:05
Copy link
Collaborator

@fourls fourls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@Cirras Cirras merged commit 2ce511e into master Feb 10, 2025
4 checks passed
@Cirras Cirras deleted the gte_tokens_are_stupid_and_i_hate_them branch February 10, 2025 22: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.

parsing error on method parameter declaration "cAdditionalSQL: IDictionary<string, string>=nil"
2 participants