Esempio n. 1
0
 internal override MSA.Expression/*!*/ TransformWriteVariable(AstGenerator/*!*/ gen, MSA.Expression/*!*/ rightValue) {
     if (gen.CompilerOptions.IsEval || gen.GetCurrentNonSingletonModule() != null) {
         return Methods.SetClassVariable.OpCall(AstFactory.Box(rightValue), gen.CurrentScopeVariable, AstUtils.Constant(Name));
     } else {
         return Methods.SetObjectClassVariable.OpCall(AstFactory.Box(rightValue), gen.CurrentScopeVariable, AstUtils.Constant(Name));
     }
 }
Esempio n. 2
0
        private static MethodInfo/*!*/ GetOp(AstGenerator/*!*/ gen, int/*!*/ opKind) {
            bool unknownOwner = gen.CompilerOptions.IsEval || gen.GetCurrentNonSingletonModule() != null;

            switch (opKind) {
                case OpTryGet: return unknownOwner ? Methods.TryGetClassVariable : Methods.TryGetObjectClassVariable;
                case OpGet: return unknownOwner ? Methods.GetClassVariable : Methods.GetObjectClassVariable;
                case OpIsDefined: return unknownOwner ? Methods.IsDefinedClassVariable : Methods.IsDefinedObjectClassVariable;
                default: throw Assert.Unreachable;
            }
        }
Esempio n. 3
0
 internal override MSA.Expression /*!*/ TransformWriteVariable(AstGenerator /*!*/ gen, MSA.Expression /*!*/ rightValue)
 {
     if (gen.CompilerOptions.IsEval || gen.GetCurrentNonSingletonModule() != null)
     {
         return(Methods.SetClassVariable.OpCall(AstFactory.Box(rightValue), gen.CurrentScopeVariable, AstUtils.Constant(Name)));
     }
     else
     {
         return(Methods.SetObjectClassVariable.OpCall(AstFactory.Box(rightValue), gen.CurrentScopeVariable, AstUtils.Constant(Name)));
     }
 }
Esempio n. 4
0
        private static MethodInfo /*!*/ GetOp(AstGenerator /*!*/ gen, int /*!*/ opKind)
        {
            bool unknownOwner = gen.CompilerOptions.IsEval || gen.GetCurrentNonSingletonModule() != null;

            switch (opKind)
            {
            case OpTryGet: return(unknownOwner ? Methods.TryGetClassVariable : Methods.TryGetObjectClassVariable);

            case OpGet: return(unknownOwner ? Methods.GetClassVariable : Methods.GetObjectClassVariable);

            case OpIsDefined: return(unknownOwner ? Methods.IsDefinedClassVariable : Methods.IsDefinedObjectClassVariable);

            default: throw Assert.Unreachable;
            }
        }