public void VisitExecuteStmt(ExecuteStmt stmt) { // Todo: Maybe allow in top level ifs? if (scopes.Count > 0) { Lox.Error(stmt.Keyword, "Execute only allowed on top-level."); } Resolve(stmt.Value); }
public void VisitExecuteStmt(ExecuteStmt stmt) { var path = Evaluate(stmt.Value); if (!(path is string)) { throw new RuntimeError(stmt.Keyword, "Execute path must be a string."); } Lox.RunFile(path as string); }