WIP: Add enum support
This commit is contained in:
@@ -13,7 +13,8 @@ public class DestroyStatementTest {
|
||||
ParseTree tree = Helper.prepareParser("struct bar { a: int; } function foo(): int { destroy x; return 1; } foo();");
|
||||
var funcs = Helper.getFuncs(tree);
|
||||
var structs = Helper.getStructs(tree);
|
||||
ContextAnalysis ctxAnal = new ContextAnalysis(funcs, structs);
|
||||
var enums = Helper.getEnums(tree);
|
||||
ContextAnalysis ctxAnal = new ContextAnalysis(funcs, structs, enums);
|
||||
|
||||
Exception e = assertThrows(RuntimeException.class, () -> ctxAnal.visit(tree));
|
||||
assertEquals("Error in line 1:45 Variable with name \"x\" not defined.", e.getMessage());
|
||||
|
||||
Reference in New Issue
Block a user