Ejemplo n.º 1
0
 private static void EmitBody(MethodBuilder mb, Body body)
 {
     foreach (var st in body.Statements)
     {
         EmitStatement(mb, st);
     }
 }
Ejemplo n.º 2
0
 private static void EmitBody(Body body, Function func = null)
 {
     if (func == null)
         foreach (var st in body.Statements)
         {
             Emit(st);
         }
     else
         foreach (var st in body.Statements)
         {
             if (st is Assignment)
             {
                 var s = st as Assignment;
                 if (string.Join(".", s.Variable.Select(x => x.Text)) == func.Name.Text)
                 {
                     Source += "return ";
                     if (s.Invoke == null)
                         Source += MakeString(s.Expr) + ";\n";
                     else
                         EmitInvoke(s.Invoke);
                     break;
                 }
             }
             Emit(st);
         }
 }