SetAsCurrentScope() публичный статический Метод

public static SetAsCurrentScope ( Scope Scope ) : void
Scope Scope
Результат void
Пример #1
0
 public override Value Run()
 {
     Compiler.SetAsCurrentScope(Identifiers);
     base.Run();
     Compiler.ExitScope(true);
     return(this);
 }
Пример #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");
        }
Пример #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);
        }