fixed unit tests
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 6719]
This commit is contained in:
parent
49d7d03238
commit
2e6aee85af
|
@ -104,8 +104,8 @@ public class SemanticPipeline {
|
|||
|
||||
// DEFINE TOKEN TYPES FOR STRING LITERAL REFS LIKE 'while', ';'
|
||||
for (String s : collector.strings) { G.defineStringLiteral(s); }
|
||||
System.out.println("tokens="+G.tokenNameToTypeMap);
|
||||
System.out.println("strings="+G.stringLiteralToTypeMap);
|
||||
// System.out.println("tokens="+G.tokenNameToTypeMap);
|
||||
// System.out.println("strings="+G.stringLiteralToTypeMap);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,9 +16,9 @@ public class TestBasicSemanticErrors extends BaseTest {
|
|||
"b : A^ | ((B!|C)) -> C;",
|
||||
// YIELDS
|
||||
"error(68): A.g:7:7: alts with rewrites can't use heterogeneous types left of ->\n" +
|
||||
"error(77): A.g:9:4: AST operator with non-AST output option: ^\n" +
|
||||
"error(77): A.g:9:11: AST operator with non-AST output option: !\n" +
|
||||
"error(78): A.g:9:11: rule b alt 2 uses rewrite syntax and also an AST operator",
|
||||
"error(78): A.g:9:4: AST operator with non-AST output option: ^\n" +
|
||||
"error(78): A.g:9:11: AST operator with non-AST output option: !\n" +
|
||||
"error(79): A.g:9:11: rule b alt 2 uses rewrite syntax and also an AST operator",
|
||||
|
||||
// INPUT
|
||||
"tree grammar B;\n" +
|
||||
|
@ -32,9 +32,9 @@ public class TestBasicSemanticErrors extends BaseTest {
|
|||
"\n" +
|
||||
"b : ^(. A) ;",
|
||||
// YIELDS
|
||||
"error(79): B.g:10:6: Wildcard invalid as root; wildcard can itself be a tree\n" +
|
||||
"error(80): B.g:1:5: option backtrack=false conflicts with tree grammar filter mode\n" +
|
||||
"error(80): B.g:1:5: option output=template conflicts with tree grammar filter mode"
|
||||
"error(80): B.g:10:6: Wildcard invalid as root; wildcard can itself be a tree\n" +
|
||||
"error(81): B.g:1:5: option backtrack=false conflicts with tree grammar filter mode\n" +
|
||||
"error(81): B.g:1:5: option output=template conflicts with tree grammar filter mode"
|
||||
};
|
||||
|
||||
static String[] U = {
|
||||
|
@ -59,6 +59,8 @@ public class TestBasicSemanticErrors extends BaseTest {
|
|||
"error(21): U.g:7:0: repeated grammar prequel spec (option, token, or import); please merge\n" +
|
||||
"error(49): U.g:2:10: illegal option foo\n" +
|
||||
"error(26): U.g:4:8: token names must start with an uppercase letter: f\n" +
|
||||
"error(25): U.g:4:8: can't assign string value to token name f in non-combined grammar\n" +
|
||||
"error(25): U.g:5:8: can't assign string value to token name S in non-combined grammar\n" +
|
||||
"error(49): U.g:8:10: illegal option x\n" +
|
||||
"error(49): U.g:11:10: illegal option blech\n" +
|
||||
"error(49): U.g:14:16: illegal option ick\n" +
|
||||
|
|
|
@ -49,7 +49,8 @@ public class TestSymbolIssues extends BaseTest {
|
|||
"\n" +
|
||||
"s : FOO ;",
|
||||
// YIELDS
|
||||
"error(34): B.g:9:0: symbol s conflicts with global dynamic scope with same name\n" +
|
||||
"error(25): B.g:2:9: can't assign string value to token name X in non-combined grammar\n" +
|
||||
"error(34): B.g:9:0: symbol s conflicts with global dynamic scope with same name\n" +
|
||||
"error(35): B.g:5:9: label b conflicts with rule with same name\n" +
|
||||
"error(34): B.g:5:4: symbol s conflicts with global dynamic scope with same name\n" +
|
||||
"error(36): B.g:5:15: label X conflicts with token with same name\n" +
|
||||
|
@ -66,12 +67,10 @@ public class TestSymbolIssues extends BaseTest {
|
|||
"b : B ;\n"+
|
||||
"A : 'a';",
|
||||
// YIELDS
|
||||
"error(51): C.g:3:23: reference to rewrite element ID not found to left of ->\n" +
|
||||
"error(51): C.g:3:28: reference to rewrite element r not found to left of ->\n" +
|
||||
"error(51): C.g:3:28: reference to rewrite element r not found to left of ->\n" +
|
||||
"error(51): C.g:3:30: reference to rewrite element foo not found to left of ->\n" +
|
||||
"error(51): C.g:3:49: reference to rewrite element 'eh?' not found to left of ->\n" +
|
||||
"error(51): C.g:4:10: reference to rewrite element x not found to left of ->\n" +
|
||||
"error(51): C.g:4:13: reference to rewrite element A not found to left of ->"
|
||||
"error(51): C.g:4:10: reference to rewrite element x not found to left of ->"
|
||||
};
|
||||
|
||||
static String[] D = {
|
||||
|
|
Loading…
Reference in New Issue