visitAST method
The starting point of all lua programs. This will visit every node in the tree. The default result will be a program which ran to completion.
It can be changed to suit other needs.
Implementation
@override
Object? visitAST(AST ast) {
Object? ret;
for (final e in ast.stmts) {
try {
ret = e.accept(this);
} catch (e) {
if (e is LuaReturnValueException) {
ret = e.value;
break;
} else {
addError(e.toString());
}
}
}
return ret;
}