protected override ICode VisitVariableAddress(ExprVariableAddress e) {
     if (e.Type.IsBoolean(true) && !e.Variable.Type.IsBoolean()) {
         var ctx = e.Ctx;
         return new ExprJsExplicit(ctx, "!!expr", ctx.Boolean, e.Variable.Named("expr")); // HACK
     }
     return base.VisitVariableAddress(e);
 }
Exemplo n.º 2
0
 protected override ICode VisitVariableAddress(ExprVariableAddress e) {
     //this.code.AppendFormat("@[local:{0}]", e.Index);
     this.code.AppendFormat("@(<{0}>", e.Type);
     this.Visit(e.Variable);
     this.code.Append(")");
     return e;
 }
Exemplo n.º 3
0
 protected override ICode VisitVariableAddress(ExprVariableAddress e) {
     this.Visit(e.Variable);
     return e;
     //throw new InvalidOperationException("Should never get here");
 }
Exemplo n.º 4
0
 private Stmt LdLoca(int idx) {
     var type = this.localTypes[idx];
     var var = this.locals[idx];
     var expr = new ExprVariableAddress(this.ctx, var, type);
     this.stack.Push(expr);
     return null;
 }