Example #1
0
        public DObject ExecuteFunction(InterpreterLocation functionLocation)
        {
            int originalDepth = depth;

            Eat("l curly");

            returnValue = null;

            while (depth != originalDepth)
            {
                if (returnValue != null || shouldBreak)
                {
                    while (depth > originalDepth + 1)
                    {
                        Eat();
                    }

                    break;
                }

                evaluator.Evaluate();
            }

            var v = returnValue == null ? DVoid.instance : returnValue;

            returnValue = null;

            return(v);
        }
Example #2
0
 public void BeginLoop(InterpreterLocation beginning)
 {
     loopLocations.Push(beginning);
 }
Example #3
0
 /// <summary>
 /// Goes to a location in code, changing scope and deleting unscoped variables
 /// </summary>
 /// <param name="location"></param>
 public void Goto(InterpreterLocation location)
 {
     pointer = location.pointer;
     depth   = location.depth;
     heap.DeleteUnscopedVariables();
 }