Example #1
0
 protected virtual void EmitSetCode(CompilerTarget target, StackSemantics stackSemantics)
 {
     var constType = TypeExpr as AstConstantTypeExpression;
     var justEffect = stackSemantics == StackSemantics.Effect;
     if (constType != null)
     {
         EmitArguments(target, !justEffect, 0);
         target.EmitStaticSetCall(Position, Arguments.Count, constType.TypeExpression + "::" + _memberId);
     }
     else
     {
         TypeExpr.EmitValueCode(target);
         target.EmitConstant(Position, _memberId);
         EmitArguments(target, !justEffect, 2);
         //type.StaticCall\FromStack(memberId, args...)
         target.EmitSetCall(Position, Arguments.Count + 1, PType.StaticCallFromStackId);
     }
 }