Jelajahi Sumber

[lua] move Rex flag initialization into static var declaration

Justin Donaldson 9 tahun lalu
induk
melakukan
98291bf2f6
1 mengubah file dengan 1 tambahan dan 3 penghapusan
  1. 1 3
      std/lua/_std/EReg.hx

+ 1 - 3
std/lua/_std/EReg.hx

@@ -32,7 +32,7 @@ class EReg {
 	var s : String; // the last matched string
 	var m : Table<Int,Int>; // the [start:Int, end:Int, and submatches:String (matched groups)] as a single table.
 
-	static var FLAGS: Table<String, Int>; // Available PCRE flags
+	static var FLAGS = Rex.flags();
 
 	public function new( r : String, opt : String ) : Void {
 		var ropt = 0;
@@ -157,8 +157,6 @@ class EReg {
 		if (Rex == null){
 			throw "Rex is missing.  Please install lrexlib-pcre.";
 		}
-		FLAGS = Rex.flags();
 	}
-
 }