public object Visit(Stmt.Return _return) { object value = null; if (_return.value != null) { value = Evaluate(_return.value); } throw new Return(value); }
public object Visit(Stmt.Return _return) { if (m_CurrentFunction == FunctionType.None) { m_ErrorHandler.Error(_return.keyword, "Cannot return from top-level code."); } if (_return.value != null) { Resolve(_return.value); } return(null); }