From f0d1a093ed0d704527d4cb63b70f69ae90180a64 Mon Sep 17 00:00:00 2001 From: alimg Date: Mon, 19 Jun 2017 18:51:59 +0300 Subject: [PATCH 1/3] Python: fix reported input alternatives are not in par with Java version --- runtime/Python2/src/antlr4/IntervalSet.py | 2 +- runtime/Python3/src/antlr4/IntervalSet.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 Date: Tue, 20 Jun 2017 16:48:08 +0300 Subject: [PATCH 2/3] add parser error test case to replicate the Python formatting issue --- .../descriptors/ParserErrorsDescriptors.java | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) 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; + + } } From 4b21583e2bd61c923f923d56b2369cfb8d4531e3 Mon Sep 17 00:00:00 2001 From: alimg Date: Sun, 25 Jun 2017 19:04:03 +0300 Subject: [PATCH 3/3] signing in contributors.txt --- contributors.txt | 1 + 1 file changed, 1 insertion(+) 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