fix unit test

[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9544]
This commit is contained in:
parrt 2011-12-07 13:27:22 -08:00
parent 6c5f3655b9
commit 9173367a1e
1 changed files with 5 additions and 6 deletions

View File

@ -520,15 +520,14 @@ public class TestATNParserPrediction extends BaseTest {
// unambig state maybe. keep going.
LexerGrammar lg = new LexerGrammar(
"lexer grammar L;\n" +
"ID : 'a'..'z'+ ;\n" +
"ID : 'a'..'z' ;\n" + // one char
"SEMI : ';' ;\n"+
"INT : '0'..'9'+ ;\n" +
"WS : (' '|'\n'|'\t')+ {skip();} ;"
"INT : '0'..'9'+ ;\n"
);
Grammar g = new Grammar(
"parser grammar T;\n"+
"tokens {ID;SEMI;INT;WS;}\n" +
"a : (ID | ID ID?) ';' ;");
"tokens {ID;SEMI;INT;}\n" +
"a : (ID | ID ID?) SEMI ;");
int decision = 1;
checkPredictedAlt(lg, g, decision, "a;", 1);
checkPredictedAlt(lg, g, decision, "ab;", 2);