예제 #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");
            }
        }