فهرست منبع

[python] fix EReg.matchSub (closes #3458)

Simon Krajewski 11 سال پیش
والد
کامیت
0c7b995298
2فایلهای تغییر یافته به همراه4 افزوده شده و 4 حذف شده
  1. 1 1
      std/EReg.hx
  2. 3 3
      std/python/_std/EReg.hx

+ 1 - 1
std/EReg.hx

@@ -131,7 +131,7 @@ class EReg {
 
 		If `s` is null, the result is unspecified.
 	**/
-	public function matchSub( s : String, pos : Int, len : Int = 0):Bool {
+	public function matchSub( s : String, pos : Int, len : Int = -1):Bool {
 		return false;
 	}
 

+ 3 - 3
std/python/_std/EReg.hx

@@ -3,7 +3,7 @@ import python.lib.Re;
 import python.lib.Re.MatchObject;
 import python.lib.Re.Pattern;
 
-//@:coreApi
+@:coreApi
 class EReg {
 
 	/**
@@ -115,8 +115,8 @@ class EReg {
 
 		If `s` is null, the result is unspecified.
 	**/
-	public function matchSub( s : String, pos : Int, ?len : Int):Bool {
-		if (len != null) {
+	public function matchSub( s : String, pos : Int, len : Int = -1):Bool {
+		if (len != -1) {
 			matchObj = pattern.search(s, pos, pos+len);
 		} else {
 			matchObj = pattern.search(s, pos);