SetAsCurrentScope() public static method

public static SetAsCurrentScope ( Scope Scope ) : void
Scope Scope
return void
Esempio n. 1
0
 public override Value Run()
 {
     Compiler.SetAsCurrentScope(Identifiers);
     base.Run();
     Compiler.ExitScope(true);
     return(this);
 }
Esempio n. 2
0
        public override Value Operate(Value First, Value Second)
        {
            if (First is Reference)
            {
                First = (First as Reference).ReferencingValue;
            }

            if (First is IHasMembers)
            {
                var inst = First as IHasMembers;
                Compiler.SetAsCurrentScope(inst.Identifiers);
                Compiler.PendingDot         = true;
                Compiler.PendingDotIsStatic = First is IClass;
                return(Nothing.Value);
            }
            throw new Exception("Operand must have members");
        }
Esempio n. 3
0
        public virtual Value Invoke(List Args)
        {
            Compiler.SetAsCurrentScope(Scope);
            Compiler.EnterScope();
            for (int i = 0; i < Math.Min(Args.Arr.Count, args.Count); ++i)
            {
                if (Args.Arr[i] is Reference)
                {
                    ((Reference) new Identifier(args[i].Val).Evaluate()).ChangeReference(Args.Arr[i] as Reference);
                }
                else
                {
                    ((Reference) new Identifier(args[i].Val).Evaluate()).ChangeReference(Args.Arr[i]);
                }
            }
            Value result = Run();

            Compiler.ExitScope(true);
            return(result);
        }