2002-05-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Mon, 13 May 2002 22:13:58 +0000 (22:13 -0000)
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Mon, 13 May 2002 22:13:58 +0000 (22:13 -0000)
* ChangeLog: removed empty entry at the top of the file.

* Int32.cs: made static functions used by Parse internal.

* Int64.cs:
* UInt32.cs:
* UInt64.cs: removed static fucntions used by Parse and use the ones
in Int32.cs

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

mcs/class/corlib/System/ChangeLog
mcs/class/corlib/System/Int32.cs
mcs/class/corlib/System/Int64.cs
mcs/class/corlib/System/UInt32.cs
mcs/class/corlib/System/UInt64.cs

index 1a23e1be9a9e55a867911f1d7a2fb5f698da66ba..b03b2b5fe963a30a55045cfc40f643fc0350cbcc 100644 (file)
@@ -1,5 +1,14 @@
-2002-03-24  Miguel de Icaza  <miguel@ximian.com>
-       
+2002-05-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * ChangeLog: removed empty entry at the top of the file.
+
+       * Int32.cs: made static functions used by Parse internal.
+
+       * Int64.cs:
+       * UInt32.cs:
+       * UInt64.cs: removed static fucntions used by Parse and use the ones
+       in Int32.cs
+
 2002-05-12  Daniel Morgan <danmorg@sc.rr.com>
 
        * IServiceProvider.cs: added using System
index 5b95533cfe8a8f183a84da34eb0880657d45dfdd..ca495036b5e4c346bef990f606742dec2845d893 100644 (file)
@@ -113,7 +113,7 @@ namespace System {
                        return Parse (s, style, null);
                }
 
-               private static void CheckStyle (NumberStyles style)
+               internal static void CheckStyle (NumberStyles style)
                {
                        if ((style & NumberStyles.AllowHexSpecifier) != 0) {
                                NumberStyles ne = style ^ NumberStyles.AllowHexSpecifier;
@@ -129,7 +129,7 @@ namespace System {
                        }
                }
                
-               private static int JumpOverWhite (int pos, string s, bool excp)
+               internal static int JumpOverWhite (int pos, string s, bool excp)
                {
                        while (pos < s.Length && Char.IsWhiteSpace (s [pos]))
                                pos++;
@@ -140,7 +140,7 @@ namespace System {
                        return pos;
                }
 
-               private static void FindSign (ref int pos, string s, NumberFormatInfo nfi, 
+               internal static void FindSign (ref int pos, string s, NumberFormatInfo nfi, 
                                      ref bool foundSign, ref bool negative)
                {
                        if ((pos + nfi.NegativeSign.Length) <= s.Length &&
@@ -157,7 +157,7 @@ namespace System {
                        } 
                }
 
-               private static void FindCurrency (ref int pos,
+               internal static void FindCurrency (ref int pos,
                                                 string s, 
                                                 NumberFormatInfo nfi,
                                                 ref bool foundCurrency)
@@ -169,7 +169,7 @@ namespace System {
                        } 
                }
 
-               private static bool FindOther (ref int pos,
+               internal static bool FindOther (ref int pos,
                                              string s, 
                                              string other)
                {
@@ -182,7 +182,7 @@ namespace System {
                        return false;
                }
 
-               private static bool ValidDigit (char e, bool allowHex)
+               internal static bool ValidDigit (char e, bool allowHex)
                {
                        if (allowHex)
                                return Char.IsDigit (e) || (e >= 'A' && e <= 'F') || (e >= 'a' && e <= 'f');
index baf8ef356c11fb1293bfa26dc300d3b37e368602..995c3a3cc4505982c55f0062ff68eca6dd29e251 100644 (file)
@@ -114,83 +114,6 @@ namespace System {
                        return Parse (s, style, null);
                }
 
-               private static void CheckStyle (NumberStyles style)
-               {
-                       if ((style & NumberStyles.AllowHexSpecifier) != 0) {
-                               NumberStyles ne = style ^ NumberStyles.AllowHexSpecifier;
-                               if ((ne & NumberStyles.AllowLeadingWhite) != 0)
-                                       ne ^= NumberStyles.AllowLeadingWhite;
-                               if ((ne & NumberStyles.AllowTrailingWhite) != 0)
-                                       ne ^= NumberStyles.AllowTrailingWhite;
-                               if (ne != 0)
-                                       throw new ArgumentException (
-                                               "With AllowHexSpecifier only " + 
-                                               "AllowLeadingWhite and AllowTrailingWhite " + 
-                                               "are permitted.");
-                       }
-               }
-               
-               private static int JumpOverWhite (int pos, string s, bool excp)
-               {
-                       while (pos < s.Length && Char.IsWhiteSpace (s [pos]))
-                               pos++;
-
-                       if (excp && pos >= s.Length)
-                               throw new FormatException ("Input string was not in the correct format.");
-
-                       return pos;
-               }
-
-               private static void FindSign (ref int pos, string s, NumberFormatInfo nfi, 
-                                     ref bool foundSign, ref bool negative)
-               {
-                       if ((pos + nfi.NegativeSign.Length) <= s.Length &&
-                            s.Substring (pos, nfi.NegativeSign.Length) == nfi.NegativeSign) {
-                               negative = true;
-                               foundSign = true;
-                               pos += nfi.NegativeSign.Length;
-                       } 
-                       else if ((pos + nfi.PositiveSign.Length) < s.Length &&
-                            s.Substring (pos, nfi.PositiveSign.Length) == nfi.PositiveSign) {
-                               negative = false;
-                               pos += nfi.PositiveSign.Length;
-                               foundSign = true;
-                       } 
-               }
-
-               private static void FindCurrency (ref int pos,
-                                                string s, 
-                                                NumberFormatInfo nfi,
-                                                ref bool foundCurrency)
-               {
-                       if ((pos + nfi.CurrencySymbol.Length) <= s.Length &&
-                            s.Substring (pos, nfi.CurrencySymbol.Length) == nfi.CurrencySymbol) {
-                               foundCurrency = true;
-                               pos += nfi.CurrencySymbol.Length;
-                       } 
-               }
-
-               private static bool FindOther (ref int pos,
-                                             string s, 
-                                             string other)
-               {
-                       if ((pos + other.Length) <= s.Length &&
-                            s.Substring (pos, other.Length) == other) {
-                               pos += other.Length;
-                               return true;
-                       } 
-
-                       return false;
-               }
-
-               private static bool ValidDigit (char e, bool allowHex)
-               {
-                       if (allowHex)
-                               return Char.IsDigit (e) || (e >= 'A' && e <= 'F') || (e >= 'a' && e <= 'f');
-
-                       return Char.IsDigit (e);
-               }
-               
                public static long Parse (string s, NumberStyles style, IFormatProvider fp)
                {
                        if (s == null)
@@ -208,7 +131,7 @@ namespace System {
                        else
                                nfi = Thread.CurrentThread.CurrentCulture.NumberFormat;
 
-                       CheckStyle (style);
+                       Int32.CheckStyle (style);
 
                        bool AllowCurrencySymbol = (style & NumberStyles.AllowCurrencySymbol) != 0;
                        bool AllowExponent = (style & NumberStyles.AllowExponent) != 0;
@@ -224,7 +147,7 @@ namespace System {
                        int pos = 0;
 
                        if (AllowLeadingWhite)
-                               pos = JumpOverWhite (pos, s, true);
+                               pos = Int32.JumpOverWhite (pos, s, true);
 
                        bool foundOpenParentheses = false;
                        bool negative = false;
@@ -239,7 +162,7 @@ namespace System {
                                                 // even when NumberFormatInfo.NumberNegativePattern != 0!!!
                                pos++;
                                if (AllowLeadingWhite)
-                                       pos = JumpOverWhite (pos, s, true);
+                                       pos = Int32.JumpOverWhite (pos, s, true);
 
                                if (s.Substring (pos, nfi.NegativeSign.Length) == nfi.NegativeSign)
                                        throw new FormatException ("Input string was not in the correct " +
@@ -251,31 +174,31 @@ namespace System {
 
                        if (AllowLeadingSign && !foundSign) {
                                // Sign + Currency
-                               FindSign (ref pos, s, nfi, ref foundSign, ref negative);
+                               Int32.FindSign (ref pos, s, nfi, ref foundSign, ref negative);
                                if (foundSign) {
                                        if (AllowLeadingWhite)
-                                               pos = JumpOverWhite (pos, s, true);
+                                               pos = Int32.JumpOverWhite (pos, s, true);
                                        if (AllowCurrencySymbol) {
-                                               FindCurrency (ref pos, s, nfi,
-                                                             ref foundCurrency);
+                                               Int32.FindCurrency (ref pos, s, nfi,
+                                                                   ref foundCurrency);
                                                if (foundCurrency && AllowLeadingWhite)
-                                                       pos = JumpOverWhite (pos, s, true);
+                                                       pos = Int32.JumpOverWhite (pos, s, true);
                                        }
                                }
                        }
                        
                        if (AllowCurrencySymbol && !foundCurrency) {
                                // Currency + sign
-                               FindCurrency (ref pos, s, nfi, ref foundCurrency);
+                               Int32.FindCurrency (ref pos, s, nfi, ref foundCurrency);
                                if (foundCurrency) {
                                        if (AllowLeadingWhite)
-                                               pos = JumpOverWhite (pos, s, true);
+                                               pos = Int32.JumpOverWhite (pos, s, true);
                                        if (foundCurrency) {
                                                if (!foundSign && AllowLeadingSign) {
-                                                       FindSign (ref pos, s, nfi, ref foundSign,
-                                                                 ref negative);
+                                                       Int32.FindSign (ref pos, s, nfi, ref foundSign,
+                                                                       ref negative);
                                                        if (foundSign && AllowLeadingWhite)
-                                                               pos = JumpOverWhite (pos, s, true);
+                                                               pos = Int32.JumpOverWhite (pos, s, true);
                                                }
                                        }
                                }
@@ -290,13 +213,13 @@ namespace System {
                        // Number stuff
                        do {
 
-                               if (!ValidDigit (s [pos], AllowHexSpecifier)) {
+                               if (!Int32.ValidDigit (s [pos], AllowHexSpecifier)) {
                                        if (AllowThousands &&
-                                           FindOther (ref pos, s, nfi.NumberGroupSeparator))
+                                           Int32.FindOther (ref pos, s, nfi.NumberGroupSeparator))
                                            continue;
                                        else
                                        if (!decimalPointFound && AllowDecimalPoint &&
-                                           FindOther (ref pos, s, nfi.NumberDecimalSeparator)) {
+                                           Int32.FindOther (ref pos, s, nfi.NumberDecimalSeparator)) {
                                            decimalPointFound = true;
                                            continue;
                                        }
@@ -346,37 +269,37 @@ namespace System {
 
                        if (AllowTrailingSign && !foundSign) {
                                // Sign + Currency
-                               FindSign (ref pos, s, nfi, ref foundSign, ref negative);
+                               Int32.FindSign (ref pos, s, nfi, ref foundSign, ref negative);
                                if (foundSign) {
                                        if (AllowTrailingWhite)
-                                               pos = JumpOverWhite (pos, s, true);
+                                               pos = Int32.JumpOverWhite (pos, s, true);
                                        if (AllowCurrencySymbol)
-                                               FindCurrency (ref pos, s, nfi,
-                                                             ref foundCurrency);
+                                               Int32.FindCurrency (ref pos, s, nfi,
+                                                                   ref foundCurrency);
                                }
                        }
                        
                        if (AllowCurrencySymbol && !foundCurrency) {
                                // Currency + sign
-                               FindCurrency (ref pos, s, nfi, ref foundCurrency);
+                               Int32.FindCurrency (ref pos, s, nfi, ref foundCurrency);
                                if (foundCurrency) {
                                        if (AllowTrailingWhite)
-                                               pos = JumpOverWhite (pos, s, true);
+                                               pos = Int32.JumpOverWhite (pos, s, true);
                                        if (!foundSign && AllowTrailingSign)
-                                               FindSign (ref pos, s, nfi, ref foundSign,
-                                                         ref negative);
+                                               Int32.FindSign (ref pos, s, nfi, ref foundSign,
+                                                               ref negative);
                                }
                        }
                        
                        if (AllowTrailingWhite && pos < s.Length)
-                               pos = JumpOverWhite (pos, s, false);
+                               pos = Int32.JumpOverWhite (pos, s, false);
 
                        if (foundOpenParentheses) {
                                if (pos >= s.Length || s [pos++] != ')')
                                        throw new FormatException ("Input string was not in the correct " +
                                                                   "format.");
                                if (AllowTrailingWhite && pos < s.Length)
-                                       pos = JumpOverWhite (pos, s, false);
+                                       pos = Int32.JumpOverWhite (pos, s, false);
                        }
 
                        if (pos < s.Length)
index 26890efa806d04285541ed7909b72303a00a1d7b..911a90967857d781b2c893419dab5d5e5dba2a77 100644 (file)
@@ -115,83 +115,6 @@ namespace System {
                        return Parse (s, style, null);
                }
 
-               private static void CheckStyle (NumberStyles style)
-               {
-                       if ((style & NumberStyles.AllowHexSpecifier) != 0) {
-                               NumberStyles ne = style ^ NumberStyles.AllowHexSpecifier;
-                               if ((ne & NumberStyles.AllowLeadingWhite) != 0)
-                                       ne ^= NumberStyles.AllowLeadingWhite;
-                               if ((ne & NumberStyles.AllowTrailingWhite) != 0)
-                                       ne ^= NumberStyles.AllowTrailingWhite;
-                               if (ne != 0)
-                                       throw new ArgumentException (
-                                               "With AllowHexSpecifier only " + 
-                                               "AllowLeadingWhite and AllowTrailingWhite " + 
-                                               "are permitted.");
-                       }
-               }
-       
-               private static int JumpOverWhite (int pos, string s, bool excp)
-               {
-                       while (pos < s.Length && Char.IsWhiteSpace (s [pos]))
-                               pos++;
-
-                       if (excp && pos >= s.Length)
-                               throw new FormatException ("Input string was not in the correct format.");
-
-                       return pos;
-               }
-
-               private static void FindSign (ref int pos, string s, NumberFormatInfo nfi, 
-                                     ref bool foundSign, ref bool negative)
-               {
-                       if ((pos + nfi.NegativeSign.Length) <= s.Length &&
-                            s.Substring (pos, nfi.NegativeSign.Length) == nfi.NegativeSign) {
-                               negative = true;
-                               foundSign = true;
-                               pos += nfi.NegativeSign.Length;
-                       } 
-                       else if ((pos + nfi.PositiveSign.Length) < s.Length &&
-                            s.Substring (pos, nfi.PositiveSign.Length) == nfi.PositiveSign) {
-                               negative = false;
-                               pos += nfi.PositiveSign.Length;
-                               foundSign = true;
-                       } 
-               }
-
-               private static void FindCurrency (ref int pos,
-                                                 string s, 
-                                                 NumberFormatInfo nfi,
-                                                 ref bool foundCurrency)
-               {
-                       if ((pos + nfi.CurrencySymbol.Length) <= s.Length &&
-                            s.Substring (pos, nfi.CurrencySymbol.Length) == nfi.CurrencySymbol) {
-                               foundCurrency = true;
-                               pos += nfi.CurrencySymbol.Length;
-                       } 
-               }
-
-               private static bool FindOther (ref int pos,
-                                              string s, 
-                                              string other)
-               {
-                       if ((pos + other.Length) <= s.Length &&
-                            s.Substring (pos, other.Length) == other) {
-                               pos += other.Length;
-                               return true;
-                       } 
-
-                       return false;
-               }
-
-               private static bool ValidDigit (char e, bool allowHex)
-               {
-                       if (allowHex)
-                               return Char.IsDigit (e) || (e >= 'A' && e <= 'F') || (e >= 'a' && e <= 'f');
-
-                       return Char.IsDigit (e);
-               }
-               
                [CLSCompliant(false)]
                public static uint Parse (string s, NumberStyles style, IFormatProvider fp)
                {
@@ -209,7 +132,7 @@ namespace System {
                        else
                                nfi = Thread.CurrentThread.CurrentCulture.NumberFormat;
 
-                       CheckStyle (style);
+                       Int32.CheckStyle (style);
 
                        bool AllowCurrencySymbol = (style & NumberStyles.AllowCurrencySymbol) != 0;
                        bool AllowExponent = (style & NumberStyles.AllowExponent) != 0;
@@ -225,7 +148,7 @@ namespace System {
                        int pos = 0;
 
                        if (AllowLeadingWhite)
-                               pos = JumpOverWhite (pos, s, true);
+                               pos = Int32.JumpOverWhite (pos, s, true);
 
                        bool foundOpenParentheses = false;
                        bool negative = false;
@@ -240,7 +163,7 @@ namespace System {
                                                 // even when NumberFormatInfo.NumberNegativePattern != 0!!!
                                pos++;
                                if (AllowLeadingWhite)
-                                       pos = JumpOverWhite (pos, s, true);
+                                       pos = Int32.JumpOverWhite (pos, s, true);
 
                                if (s.Substring (pos, nfi.NegativeSign.Length) == nfi.NegativeSign)
                                        throw new FormatException ("Input string was not in the correct format.");
@@ -250,31 +173,31 @@ namespace System {
 
                        if (AllowLeadingSign && !foundSign) {
                                // Sign + Currency
-                               FindSign (ref pos, s, nfi, ref foundSign, ref negative);
+                               Int32.FindSign (ref pos, s, nfi, ref foundSign, ref negative);
                                if (foundSign) {
                                        if (AllowLeadingWhite)
-                                               pos = JumpOverWhite (pos, s, true);
+                                               pos = Int32.JumpOverWhite (pos, s, true);
                                        if (AllowCurrencySymbol) {
-                                               FindCurrency (ref pos, s, nfi,
-                                                             ref foundCurrency);
+                                               Int32.FindCurrency (ref pos, s, nfi,
+                                                                   ref foundCurrency);
                                                if (foundCurrency && AllowLeadingWhite)
-                                                       pos = JumpOverWhite (pos, s, true);
+                                                       pos = Int32.JumpOverWhite (pos, s, true);
                                        }
                                }
                        }
                        
                        if (AllowCurrencySymbol && !foundCurrency) {
                                // Currency + sign
-                               FindCurrency (ref pos, s, nfi, ref foundCurrency);
+                               Int32.FindCurrency (ref pos, s, nfi, ref foundCurrency);
                                if (foundCurrency) {
                                        if (AllowLeadingWhite)
-                                               pos = JumpOverWhite (pos, s, true);
+                                               pos = Int32.JumpOverWhite (pos, s, true);
                                        if (foundCurrency) {
                                                if (!foundSign && AllowLeadingSign) {
-                                                       FindSign (ref pos, s, nfi, ref foundSign,
-                                                                 ref negative);
+                                                       Int32.FindSign (ref pos, s, nfi, ref foundSign,
+                                                                       ref negative);
                                                        if (foundSign && AllowLeadingWhite)
-                                                               pos = JumpOverWhite (pos, s, true);
+                                                               pos = Int32.JumpOverWhite (pos, s, true);
                                                }
                                        }
                                }
@@ -290,13 +213,13 @@ namespace System {
                        // Just the same as Int32, but this one adds instead of substract
                        do {
 
-                               if (!ValidDigit (s [pos], AllowHexSpecifier)) {
+                               if (!Int32.ValidDigit (s [pos], AllowHexSpecifier)) {
                                        if (AllowThousands &&
-                                           FindOther (ref pos, s, nfi.NumberGroupSeparator))
+                                           Int32.FindOther (ref pos, s, nfi.NumberGroupSeparator))
                                            continue;
                                        else
                                        if (!decimalPointFound && AllowDecimalPoint &&
-                                           FindOther (ref pos, s, nfi.NumberDecimalSeparator)) {
+                                           Int32.FindOther (ref pos, s, nfi.NumberDecimalSeparator)) {
                                            decimalPointFound = true;
                                            continue;
                                        }
@@ -342,37 +265,37 @@ namespace System {
 
                        if (AllowTrailingSign && !foundSign) {
                                // Sign + Currency
-                               FindSign (ref pos, s, nfi, ref foundSign, ref negative);
+                               Int32.FindSign (ref pos, s, nfi, ref foundSign, ref negative);
                                if (foundSign) {
                                        if (AllowTrailingWhite)
-                                               pos = JumpOverWhite (pos, s, true);
+                                               pos = Int32.JumpOverWhite (pos, s, true);
                                        if (AllowCurrencySymbol)
-                                               FindCurrency (ref pos, s, nfi,
-                                                             ref foundCurrency);
+                                               Int32. FindCurrency (ref pos, s, nfi,
+                                                                    ref foundCurrency);
                                }
                        }
                        
                        if (AllowCurrencySymbol && !foundCurrency) {
                                // Currency + sign
-                               FindCurrency (ref pos, s, nfi, ref foundCurrency);
+                               Int32.FindCurrency (ref pos, s, nfi, ref foundCurrency);
                                if (foundCurrency) {
                                        if (AllowTrailingWhite)
-                                               pos = JumpOverWhite (pos, s, true);
+                                               pos = Int32.JumpOverWhite (pos, s, true);
                                        if (!foundSign && AllowTrailingSign)
-                                               FindSign (ref pos, s, nfi, ref foundSign,
-                                                         ref negative);
+                                               Int32.FindSign (ref pos, s, nfi, ref foundSign,
+                                                               ref negative);
                                }
                        }
                        
                        if (AllowTrailingWhite && pos < s.Length)
-                               pos = JumpOverWhite (pos, s, false);
+                               pos = Int32.JumpOverWhite (pos, s, false);
 
                        if (foundOpenParentheses) {
                                if (pos >= s.Length || s [pos++] != ')')
                                        throw new FormatException ("Input string was not in the correct " + 
                                                                   "format.");
                                if (AllowTrailingWhite && pos < s.Length)
-                                       pos = JumpOverWhite (pos, s, false);
+                                       pos = Int32.JumpOverWhite (pos, s, false);
                        }
 
                        if (pos < s.Length)
index 24cdf6e9864006ca898a56b44e48dda4abe73593..9715777918df827120daffe64ad70d17e58dec8d 100644 (file)
@@ -68,83 +68,6 @@ namespace System {
                        return Parse (s, style, null);
                }
 
-               private static void CheckStyle (NumberStyles style)
-               {
-                       if ((style & NumberStyles.AllowHexSpecifier) != 0) {
-                               NumberStyles ne = style ^ NumberStyles.AllowHexSpecifier;
-                               if ((ne & NumberStyles.AllowLeadingWhite) != 0)
-                                       ne ^= NumberStyles.AllowLeadingWhite;
-                               if ((ne & NumberStyles.AllowTrailingWhite) != 0)
-                                       ne ^= NumberStyles.AllowTrailingWhite;
-                               if (ne != 0)
-                                       throw new ArgumentException (
-                                               "With AllowHexSpecifier only " + 
-                                               "AllowLeadingWhite and AllowTrailingWhite " + 
-                                               "are permitted.");
-                       }
-               }
-       
-               private static int JumpOverWhite (int pos, string s, bool excp)
-               {
-                       while (pos < s.Length && Char.IsWhiteSpace (s [pos]))
-                               pos++;
-
-                       if (excp && pos >= s.Length)
-                               throw new FormatException ("Input string was not in the correct format.");
-
-                       return pos;
-               }
-
-               private static void FindSign (ref int pos, string s, NumberFormatInfo nfi, 
-                                     ref bool foundSign, ref bool negative)
-               {
-                       if ((pos + nfi.NegativeSign.Length) <= s.Length &&
-                            s.Substring (pos, nfi.NegativeSign.Length) == nfi.NegativeSign) {
-                               negative = true;
-                               foundSign = true;
-                               pos += nfi.NegativeSign.Length;
-                       } 
-                       else if ((pos + nfi.PositiveSign.Length) < s.Length &&
-                            s.Substring (pos, nfi.PositiveSign.Length) == nfi.PositiveSign) {
-                               negative = false;
-                               pos += nfi.PositiveSign.Length;
-                               foundSign = true;
-                       } 
-               }
-
-               private static void FindCurrency (ref int pos,
-                                                 string s, 
-                                                 NumberFormatInfo nfi,
-                                                 ref bool foundCurrency)
-               {
-                       if ((pos + nfi.CurrencySymbol.Length) <= s.Length &&
-                            s.Substring (pos, nfi.CurrencySymbol.Length) == nfi.CurrencySymbol) {
-                               foundCurrency = true;
-                               pos += nfi.CurrencySymbol.Length;
-                       } 
-               }
-
-               private static bool FindOther (ref int pos,
-                                              string s, 
-                                              string other)
-               {
-                       if ((pos + other.Length) <= s.Length &&
-                            s.Substring (pos, other.Length) == other) {
-                               pos += other.Length;
-                               return true;
-                       } 
-
-                       return false;
-               }
-
-               private static bool ValidDigit (char e, bool allowHex)
-               {
-                       if (allowHex)
-                               return Char.IsDigit (e) || (e >= 'A' && e <= 'F') || (e >= 'a' && e <= 'f');
-
-                       return Char.IsDigit (e);
-               }
-               
                [CLSCompliant(false)]
                public static ulong Parse (string s, NumberStyles style, IFormatProvider fp)
                {
@@ -162,7 +85,7 @@ namespace System {
                        else
                                nfi = Thread.CurrentThread.CurrentCulture.NumberFormat;
 
-                       CheckStyle (style);
+                       Int32.CheckStyle (style);
 
                        bool AllowCurrencySymbol = (style & NumberStyles.AllowCurrencySymbol) != 0;
                        bool AllowExponent = (style & NumberStyles.AllowExponent) != 0;
@@ -178,7 +101,7 @@ namespace System {
                        int pos = 0;
 
                        if (AllowLeadingWhite)
-                               pos = JumpOverWhite (pos, s, true);
+                               pos = Int32.JumpOverWhite (pos, s, true);
 
                        bool foundOpenParentheses = false;
                        bool negative = false;
@@ -193,7 +116,7 @@ namespace System {
                                                 // even when NumberFormatInfo.NumberNegativePattern != 0!!!
                                pos++;
                                if (AllowLeadingWhite)
-                                       pos = JumpOverWhite (pos, s, true);
+                                       pos = Int32.JumpOverWhite (pos, s, true);
 
                                if (s.Substring (pos, nfi.NegativeSign.Length) == nfi.NegativeSign)
                                        throw new FormatException ("Input string was not in the correct format.");
@@ -203,31 +126,31 @@ namespace System {
 
                        if (AllowLeadingSign && !foundSign) {
                                // Sign + Currency
-                               FindSign (ref pos, s, nfi, ref foundSign, ref negative);
+                               Int32.FindSign (ref pos, s, nfi, ref foundSign, ref negative);
                                if (foundSign) {
                                        if (AllowLeadingWhite)
-                                               pos = JumpOverWhite (pos, s, true);
+                                               pos = Int32.JumpOverWhite (pos, s, true);
                                        if (AllowCurrencySymbol) {
-                                               FindCurrency (ref pos, s, nfi,
-                                                             ref foundCurrency);
+                                               Int32.FindCurrency (ref pos, s, nfi,
+                                                                   ref foundCurrency);
                                                if (foundCurrency && AllowLeadingWhite)
-                                                       pos = JumpOverWhite (pos, s, true);
+                                                       pos = Int32.JumpOverWhite (pos, s, true);
                                        }
                                }
                        }
                        
                        if (AllowCurrencySymbol && !foundCurrency) {
                                // Currency + sign
-                               FindCurrency (ref pos, s, nfi, ref foundCurrency);
+                               Int32.FindCurrency (ref pos, s, nfi, ref foundCurrency);
                                if (foundCurrency) {
                                        if (AllowLeadingWhite)
-                                               pos = JumpOverWhite (pos, s, true);
+                                               pos = Int32.JumpOverWhite (pos, s, true);
                                        if (foundCurrency) {
                                                if (!foundSign && AllowLeadingSign) {
-                                                       FindSign (ref pos, s, nfi, ref foundSign,
-                                                                 ref negative);
+                                                       Int32.FindSign (ref pos, s, nfi, ref foundSign,
+                                                                       ref negative);
                                                        if (foundSign && AllowLeadingWhite)
-                                                               pos = JumpOverWhite (pos, s, true);
+                                                               pos = Int32.JumpOverWhite (pos, s, true);
                                                }
                                        }
                                }
@@ -243,13 +166,13 @@ namespace System {
                        // Just the same as Int32, but this one adds instead of substract
                        do {
 
-                               if (!ValidDigit (s [pos], AllowHexSpecifier)) {
+                               if (!Int32.ValidDigit (s [pos], AllowHexSpecifier)) {
                                        if (AllowThousands &&
-                                           FindOther (ref pos, s, nfi.NumberGroupSeparator))
+                                           Int32.FindOther (ref pos, s, nfi.NumberGroupSeparator))
                                            continue;
                                        else
                                        if (!decimalPointFound && AllowDecimalPoint &&
-                                           FindOther (ref pos, s, nfi.NumberDecimalSeparator)) {
+                                           Int32.FindOther (ref pos, s, nfi.NumberDecimalSeparator)) {
                                            decimalPointFound = true;
                                            continue;
                                        }
@@ -295,37 +218,37 @@ namespace System {
 
                        if (AllowTrailingSign && !foundSign) {
                                // Sign + Currency
-                               FindSign (ref pos, s, nfi, ref foundSign, ref negative);
+                               Int32.FindSign (ref pos, s, nfi, ref foundSign, ref negative);
                                if (foundSign) {
                                        if (AllowTrailingWhite)
-                                               pos = JumpOverWhite (pos, s, true);
+                                               pos = Int32.JumpOverWhite (pos, s, true);
                                        if (AllowCurrencySymbol)
-                                               FindCurrency (ref pos, s, nfi,
-                                                             ref foundCurrency);
+                                               Int32.FindCurrency (ref pos, s, nfi,
+                                                                   ref foundCurrency);
                                }
                        }
                        
                        if (AllowCurrencySymbol && !foundCurrency) {
                                // Currency + sign
-                               FindCurrency (ref pos, s, nfi, ref foundCurrency);
+                               Int32.FindCurrency (ref pos, s, nfi, ref foundCurrency);
                                if (foundCurrency) {
                                        if (AllowTrailingWhite)
-                                               pos = JumpOverWhite (pos, s, true);
+                                               pos = Int32.JumpOverWhite (pos, s, true);
                                        if (!foundSign && AllowTrailingSign)
-                                               FindSign (ref pos, s, nfi, ref foundSign,
-                                                         ref negative);
+                                               Int32.FindSign (ref pos, s, nfi, ref foundSign,
+                                                               ref negative);
                                }
                        }
                        
                        if (AllowTrailingWhite && pos < s.Length)
-                               pos = JumpOverWhite (pos, s, false);
+                               pos = Int32.JumpOverWhite (pos, s, false);
 
                        if (foundOpenParentheses) {
                                if (pos >= s.Length || s [pos++] != ')')
                                        throw new FormatException ("Input string was not in the correct " + 
                                                                   "format.");
                                if (AllowTrailingWhite && pos < s.Length)
-                                       pos = JumpOverWhite (pos, s, false);
+                                       pos = Int32.JumpOverWhite (pos, s, false);
                        }
 
                        if (pos < s.Length)