Examples of LuaValue


Examples of org.luaj.vm2.LuaValue

    t.u.s.aux = this.exp2RK(k);
    t.k = LexState.VINDEXED;
  }

  boolean constfolding(int op, expdesc e1, expdesc e2) {
    LuaValue v1, v2, r;
    if (!e1.isnumeral() || !e2.isnumeral())
      return false;
    v1 = e1.u.nval();
    v2 = e2.u.nval();
    switch (op) {
    case OP_ADD:
      r = v1.add(v2);
      break;
    case OP_SUB:
      r = v1.sub(v2);
      break;
    case OP_MUL:
      r = v1.mul(v2);
      break;
    case OP_DIV:
      r = v1.div(v2);
      break;
    case OP_MOD:
      r = v1.mod(v2);
      break;
    case OP_POW:
      r = v1.pow(v2);
      break;
    case OP_UNM:
      r = v1.neg();
      break;
    case OP_LEN:
      // r = v1.len();
      // break;
      return false; /* no constant folding for 'len' */
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.