Merge pull request #912 from parrt/add-TokenMismatch2-test-using-new-mechanism

add new unit test TokenMismatch2
This commit is contained in:
Terence Parr 2015-06-16 16:45:01 -07:00
commit 591dca76af
1 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,32 @@
TestType() ::= "Parser"
Options ::= [
"Debug": false
]
Grammar ::= [
"T": {<grammar("T")>}
]
Input() ::= "( ~FORCE_ERROR~ "
Rule() ::= "a"
Output() ::= <<
>>
Errors() ::= <<
line 1:2 mismatched input '~FORCE_ERROR~' expecting ')'<\n>
>>
grammar(grammarName) ::= <<
grammar <grammarName>;
stat: ( '(' expr? ')' )? EOF ;
expr: ID '=' STR ;
ERR : '~FORCE_ERROR~' ;
ID : [a-zA-Z]+ ;
STR : '"' ~["]* '"' ;
WS : [ \t\r\n]+ -> skip ;
>>