Mercurial Hosting > luan
diff src/luan/modules/TableLuan.java @ 1333:25746915a241
merge Luan and LuanState
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 12 Feb 2019 22:33:40 -0700 |
parents | f41919741100 |
children | c88b486a9511 |
line wrap: on
line diff
--- a/src/luan/modules/TableLuan.java Tue Feb 12 21:50:26 2019 -0700 +++ b/src/luan/modules/TableLuan.java Tue Feb 12 22:33:40 2019 -0700 @@ -5,7 +5,6 @@ import java.util.ArrayList; import java.util.Arrays; import luan.Luan; -import luan.LuanState; import luan.LuanTable; import luan.LuanFunction; import luan.LuanException; @@ -15,7 +14,7 @@ public final class TableLuan { - public static String concat(LuanState luan,LuanTable list,String sep,Integer i,Integer j) throws LuanException { + public static String concat(Luan luan,LuanTable list,String sep,Integer i,Integer j) throws LuanException { int first = i==null ? 1 : i; int last = j==null ? list.length() : j; StringBuilder buf = new StringBuilder(); @@ -48,7 +47,7 @@ public boolean isLessThan(Object o1,Object o2); } - public static void sort(final LuanState luan,LuanTable list,final LuanFunction comp) throws LuanException { + public static void sort(final Luan luan,LuanTable list,final LuanFunction comp) throws LuanException { if( list.getMetatable() != null ) throw new LuanException("can't sort a table with a metatable"); final LessThan lt; @@ -84,7 +83,7 @@ } } - public static LuanTable pack(LuanState luan,Object... args) throws LuanException { + public static LuanTable pack(Luan luan,Object... args) throws LuanException { LuanTable tbl = new LuanTable(luan,Arrays.asList(args)); tbl.rawPut( "n", args.length ); return tbl; @@ -106,7 +105,7 @@ return list.toArray(); } - public static LuanTable copy(LuanState luan,LuanTable list,Integer from,Integer to) { + public static LuanTable copy(Luan luan,LuanTable list,Integer from,Integer to) { if( from == null ) return new LuanTable(list); if( to == null ) @@ -130,7 +129,7 @@ return tbl.rawSize(); } - public static LuanTable toTable(LuanState luan,Object obj) { + public static LuanTable toTable(Luan luan,Object obj) { return luan.toTable(obj); }