From 5feca3e33443cecc3d5b4e2b144a24699915c8ff Mon Sep 17 00:00:00 2001 From: Will Faught Date: Wed, 6 Jul 2016 10:51:00 -0700 Subject: [PATCH] Fix ParserErrors.testContextListGetters to print strings --- .../runtime/templates/ParserErrors/ContextListGetters.stg | 4 ++-- .../org/antlr/v4/test/runtime/csharp/TestParserErrors.java | 4 ++-- .../test/org/antlr/v4/test/runtime/go/TestParserErrors.java | 4 ++-- .../test/org/antlr/v4/test/runtime/java/TestParserErrors.java | 4 ++-- .../v4/test/runtime/javascript/node/TestParserErrors.java | 4 ++-- .../org/antlr/v4/test/runtime/python2/TestParserErrors.java | 4 ++-- .../org/antlr/v4/test/runtime/python3/TestParserErrors.java | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/ParserErrors/ContextListGetters.stg b/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/ParserErrors/ContextListGetters.stg index 25ee778f4..3f6016ce5 100644 --- a/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/ParserErrors/ContextListGetters.stg +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/ParserErrors/ContextListGetters.stg @@ -29,6 +29,6 @@ grammar ; } s : (a | b)+; -a : 'a' {}; -b : 'b' {}; +a : 'a' {}; +b : 'b' {}; >> diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestParserErrors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestParserErrors.java index 6abff096b..bad89a082 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestParserErrors.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestParserErrors.java @@ -51,8 +51,8 @@ public class TestParserErrors extends BaseTest { grammarBuilder.append("}\n"); grammarBuilder.append("}\n"); grammarBuilder.append("s : (a | b)+;\n"); - grammarBuilder.append("a : 'a' {Console.Write('a');};\n"); - grammarBuilder.append("b : 'b' {Console.Write('b');};"); + grammarBuilder.append("a : 'a' {Console.Write(\"a\");};\n"); + grammarBuilder.append("b : 'b' {Console.Write(\"b\");};"); String grammar = grammarBuilder.toString(); String input ="abab"; String found = execParser("T.g4", grammar, "TParser", "TLexer", "s", input, true); diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestParserErrors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestParserErrors.java index 4df7a2b29..4e1bc1f19 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestParserErrors.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestParserErrors.java @@ -55,8 +55,8 @@ public class TestParserErrors extends BaseTest { grammarBuilder.append("}\n"); grammarBuilder.append("}\n"); grammarBuilder.append("s : (a | b)+;\n"); - grammarBuilder.append("a : 'a' {fmt.Print('a')};\n"); - grammarBuilder.append("b : 'b' {fmt.Print('b')};"); + grammarBuilder.append("a : 'a' {fmt.Print(\"a\")};\n"); + grammarBuilder.append("b : 'b' {fmt.Print(\"b\")};"); String grammar = grammarBuilder.toString(); String input ="abab"; String found = execParser("T.g4", grammar, "TParser", "TLexer", diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestParserErrors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestParserErrors.java index 4788eb79b..fb0bfd94d 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestParserErrors.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestParserErrors.java @@ -61,8 +61,8 @@ public class TestParserErrors extends BaseTest { grammarBuilder.append("}\n"); grammarBuilder.append("}\n"); grammarBuilder.append("s : (a | b)+;\n"); - grammarBuilder.append("a : 'a' {System.out.print('a');};\n"); - grammarBuilder.append("b : 'b' {System.out.print('b');};"); + grammarBuilder.append("a : 'a' {System.out.print(\"a\");};\n"); + grammarBuilder.append("b : 'b' {System.out.print(\"b\");};"); String grammar = grammarBuilder.toString(); diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/node/TestParserErrors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/node/TestParserErrors.java index ec893e13c..ec83d8463 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/node/TestParserErrors.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/node/TestParserErrors.java @@ -57,8 +57,8 @@ public class TestParserErrors extends BaseTest { grammarBuilder.append(" };\n"); grammarBuilder.append("}\n"); grammarBuilder.append("s : (a | b)+;\n"); - grammarBuilder.append("a : 'a' {process.stdout.write('a');};\n"); - grammarBuilder.append("b : 'b' {process.stdout.write('b');};"); + grammarBuilder.append("a : 'a' {process.stdout.write(\"a\");};\n"); + grammarBuilder.append("b : 'b' {process.stdout.write(\"b\");};"); String grammar = grammarBuilder.toString(); String input ="abab"; String found = execParser("T.g4", grammar, "TParser", "TLexer", diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestParserErrors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestParserErrors.java index 787fc9f8e..91329d88c 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestParserErrors.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestParserErrors.java @@ -62,8 +62,8 @@ public class TestParserErrors extends BasePython2Test { grammarBuilder.append(" b = s.b()\n"); grammarBuilder.append("}\n"); grammarBuilder.append("s : (a | b)+;\n"); - grammarBuilder.append("a : 'a' {print('a',end='')};\n"); - grammarBuilder.append("b : 'b' {print('b',end='')};"); + grammarBuilder.append("a : 'a' {print(\"a\",end='')};\n"); + grammarBuilder.append("b : 'b' {print(\"b\",end='')};"); String grammar = grammarBuilder.toString(); diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestParserErrors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestParserErrors.java index be494441b..a611eb426 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestParserErrors.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestParserErrors.java @@ -62,8 +62,8 @@ public class TestParserErrors extends BasePython3Test { grammarBuilder.append(" b = s.b()\n"); grammarBuilder.append("}\n"); grammarBuilder.append("s : (a | b)+;\n"); - grammarBuilder.append("a : 'a' {print('a',end='')};\n"); - grammarBuilder.append("b : 'b' {print('b',end='')};"); + grammarBuilder.append("a : 'a' {print(\"a\",end='')};\n"); + grammarBuilder.append("b : 'b' {print(\"b\",end='')};"); String grammar = grammarBuilder.toString();