Esempio n. 1
0
        public void ReadInput(Pointer pointer)
        {
            object o = inputReader();

            if (o != null)
            {
                pointer.Push(o);
            }
        }
Esempio n. 2
0
        public Func <bool> Eval(Pointer pointer, string code, out int size)
        {
            RunicEnvironment context;
            ParseError       err = Parser.Parse(code, "", out context);

            if (modifiers[pointer.position.x, pointer.position.y] == '͍')
            {
                context.SetReader(() =>
                {
                    if (pointer.GetStackSize() > 0)
                    {
                        return(pointer.Pop());
                    }
                    return(null);
                });
                context.SetWriter((o) =>
                {
                    pointer.Push(o);
                });
            }
            else
            {
                context.SetWriter((o) =>
                {
                    outputWriter(o);
                });
            }
            if (err.type != ParseErrorType.NONE || context == null)
            {
                size = 0;
                return(() => true);
            }
            context.Initialize();
            size = context.runes.GetLength(0) + context.runes.GetLength(1);
            return(() =>
            {
                bool continueExecuting = false;
                continueExecuting = context.Tick();
                return !continueExecuting;
            });
        }