public void Parsed(RuntimeState state) { statement.Run(state); if (state.Returning != null) { throw new Exception("Top level statement returned"); } }
public void Define(RuntimeState state) { Module parent = (Module)state.Scope; Module module = new Module(parent, name.name); state.Scope.SetName(name.name, module); state.Scope = module; body.Run(state); state.Scope = parent; if (state.Returning != null) { throw new Exception("Statement within a module block returned"); } }