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)); } }
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; } }
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))); } }
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; } }