Ejemplo n.º 1
0
        public override void Emit(ILGeneratorContext context)
        {
            var localType = context.Context.GetType(Type, context.Page);
            int localId   = context.Function.EmitLocal(Identifier.Source.Value.ToString(), localType);

            if (Assignment != null)
            {
                var storeType = Assignment.EmitLoad(context);
                TypeUtility.ImplicitCast(context, storeType, localType, Assignment.Source);
                context.Function.Current.EmitStLoc(localId);
            }
        }
Ejemplo n.º 2
0
 public override void Emit(ILGeneratorContext context)
 {
     if (ReturnExpression == null)
     {
         if (context.Function.ReturnType != null)
         {
             context.Errors.Add(new CompileError(Source, "Function must return a value"));
         }
         else
         {
             context.Function.Current.EmitRet();
         }
     }
     else
     {
         var retType = ReturnExpression.EmitLoad(context);
         TypeUtility.ImplicitCast(context, retType, context.Function.ReturnType, ReturnExpression.Source);
         context.Function.Current.EmitRet();
     }
 }
Ejemplo n.º 3
0
        public override void Emit(ILGeneratorContext context)
        {
            var exprType = RHS.EmitLoad(context);

            LHS.EmitStore(context, exprType);
        }