From: Gonzalo Paniagua Javier Date: Fri, 25 Oct 2002 15:09:02 +0000 (-0000) Subject: 2002-10-25 Gonzalo Paniagua Javier X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=7bc8829800a56b356ecae1960d2991e41018ba70;p=mono.git 2002-10-25 Gonzalo Paniagua Javier * parser.cs: applied fix from Tim Haynes (thaynes@openlinksw.com) to solve bug #32807. Also modified GetMapping to return the same as MS. svn path=/trunk/mcs/; revision=8549 --- diff --git a/mcs/class/System/System.Text.RegularExpressions/ChangeLog b/mcs/class/System/System.Text.RegularExpressions/ChangeLog index 415124ba16e..f947fca6500 100644 --- a/mcs/class/System/System.Text.RegularExpressions/ChangeLog +++ b/mcs/class/System/System.Text.RegularExpressions/ChangeLog @@ -1,3 +1,8 @@ +2002-10-25 Gonzalo Paniagua Javier + + * parser.cs: applied fix from Tim Haynes (thaynes@openlinksw.com) to + solve bug #32807. Also modified GetMapping to return the same as MS. + 2002-08-28 Juli Mallett * arch.cs, compiler.cs: Give the interpreter machine a property diff --git a/mcs/class/System/System.Text.RegularExpressions/parser.cs b/mcs/class/System/System.Text.RegularExpressions/parser.cs index 3327cf3024a..67f81f243d3 100644 --- a/mcs/class/System/System.Text.RegularExpressions/parser.cs +++ b/mcs/class/System/System.Text.RegularExpressions/parser.cs @@ -128,9 +128,15 @@ namespace System.Text.RegularExpressions.Syntax { public IDictionary GetMapping () { Hashtable mapping = new Hashtable (); - foreach (CapturingGroup group in caps) { - if (group.Name != null) + int end = caps.Count; + mapping.Add ("0", 0); + for (int i = 0; i < end;) { + CapturingGroup group = (CapturingGroup) caps [i]; + i++; + if (group.Name != null && !mapping.Contains (group.Name)) mapping.Add (group.Name, group.Number); + else + mapping.Add (i.ToString (), i); } return mapping;