From 40b7e1bf1201fe571fdf472c109c883dcce75091 Mon Sep 17 00:00:00 2001 From: Will Faught Date: Thu, 16 Jun 2016 16:21:45 -0700 Subject: [PATCH] Fix parser tokens in generated Go tests --- .../resources/org/antlr/v4/test/runtime/csharp/CSharp.test.stg | 2 ++ .../resources/org/antlr/v4/test/runtime/go/Go.test.stg | 2 ++ .../resources/org/antlr/v4/test/runtime/java/Java.test.stg | 2 ++ .../org/antlr/v4/test/runtime/javascript/chrome/Chrome.test.stg | 2 ++ .../antlr/v4/test/runtime/javascript/explorer/Explorer.test.stg | 2 ++ .../antlr/v4/test/runtime/javascript/firefox/Firefox.test.stg | 2 ++ .../org/antlr/v4/test/runtime/javascript/node/Node.test.stg | 2 ++ .../org/antlr/v4/test/runtime/javascript/safari/Safari.test.stg | 2 ++ .../org/antlr/v4/test/runtime/python2/Python2.test.stg | 2 ++ .../org/antlr/v4/test/runtime/python3/Python3.test.stg | 2 ++ .../v4/test/runtime/templates/ParserExec/PredicatedIfIfElse.stg | 2 +- .../templates/SemPredEvalParser/PredFromAltTestedInLoopBack.stg | 2 +- 12 files changed, 22 insertions(+), 2 deletions(-) diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/csharp/CSharp.test.stg b/runtime-testsuite/resources/org/antlr/v4/test/runtime/csharp/CSharp.test.stg index 95e23c671..6627820d7 100644 --- a/runtime-testsuite/resources/org/antlr/v4/test/runtime/csharp/CSharp.test.stg +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/csharp/CSharp.test.stg @@ -227,6 +227,8 @@ RuleInvocationStack() ::= "GetRuleInvocationStackAsString()" LL_EXACT_AMBIG_DETECTION() ::= <> +ParserToken(parser, token) ::= <%.%> + ParserPropertyMember() ::= << @members { bool Property() { diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/go/Go.test.stg b/runtime-testsuite/resources/org/antlr/v4/test/runtime/go/Go.test.stg index 171405c69..bbf5555a4 100644 --- a/runtime-testsuite/resources/org/antlr/v4/test/runtime/go/Go.test.stg +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/go/Go.test.stg @@ -229,6 +229,8 @@ RuleInvocationStack() ::= "p.GetRuleInvocationStack(nil)" LL_EXACT_AMBIG_DETECTION() ::= <> +ParserToken(parser, token) ::= <%%> + ParserPropertyMember() ::= << @members { func Property() bool { diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/java/Java.test.stg b/runtime-testsuite/resources/org/antlr/v4/test/runtime/java/Java.test.stg index 45fd50413..9600a5d0d 100644 --- a/runtime-testsuite/resources/org/antlr/v4/test/runtime/java/Java.test.stg +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/java/Java.test.stg @@ -233,6 +233,8 @@ RuleInvocationStack() ::= "getRuleInvocationStack()" LL_EXACT_AMBIG_DETECTION() ::= <<_interp.setPredictionMode(PredictionMode.LL_EXACT_AMBIG_DETECTION);>> +ParserToken(parser, token) ::= <%.%> + ParserPropertyMember() ::= << @members { boolean Property() { diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/javascript/chrome/Chrome.test.stg b/runtime-testsuite/resources/org/antlr/v4/test/runtime/javascript/chrome/Chrome.test.stg index 56f70b081..2a0b27ebc 100644 --- a/runtime-testsuite/resources/org/antlr/v4/test/runtime/javascript/chrome/Chrome.test.stg +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/javascript/chrome/Chrome.test.stg @@ -233,6 +233,8 @@ RuleInvocationStack() ::= "antlr4.Utils.arrayToString(this.getRuleInvocationStac LL_EXACT_AMBIG_DETECTION() ::= <> +ParserToken(parser, token) ::= <%.%> + ParserPropertyMember() ::= << @members { this.Property = function() { diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/javascript/explorer/Explorer.test.stg b/runtime-testsuite/resources/org/antlr/v4/test/runtime/javascript/explorer/Explorer.test.stg index e85e5c8eb..0d084b09a 100644 --- a/runtime-testsuite/resources/org/antlr/v4/test/runtime/javascript/explorer/Explorer.test.stg +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/javascript/explorer/Explorer.test.stg @@ -233,6 +233,8 @@ RuleInvocationStack() ::= "antlr4.Utils.arrayToString(this.getRuleInvocationStac LL_EXACT_AMBIG_DETECTION() ::= <> +ParserToken(parser, token) ::= <%.%> + ParserPropertyMember() ::= << @members { this.Property = function() { diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/javascript/firefox/Firefox.test.stg b/runtime-testsuite/resources/org/antlr/v4/test/runtime/javascript/firefox/Firefox.test.stg index 892c2c924..7254725f8 100644 --- a/runtime-testsuite/resources/org/antlr/v4/test/runtime/javascript/firefox/Firefox.test.stg +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/javascript/firefox/Firefox.test.stg @@ -235,6 +235,8 @@ RuleInvocationStack() ::= "antlr4.Utils.arrayToString(this.getRuleInvocationStac LL_EXACT_AMBIG_DETECTION() ::= <> +ParserToken(parser, token) ::= <%.%> + ParserPropertyMember() ::= << @members { this.Property = function() { diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/javascript/node/Node.test.stg b/runtime-testsuite/resources/org/antlr/v4/test/runtime/javascript/node/Node.test.stg index 2d37b028a..31debe16c 100644 --- a/runtime-testsuite/resources/org/antlr/v4/test/runtime/javascript/node/Node.test.stg +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/javascript/node/Node.test.stg @@ -233,6 +233,8 @@ RuleInvocationStack() ::= "antlr4.Utils.arrayToString(this.getRuleInvocationStac LL_EXACT_AMBIG_DETECTION() ::= <> +ParserToken(parser, token) ::= <%.%> + ParserPropertyMember() ::= << @members { this.Property = function() { diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/javascript/safari/Safari.test.stg b/runtime-testsuite/resources/org/antlr/v4/test/runtime/javascript/safari/Safari.test.stg index a78e877aa..0293b5703 100644 --- a/runtime-testsuite/resources/org/antlr/v4/test/runtime/javascript/safari/Safari.test.stg +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/javascript/safari/Safari.test.stg @@ -233,6 +233,8 @@ RuleInvocationStack() ::= "antlr4.Utils.arrayToString(this.getRuleInvocationStac LL_EXACT_AMBIG_DETECTION() ::= <> +ParserToken(parser, token) ::= <%.%> + ParserPropertyMember() ::= << @members { this.Property = function() { diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/python2/Python2.test.stg b/runtime-testsuite/resources/org/antlr/v4/test/runtime/python2/Python2.test.stg index 401d28190..881a567f4 100644 --- a/runtime-testsuite/resources/org/antlr/v4/test/runtime/python2/Python2.test.stg +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/python2/Python2.test.stg @@ -237,6 +237,8 @@ RuleInvocationStack() ::= "str_list(self.getRuleInvocationStack())" LL_EXACT_AMBIG_DETECTION() ::= <> +ParserToken(parser, token) ::= <%.%> + ParserPropertyMember() ::= << @members { def Property(self): diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/python3/Python3.test.stg b/runtime-testsuite/resources/org/antlr/v4/test/runtime/python3/Python3.test.stg index 21315805d..7dea67cf6 100644 --- a/runtime-testsuite/resources/org/antlr/v4/test/runtime/python3/Python3.test.stg +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/python3/Python3.test.stg @@ -239,6 +239,8 @@ RuleInvocationStack() ::= "str_list(self.getRuleInvocationStack())" LL_EXACT_AMBIG_DETECTION() ::= <> +ParserToken(parser, token) ::= <%.%> + ParserPropertyMember() ::= << @members { def Property(self): diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/ParserExec/PredicatedIfIfElse.stg b/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/ParserExec/PredicatedIfIfElse.stg index 92ba179f0..21bc21b89 100644 --- a/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/ParserExec/PredicatedIfIfElse.stg +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/ParserExec/PredicatedIfIfElse.stg @@ -25,7 +25,7 @@ grammar(grammarName) ::= << grammar ; s : stmt EOF ; stmt : ifStmt | ID; -ifStmt : 'if' ID stmt ('else' stmt | { Parser.ELSE})> }?); +ifStmt : 'if' ID stmt ('else' stmt | { })> }?); ELSE : 'else'; ID : [a-zA-Z]+; WS : [ \\n\\t]+ -> skip; diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/SemPredEvalParser/PredFromAltTestedInLoopBack.stg b/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/SemPredEvalParser/PredFromAltTestedInLoopBack.stg index 2ce868b63..e75dadd2c 100644 --- a/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/SemPredEvalParser/PredFromAltTestedInLoopBack.stg +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/SemPredEvalParser/PredFromAltTestedInLoopBack.stg @@ -18,7 +18,7 @@ file_ @after {} : para para EOF ; para: paraContent NL NL ; -paraContent : ('s'|'x'|{Parser.NL})>}? NL)+ ; +paraContent : ('s'|'x'|{})>}? NL)+ ; NL : '\n' ; s : 's' ; X : 'x' ;