Handle degenerate matches better.
authorRaja R Harinath <harinath@hurrynot.org>
Wed, 21 Sep 2005 12:42:48 +0000 (12:42 -0000)
committerRaja R Harinath <harinath@hurrynot.org>
Wed, 21 Sep 2005 12:42:48 +0000 (12:42 -0000)
svn path=/trunk/mcs/; revision=50370

mcs/class/System/System.Text.RegularExpressions/interpreter.cs

index 6dd8f88b27e6bc3259d88b7c284c2c20abbabab2..20156668b89fec92b248d560f69db5324c454374 100644 (file)
@@ -470,6 +470,7 @@ namespace System.Text.RegularExpressions {
                                                goto Fail;
                                        }
 
+                                       Recurse:
                                        if (ptr == current.Start) {
                                                // degenerate match ... match tail or fail
 
@@ -483,7 +484,6 @@ namespace System.Text.RegularExpressions {
 
                                        if (current.IsLazy) {
                                                // match tail first ...
-                                       RecurseLazy:
                                                this.repeat = current.Previous;
                                                int cp = Checkpoint ();
                                                if (Eval (Mode.Match, ref ptr, pc + 1))
@@ -500,7 +500,7 @@ namespace System.Text.RegularExpressions {
                                                        deep = current;
                                                        if (Eval (Mode.Match, ref ptr, current.Expression)) {
                                                                if (deep == current)
-                                                                       goto RecurseLazy;
+                                                                       goto Recurse;
                                                                else
                                                                        goto Pass;
                                                        }