2009-04-23 Sebastien Pouliot <sebastien@ximian.com>
authorSebastien Pouliot <sebastien@ximian.com>
Thu, 23 Apr 2009 17:34:25 +0000 (17:34 -0000)
committerSebastien Pouliot <sebastien@ximian.com>
Thu, 23 Apr 2009 17:34:25 +0000 (17:34 -0000)
* Regex.cs: Remove Compiler-related support for NET_2_1
* RegexOptions.cs: Remove Compile from values available on NET_2_1

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

mcs/class/System/System.Text.RegularExpressions/ChangeLog
mcs/class/System/System.Text.RegularExpressions/Regex.cs
mcs/class/System/System.Text.RegularExpressions/RegexOptions.cs

index 148899679c0a100334558f8e771749fe8fb7207a..aea82d787f5b888c50a5d3451dad8716a5ee7d84 100644 (file)
@@ -1,3 +1,8 @@
+2009-04-23  Sebastien Pouliot  <sebastien@ximian.com>
+
+       * Regex.cs: Remove Compiler-related support for NET_2_1
+       * RegexOptions.cs: Remove Compile from values available on NET_2_1
+
 2009-03-04  Zoltan Varga  <vargaz@gmail.com>
 
        * RxInterpreter.cs (ResetGroups): Avoid allocating larger than needed
index df5e086ac3b0186eeb8d948e851eb782c3d0c7ee..d34fb777862473f592b1fe4d08882b075609cadf 100644 (file)
@@ -233,13 +233,11 @@ namespace System.Text.RegularExpressions {
                        this._groupNumberToNameMap = this.machineFactory.NamesMapping;
                }
 
+#if !NET_2_1
                // The new rx engine has blocking bugs like
                // https://bugzilla.novell.com/show_bug.cgi?id=470827
                static readonly bool old_rx =
-#if !NET_2_1
                        Environment.GetEnvironmentVariable ("MONO_NEW_RX") == null;
-#else
-                       true;
 #endif
 
                private static IMachineFactory CreateMachineFactory (string pattern, RegexOptions options) 
@@ -247,6 +245,9 @@ namespace System.Text.RegularExpressions {
                        Parser psr = new Parser ();
                        RegularExpression re = psr.ParseRegularExpression (pattern, options);
 
+#if NET_2_1
+                       ICompiler cmp = new PatternCompiler ();
+#else
                        ICompiler cmp;
                        if (!old_rx) {
                                if ((options & RegexOptions.Compiled) != 0)
@@ -256,6 +257,7 @@ namespace System.Text.RegularExpressions {
                        } else {
                                cmp = new PatternCompiler ();
                        }
+#endif
 
                        re.Compile (cmp, (options & RegexOptions.RightToLeft) != 0);
 
@@ -449,12 +451,12 @@ namespace System.Text.RegularExpressions {
                        // expressions compiled to assemblies.
                        Init ();
                }
-
+#if !NET_2_1
                protected bool UseOptionC ()
                {
                        return ((roptions & RegexOptions.Compiled) != 0);
                }
-
+#endif
                protected bool UseOptionR ()
                {
                        return ((roptions & RegexOptions.RightToLeft) != 0);
@@ -511,20 +513,21 @@ namespace System.Text.RegularExpressions {
                // MS undocumented members
 #if NET_2_1
                [MonoTODO]
-               protected internal System.Collections.Generic.Dictionary<string, int> capnames;
+               internal System.Collections.Generic.Dictionary<string, int> capnames;
                [MonoTODO]
-               protected internal System.Collections.Generic.Dictionary<int, int> caps;
+               internal System.Collections.Generic.Dictionary<int, int> caps;
 #else
                [MonoTODO]
                protected internal System.Collections.Hashtable capnames;
                [MonoTODO]
                protected internal System.Collections.Hashtable caps;
+
+               [MonoTODO]
+               protected internal RegexRunnerFactory factory;
 #endif
                [MonoTODO]
                protected internal int capsize;
                [MonoTODO]
                protected internal string [] capslist;
-               [MonoTODO]
-               protected internal RegexRunnerFactory factory;
        }
 }
index 40e0913b0bbd473a929148e8c5c776bc1f773a3c..e1a893fc9ff0c1dfe40d238de67f03a05bc78022 100644 (file)
@@ -35,7 +35,9 @@ namespace System.Text.RegularExpressions {
                IgnoreCase                      = 0x001,
                Multiline                       = 0x002,
                ExplicitCapture                 = 0x004,
+#if !NET_2_1
                Compiled                        = 0x008,
+#endif
                Singleline                      = 0x010,
                IgnorePatternWhitespace         = 0x020,
                RightToLeft                     = 0x040,