示例#1
0
        public void Parsed(RuntimeState state)
        {
            statement.Run(state);

            if (state.Returning != null)
            {
                throw new Exception("Top level statement returned");
            }
        }
示例#2
0
        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");
            }
        }