From 441587e8598ba25961e3cb20c88d4f425027ab8a Mon Sep 17 00:00:00 2001 From: parrt Date: Tue, 16 Jun 2015 16:44:02 -0700 Subject: [PATCH] add new unit test corresponding to https://github.com/antlr/antlr4/commit/2e06ed8360b8df2cbdca1da73b3bd7de589a910f --- .../templates/ParserErrors/TokenMismatch2 | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/ParserErrors/TokenMismatch2 diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/ParserErrors/TokenMismatch2 b/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/ParserErrors/TokenMismatch2 new file mode 100644 index 000000000..d8d321dd4 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/ParserErrors/TokenMismatch2 @@ -0,0 +1,32 @@ +TestType() ::= "Parser" + +Options ::= [ + "Debug": false +] + +Grammar ::= [ + "T": {} +] + +Input() ::= "( ~FORCE_ERROR~ " + +Rule() ::= "a" + +Output() ::= << +>> + +Errors() ::= << +line 1:2 mismatched input '~FORCE_ERROR~' expecting ')'<\n> +>> + +grammar(grammarName) ::= << +grammar ; + +stat: ( '(' expr? ')' )? EOF ; +expr: ID '=' STR ; + +ERR : '~FORCE_ERROR~' ; +ID : [a-zA-Z]+ ; +STR : '"' ~["]* '"' ; +WS : [ \t\r\n]+ -> skip ; +>>