diff options
author | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2004-06-01 05:01:23 +0400 |
---|---|---|
committer | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2004-06-01 05:01:23 +0400 |
commit | 6e3884f14fb20a8ce5b75a4e8274ce0791d4399c (patch) | |
tree | eb67f14f1565d5eacc521b21c507677caa87031c | |
parent | 0b06a8ac4c1f8df3e46d6fb4aab2cb9a4e89c502 (diff) |
2004-06-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* syntax.cs: reverting my previous patch. It causes bigger problems.
svn path=/trunk/mcs/; revision=28604
-rw-r--r-- | mcs/class/System/System.Text.RegularExpressions/ChangeLog | 4 | ||||
-rw-r--r-- | mcs/class/System/System.Text.RegularExpressions/syntax.cs | 22 |
2 files changed, 21 insertions, 5 deletions
diff --git a/mcs/class/System/System.Text.RegularExpressions/ChangeLog b/mcs/class/System/System.Text.RegularExpressions/ChangeLog index 3967632a442..181406cfcde 100644 --- a/mcs/class/System/System.Text.RegularExpressions/ChangeLog +++ b/mcs/class/System/System.Text.RegularExpressions/ChangeLog @@ -1,3 +1,7 @@ +2004-06-01 Gonzalo Paniagua Javier <gonzalo@ximian.com> + + * syntax.cs: reverting my previous patch. It causes bigger problems. + 2004-05-27 Gonzalo Paniagua Javier <gonzalo@ximian.com> * category.cs: added LastValue field to mark the end of enum Category. diff --git a/mcs/class/System/System.Text.RegularExpressions/syntax.cs b/mcs/class/System/System.Text.RegularExpressions/syntax.cs index 387a2f2f87b..ed02509572a 100644 --- a/mcs/class/System/System.Text.RegularExpressions/syntax.cs +++ b/mcs/class/System/System.Text.RegularExpressions/syntax.cs @@ -773,9 +773,14 @@ namespace System.Text.RegularExpressions.Syntax { // initialize pos/neg category arrays - int cat_size = (int) Category.LastValue; - pos_cats = new BitArray (cat_size); - neg_cats = new BitArray (cat_size); + Array cat_values = Enum.GetValues (typeof (Category)); + int cat_size = (int)(Category)cat_values.GetValue (cat_values.Length - 1) + 1; + pos_cats = new bool[cat_size]; + neg_cats = new bool[cat_size]; + for (int i = 0; i < cat_size; ++ i) { + pos_cats[i] = false; + neg_cats[i] = false; + } } public CharacterClass (Category cat, bool negate) : this (false, false) { @@ -796,8 +801,15 @@ namespace System.Text.RegularExpressions.Syntax { int n = (int)cat; if (negate) { + if (pos_cats[n]) + pos_cats[n] = false; + neg_cats[n] = true; - } else { + } + else { + if (neg_cats[n]) + neg_cats[n] = false; + pos_cats[n] = true; } } @@ -926,7 +938,7 @@ namespace System.Text.RegularExpressions.Syntax { private static Interval upper_case_characters = new Interval ((char)65, (char)90); private const int distance_between_upper_and_lower_case = 32; private bool negate, ignore; - private BitArray pos_cats, neg_cats; + private bool[] pos_cats, neg_cats; private IntervalCollection intervals; } |