Package org.luaj.vm2

Examples of org.luaj.vm2.Varargs.arg()


      //"print(bigNumB:toString())\n" +
      //"print(bigNumC:toString())\n" +
      "return bigNumA:toString(), bigNumB:toString(), bigNumC:toString()";
    Varargs chunk = _G.get("loadstring").call(LuaValue.valueOf(script));
    if ( ! chunk.arg1().toboolean() )
      fail( chunk.arg(2).toString() );
    Varargs results = chunk.arg1().invoke();
    int nresults = results.narg();
    String sa = results.tojstring(1);
    String sb = results.tojstring(2);
    String sc = results.tojstring(3);
View Full Code Here


      "local b = a:set(a:get"+typename+"())\n" +
      "local c = a:setr(a:get"+typename+"())\n" +
      "return b,c";
    Varargs chunk = _G.get("loadstring").call(LuaValue.valueOf(script));
    if ( ! chunk.arg1().toboolean() )
      fail( chunk.arg(2).toString() );
    Varargs results = chunk.arg1().invoke();
    int nresults = results.narg();
    assertEquals( 2, nresults );
    LuaValue b = results.arg(1);
    LuaValue c = results.arg(2);
View Full Code Here

    if ( ! chunk.arg1().toboolean() )
      fail( chunk.arg(2).toString() );
    Varargs results = chunk.arg1().invoke();
    int nresults = results.narg();
    assertEquals( 2, nresults );
    LuaValue b = results.arg(1);
    LuaValue c = results.arg(2);
    String sb = b.tojstring();
    String sc = c.tojstring();
    assertEquals( "set("+typename+") "+value, sb );
    assertEquals( "setr("+typename+") "+value, sc );
View Full Code Here

      fail( chunk.arg(2).toString() );
    Varargs results = chunk.arg1().invoke();
    int nresults = results.narg();
    assertEquals( 2, nresults );
    LuaValue b = results.arg(1);
    LuaValue c = results.arg(2);
    String sb = b.tojstring();
    String sc = c.tojstring();
    assertEquals( "set("+typename+") "+value, sb );
    assertEquals( "setr("+typename+") "+value, sc );
  }
View Full Code Here

        return v.arg1();
     
      // report error
      if ( sb == null )
        sb = new StringBuffer();
      sb.append( "\n\t'"+filename+"': "+v.arg(2) );
    }
    return valueOf(sb.toString());
  }
 
  LuaValue loader_Java( Varargs args ) {
View Full Code Here

        final LuaThread t = (LuaThread) env;
        final Varargs result = t.resume( args );
        if ( result.arg1().toboolean() ) {
          return result.subargs(2);
        } else {
          error( result.arg(2).tojstring() );
        }
      }
      default:
        return NONE;
    }
View Full Code Here

           Varargs n = table.next(k);
          
           if ((k = n.arg1()).isnil())
             break;

           LuaValue v = n.arg(2);
           list.append(v);
         }
      }       
      return LuaValue.varargsOf(new LuaValue[] {list});
    }
View Full Code Here

           Varargs n = table.next(k);
          
           if ((k = n.arg1()).isnil())
             break;

           LuaValue v = n.arg(2);
           map.put(k, v);
         }
      }       
      return LuaValue.varargsOf(new LuaValue[] {map});
    }
View Full Code Here

      LuaTable lpTable = new LPLuaTable((CCCommandWrapper)object);
      LuaValue k = LuaValue.NIL;
      while(true) {
        Varargs n = table.next(k);
        if((k = n.arg1()).isnil()) break;
        LuaValue v = n.arg(2);
        lpTable.set(k, v);
      }
      ((CCCommandWrapper)object).table = lpTable;
      return lpTable;
    }
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.