소스 검색

* parser.cs: Allow creating a regular expression using {,n} as the
specified. The min bounds is set to -1, I am not completely sure
if that is what it is supposed to be but MS does not set it to 0
based on testing. Patch by [email protected]. Fixes bug
#56761.

svn path=/trunk/mcs/; revision=28061

Jackson Harper 21 년 전
부모
커밋
000a582758
2개의 변경된 파일15개의 추가작업 그리고 5개의 파일을 삭제
  1. 7 0
      mcs/class/System/System.Text.RegularExpressions/ChangeLog
  2. 8 5
      mcs/class/System/System.Text.RegularExpressions/parser.cs

+ 7 - 0
mcs/class/System/System.Text.RegularExpressions/ChangeLog

@@ -1,3 +1,10 @@
+2004-05-25  Jackson Harper  <[email protected]>
+
+	* parser.cs: Allow creating a regular expression using {,n} as the
+	specified. The min bounds is set to -1, I am not completely sure
+	if that is what it is supposed to be but MS does not set it to 0
+	based on testing. Patch by [email protected]. Fixes bug #56761.
+
 2004-05-12  Dick Porter  <[email protected]>
 
 	* regex.cs: 

+ 8 - 5
mcs/class/System/System.Text.RegularExpressions/parser.cs

@@ -723,11 +723,14 @@ namespace System.Text.RegularExpressions.Syntax {
 			/* check syntax */
 
 			ConsumeWhitespace (IsIgnorePatternWhitespace (options));
-			n = ParseNumber (10, 1, 0);
-			if (n < 0)
-				throw NewParseException ("Illegal {x,y} - bad value of x.");
-
-			ConsumeWhitespace (IsIgnorePatternWhitespace (options));
+		    
+			if (pattern[ptr] == ',') {
+                                n = -1;
+			} else {
+                                n = ParseNumber (10, 1, 0);
+                                ConsumeWhitespace (IsIgnorePatternWhitespace (options));
+			}
+			
 			switch (pattern[ptr ++]) {
 			case '}':
 				m = n;