Selaa lähdekoodia

[lua] clean up some easy TODOS

Justin Donaldson 8 vuotta sitten
vanhempi
commit
cbf3404818
4 muutettua tiedostoa jossa 10 lisäystä ja 21 poistoa
  1. 0 10
      std/lua/Boot.hx
  2. 0 1
      std/lua/_std/Reflect.hx
  3. 1 1
      std/lua/_std/sys/io/Process.hx
  4. 9 9
      std/lua/lib/lrexlib/Rex.hx

+ 0 - 10
std/lua/Boot.hx

@@ -306,16 +306,6 @@ class Boot {
 	}
 
 
-	/*
-	   Create an empty table for vectors
-	*/
-	// TODO: provide a simpler anonymous table generator syntax in genlua
-	public static function createVectorTable<K,V>(length:Int) : Table<K,V> {
-		var table : Table<K,V> = untyped __lua__("{}");
-		untyped table.length = length;
-		return table;
-	}
-
 	/*
 		Returns a shell escaped version of "cmd" along with any args
 	*/

+ 0 - 1
std/lua/_std/Reflect.hx

@@ -25,7 +25,6 @@ import lua.Boot;
 @:coreApi class Reflect {
 
 	public inline static function hasField( o : Dynamic, field : String ) : Bool {
-		// TODO: Lua can't detect fields that are set to null, figure out a workaround.
 		return untyped o.__fields__ != null ? o.__fields__[field] != null :  o[field] != null;
 	}
 

+ 1 - 1
std/lua/_std/sys/io/Process.hx

@@ -51,7 +51,7 @@ class Process {
 	  by the shell.
 	**/
 	static function setArgs(cmd : String, ?args : Array<String>) : Table<Int,String>{
-		var pargs = lua.Boot.createVectorTable(0);
+		var pargs = lua.Table.create();
 		var idx = 1;
 		if (sys.FileSystem.exists(cmd)) cmd = '"$cmd"'; // escape simple paths
 		var all = [cmd];

+ 9 - 9
std/lua/lib/lrexlib/Rex.hx

@@ -10,14 +10,14 @@ extern class Rex {
 	/**
 	  The function searches for the first match of the regexp `patt` in the
 	  string `subj`, starting from offset `init`, subject to flags `cf` and `ef`.
-    
+
 	  @return matched string, or array of strings.
 	 **/
 	public static function match(patt : String, ?init : Int, ?ef : Int) : Dynamic;
 
 	/**
 	 The function searches for the first match of the regexp patt in the string
-	 `subj`, starting from offset `init`, subject to flags `cf` and `ef`. 
+	 `subj`, starting from offset `init`, subject to flags `cf` and `ef`.
 	 **/
 	public static function find(subj : String, ?init : Int, ?ef : Int) : Dynamic;
 
@@ -26,7 +26,7 @@ extern class Rex {
 	 The function is intended for use in the generic for Lua construct. It is
 	 used for splitting a subject string `subj` into parts (sections). The `sep`
 	 parameter is a regular expression pattern representing separators between
-	 the sections. 
+	 the sections.
 	 **/
 	@:overload(   function      (subj : String, sep : Rex,    ?cf : Int, ?ef : Int) : Void->String{})
 	public static function split(subj : String, sep : String, ?cf : Int, ?ef : Int) : Void->String;
@@ -34,18 +34,18 @@ extern class Rex {
 
 	/**
 	  This function counts matches of the pattern `patt` in the string `subj`.
-	**/	
+	**/
 	public static function count(subj : String, patt : String, cf : Int, ef : Int) : Dynamic;
 	public static function flags(?tb:Dynamic) : Dynamic;
 
   /**
-    The function searches for the first match of the regexp in the string 
+    The function searches for the first match of the regexp in the string
     `subj`, starting from offset `init`, subject to execution flags `ef`.
   **/
 	public function tfind(subj : String, ?init : Int, ?ef : Int) : Dynamic;
-	
+
 	/**
-	  This function searches for the first match of the regexp in the string 
+	  This function searches for the first match of the regexp in the string
 	  `subj`, starting from offset `init`, subject to execution flags `ef`.
 	**/
 	public function exec(subj : String, ?init : Int, ?ef : Int) : Dynamic;
@@ -55,10 +55,10 @@ extern class Rex {
 	 returns an iterator for repeated matching of the pattern patt in the
 	 string `subj`, subject to flags `cf` and `ef`.
 	 **/
-	public static function gmatch(subj : String, ?cf : Int, ?ef : Int) : Dynamic; // TODO: Extern a lua iterator
+	public static function gmatch(subj : String, patt : String, ?cf : Int, ?ef : Int) : Void->String;
 
 	/**
-	  This function searches for all matches of the pattern `patt` in the string 
+	  This function searches for all matches of the pattern `patt` in the string
     `subj` and replaces them according to the parameters `repl` and `n`.
 	 **/
 	@:overload(	  function     (subj : String, patt : Rex,    repl: Dynamic, ?n: Int, ?cf : Int, ?ef : Int) : String {})