|
@@ -26,23 +26,26 @@ class Lib {
|
|
|
public static inline function println( v : Dynamic ) : Void {
|
|
|
lua.Lua.print(Std.string(v));
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public static inline function print(v:Dynamic) : Void {
|
|
|
lua.Io.write(Std.string(v));
|
|
|
lua.Io.flush();
|
|
|
}
|
|
|
|
|
|
public inline static function tableToArray<T>(t:Table<Int,T>, ?length:Int) : Array<T> {
|
|
|
- if (length == null) length = Table.maxn(t);
|
|
|
- return cast Lib.defArray(t,length);
|
|
|
+ return lua.Boot.tableToArray(t, length);
|
|
|
+ }
|
|
|
+
|
|
|
+ public inline static function tableToObject<T>(t:Table<String,T>) : Dynamic<T> {
|
|
|
+ return lua.Boot.tableToObject(t);
|
|
|
}
|
|
|
|
|
|
- public static function patternQuote(str:String) : String {
|
|
|
+ public inline static function patternQuote(str:String) : String {
|
|
|
return lua.StringTools.gsub(str, "[%(%)%.%%%+%-%*%?%[%]%^%$]", function(c:String){ return "%" + c; });
|
|
|
}
|
|
|
|
|
|
- public static function defArray<T>(tab: Table<Int,T>, length : Int) : Array<T> {
|
|
|
- return untyped _hx_tabArray(tab, length);
|
|
|
+ public inline static function defArray<T>(tab: Table<Int,T>, length : Int) : Array<T> {
|
|
|
+ return lua.Boot.defArray(tab, length);
|
|
|
}
|
|
|
|
|
|
public static function fillArray<T>(itr:Void->T) : Array<T> {
|