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

Reorder some rules #88

Merged
merged 1 commit into from
Apr 10, 2023
Merged

Reorder some rules #88

merged 1 commit into from
Apr 10, 2023

Conversation

Serchinastico
Copy link
Owner

The order of rules in ANTLR is quite important, as they take precedence based on when they are defined. Here, I'm putting the ALPHA_NUMERIC and ALPHA_NUMERIC_CAP rules below the QUOTED_STRING and NON_QUOTED_STRING rules so that when we find a single-letter identifier (i.e. a file name) ANTLR detects the STRING rules before the ALPHA_NUMERIC ones.

This is most likely caused by a badly defined grammar (and probably the lack of proper fragments). However, this is, I think, a good compromise if we don't want to tackle a full rewrite of the grammar.

tests/ok/011.pbxproj is a copy of 010.pbxproj adding a directory called C

🎟️ Issue: #52

The order of rules in ANTLR is quite important, as they take precedence
based on when they are defined. Here, I'm putting the ALPHA_NUMERIC and
ALPHA_NUMERIC_CAP rules below the QUOTED_STRING and NON_QUOTED_STRING
rules so that when we find a single-letter identifier (i.e. a file name)
ANTLR detects the *_STRING rules before the ALPHA_NUMERIC_* ones.

This is most likely caused by a badly defined grammar (and probably the
lack of proper fragments). However, this is, I think, a good compromise
if we don't want to tackle a full rewrite of the grammar.
@Serchinastico Serchinastico merged commit 143695b into main Apr 10, 2023
@Serchinastico Serchinastico deleted the fix-single-letter-files branch April 10, 2023 15:00
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