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

More accurate error messages #1724

Merged
merged 8 commits into from
Mar 3, 2017

Conversation

KvanTTT
Copy link
Member

@KvanTTT KvanTTT commented Mar 3, 2017

No description provided.

@@ -1140,7 +1140,7 @@ SignedInteger

fragment
Sign
: [+-]
: [+\-]
Copy link
Member

Choose a reason for hiding this comment

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

So this is no longer possible without escaping the minus? It worked when the minus was at the end of the set list.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, not possible. Old syntax was a bit incorrect.

Copy link
Member

@sharwell sharwell Mar 3, 2017

Choose a reason for hiding this comment

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

@KvanTTT Old syntax was pretty common. I expect it to remain valid. It's by far the most common way I include a - in a set.

@@ -147,6 +150,29 @@ private static void optimizeSets(Grammar g, ATN atn) {
// System.out.println("ATN optimizer removed " + removedStates + " states by collapsing sets.");
}

private static String getIntervalSetEscapedString(IntervalSet intervalSet) {
Copy link
Member

@parrt parrt Mar 3, 2017

Choose a reason for hiding this comment

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

not sure this belongs in this class. maybe it goes in CharSupport?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I'll move it to CharSupport.

@KvanTTT
Copy link
Member Author

KvanTTT commented Mar 3, 2017

Much better :)

@parrt parrt added this to the 4.7 milestone Mar 3, 2017
@parrt parrt merged commit 924b3d1 into antlr:master Mar 3, 2017
@parrt
Copy link
Member

parrt commented Mar 3, 2017

@sharwell oh, yeah, didn't we long time ago say anything not terminated was just the '-' char? Dang. @KvanTTT how big is the change to flip a- and -z to be two char not a range.

@KvanTTT
Copy link
Member Author

KvanTTT commented Mar 3, 2017

Pretty easy.

@parrt
Copy link
Member

parrt commented Mar 3, 2017

ok, let's do that. thanks!

@KvanTTT KvanTTT deleted the more-accurate-error-messages branch May 9, 2017 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants