forked from jasder/antlr
add to unit test.
This commit is contained in:
parent
ea652962ea
commit
d3d5bebf9f
|
@ -153,8 +153,20 @@ public class TestATNLexerInterpreter extends BaseTest {
|
|||
"lexer grammar L;\n"+
|
||||
"CMT : '/*' (CMT | .)+ '*/' ;\n" +
|
||||
"WS : (' '|'\n')+ ;");
|
||||
String expecting = "CMT, WS, CMT, EOF";
|
||||
checkLexerMatches(lg, "/* ick */\n/* /*nested*/ */", expecting);
|
||||
String expecting = "CMT, WS, CMT, WS, CMT, WS, EOF";
|
||||
// stuff on end of comment matches another rule
|
||||
checkLexerMatches(lg,
|
||||
"/* ick */\n" +
|
||||
"/* /* */\n" +
|
||||
"/* /*nested*/ */\n",
|
||||
expecting);
|
||||
// stuff on end of comment doesn't match another rule
|
||||
expecting = "CMT, WS, CMT, WS, CMT, WS, EOF";
|
||||
checkLexerMatches(lg,
|
||||
"/* ick */x\n" +
|
||||
"/* /* */x\n" +
|
||||
"/* /*nested*/ */x\n",
|
||||
expecting);
|
||||
}
|
||||
|
||||
@Test public void testLexerWildcardNonGreedyLoopByDefault() throws Exception {
|
||||
|
|
Loading…
Reference in New Issue