diff --git a/contributors.txt b/contributors.txt index cc6173644..a629610e3 100644 --- a/contributors.txt +++ b/contributors.txt @@ -148,3 +148,4 @@ YYYY/MM/DD, github id, Full name, email 2017/05/11, jimallman, Jim Allman, jim@ibang.com 2017/05/26, waf, Will Fuqua, wafuqua@gmail.com 2017/05/29, kosak, Corey Kosak, kosak@kosak.com +2017/06/25, alimg, Alim Gökkaya, alim.gokkaya@gmail.com diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/ParserErrorsDescriptors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/ParserErrorsDescriptors.java index c34c9c2bb..0b53e994e 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/ParserErrorsDescriptors.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/ParserErrorsDescriptors.java @@ -581,4 +581,41 @@ public class ParserErrorsDescriptors { public String grammar; } + + public static class TokenMismatch3 extends BaseParserTestDescriptor { + public String input = ""; + public String output = null; + public String errors = "line 1:0 mismatched input '' expecting {'(', BOOLEAN_LITERAL, ID, '$'}\n"; + public String startRule = "expression"; + public String grammarName = "T"; + + /** + grammar T; + + expression + : value + | expression op=AND expression + | expression op=OR expression + ; + value + : BOOLEAN_LITERAL + | ID + | ID1 + | '(' expression ')' + ; + + AND : '&&'; + OR : '||'; + + BOOLEAN_LITERAL : 'true' | 'false'; + + ID : [a-z]+; + ID1 : '$'; + + WS : [ \t\r\n]+ -> skip ; + */ + @CommentHasStringValue + public String grammar; + + } } diff --git a/runtime/Python2/src/antlr4/IntervalSet.py b/runtime/Python2/src/antlr4/IntervalSet.py index 6c3d4951e..addc82ef9 100644 --- a/runtime/Python2/src/antlr4/IntervalSet.py +++ b/runtime/Python2/src/antlr4/IntervalSet.py @@ -193,7 +193,7 @@ class IntervalSet(object): elif a==Token.EPSILON: return u"" else: - if a": return literalNames[a] if a" else: - if a