Examples of arg1()


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

                // Traverse the directions table.
                LuaValue key = LuaValue.NIL;
                while (true) {

                    Varargs keyValue = directionsTable.next(key);
                    key = keyValue.arg1();
                    if (key.isnil()) {
                        break;
                    }
                    LuaValue directionTable = keyValue.arg(2);
View Full Code Here

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

        LuaValue k = LuaValue.NIL;
       
        while (true) {
           Varargs n = table.next(k);
          
           if ((k = n.arg1()).isnil())
             break;

           LuaValue v = n.arg(2);
           list.append(v);
         }
View Full Code Here

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

        LuaValue k = LuaValue.NIL;
       
        while (true) {
           Varargs n = table.next(k);
          
           if ((k = n.arg1()).isnil())
             break;

           LuaValue v = n.arg(2);
           map.put(k, v);
         }
View Full Code Here

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

        LuaValue k = LuaValue.NIL;
       
        while (true) {
           Varargs n = table.next(k);
          
           if ((k = n.arg1()).isnil())
             break;

           LuaValue v = n.arg(2);
           list.append(v);
         }
View Full Code Here

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

        LuaValue k = LuaValue.NIL;
       
        while (true) {
           Varargs n = table.next(k);
          
           if ((k = n.arg1()).isnil())
             break;

           LuaValue v = n.arg(2);
           map.put(k, v);
         }
View Full Code Here

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

 
  public void testExceptionMessage() {
    String script = "local c = luajava.bindClass( \""+SomeClass.class.getName()+"\" )\n" +
        "return pcall( c.someMethod, c )";
    Varargs vresult = _G.get("loadstring").call(LuaValue.valueOf(script)).invoke(LuaValue.NONE);
    LuaValue status = vresult.arg1();
    LuaValue message = vresult.arg(2);
    assertEquals( LuaValue.FALSE, status );   
    int index = message.toString().indexOf( "this is some message" );
    assertTrue( "bad message: "+message, index>=0 );   
  }
View Full Code Here

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

      "      ..'-'..tostring(array[2])\n" +
      "      ) or '-nil')\n" +
      "  end,\n" +
      "} )\n";
    Varargs chunk = _G.get("loadstring").call(LuaValue.valueOf(script));
    if ( ! chunk.arg1().toboolean() )
      fail( chunk.arg(2).toString() );
    LuaValue result = chunk.arg1().call();
    Object u = result.touserdata();
    VarArgsInterface v = (VarArgsInterface) u;
    assertEquals( "foo", v.varargsMethod("foo") );
View Full Code Here

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

      "  end,\n" +
      "} )\n";
    Varargs chunk = _G.get("loadstring").call(LuaValue.valueOf(script));
    if ( ! chunk.arg1().toboolean() )
      fail( chunk.arg(2).toString() );
    LuaValue result = chunk.arg1().call();
    Object u = result.touserdata();
    VarArgsInterface v = (VarArgsInterface) u;
    assertEquals( "foo", v.varargsMethod("foo") );
    assertEquals( "foo-bar", v.varargsMethod("foo", "bar") );
    assertEquals( "foo-bar-etc", v.varargsMethod("foo", "bar", "etc") );
View Full Code Here

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

      //"print(bigNumA:toString())\n" +
      //"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);
View Full Code Here

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

      "local a = luajava.newInstance('"+B.class.getName()+"');\n" +
      "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);
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.