public Completion Evaluate(Interpreter interpreter) { if (statementList == null) { return(Completion.NormalCompletion()); } return(statementList.Evaluate(interpreter)); }
public override Completion Evaluate(Interpreter interpreter) { if (!statementList.Any()) { return(Completion.NormalCompletion()); } var oldEnv = interpreter.RunningExecutionContext().LexicalEnvironment; var blockEnv = oldEnv.NewDeclarativeEnvironment(); BlockDeclarationInstantiation(statementList, blockEnv); interpreter.RunningExecutionContext().LexicalEnvironment = blockEnv; Completion blockValue = statementList.Evaluate(interpreter); interpreter.RunningExecutionContext().LexicalEnvironment = oldEnv; return(blockValue); }