708ca8c66971f13c12dc89fed94dc797f6afe837
[mono.git] / mcs / class / System / System.Text.RegularExpressions / ChangeLog
1 2009-08-19  Raja R Harinath  <harinath@hurrynot.org>
2
3         * Regex.cs (group_numbers): New.
4         (GetGroupNumbers): Move array initialization ...
5         (GroupNumbers): ... to new on-demand initializer.
6
7 2009-08-19  Raja R Harinath  <harinath@hurrynot.org>
8
9         * Regex.cs (group_names): Rename from _groupNumbersToNameMap.
10         (GetGroupNamesArray): Use an IDictionaryEnumerator to walk the
11         mapping, since both the key and value are used in the loop.
12
13 2009-08-19  Raja R Harinath  <harinath@hurrynot.org>
14
15         Introduce 'gap' concept into all the variants of regex
16         * arch.cs (IMachineFactory::Gap): New property.
17         * compiler.cs (InterpreterFactory): Update to changes.
18         * RxCompiler.cs (RxInterpreterFactory): Likewise.
19         * JvmReMachineFactory.cs: Likewise.
20         * parser.cs (GetMapping): Return the 'gap' index.  Move creation
21         of mapping dictionary ...
22         * Regex.cs (CreateMachineFactory): ... here.  Update to changes.
23
24 2009-08-18  Raja R Harinath  <harinath@hurrynot.org>
25
26         Distinguish between the internal index of a group and group number.
27         * Regex.cs (GetGroupIndex): New.
28         (GroupNameFromNumber): Use it.
29         * GroupCollection.cs (.ctor): Introduce 'gap' argument.  It is the
30         index of the first group whose group number differs from its index.
31         (Item.get): Likewise.
32
33 2009-08-18  Raja R Harinath  <harinath@hurrynot.org>
34
35         * parser.cs (GetMapping): Extend duplicate check for numeric
36         groups too.
37
38 2009-08-17  Raja R Harinath  <harinath@hurrynot.org>
39
40         * parser.cs (ResolveReferences): Handle some cases of
41         explicitly-named numeric groups.
42
43 2009-08-17  Raja R Harinath  <harinath@hurrynot.org>
44
45         * parser.cs (ResolveReferences): Rearrange slightly to prepare for
46         future changes.
47
48 2009-08-17  Raja R Harinath  <harinath@hurrynot.org>
49
50         * Regex.cs (GetGroupNumbers): List group numbers in ascending order.
51         (GetGroupNames): List names in order of group number.
52
53 2009-08-12  Raja R Harinath  <harinath@hurrynot.org>
54
55         * syntax.cs (BackslashNumber.ResolveReference): Improve ECMAScript
56         semantics.  Handle cases like "group 43 exists but group 4 doesn't".
57
58 2009-08-10  Raja R Harinath  <harinath@hurrynot.org>
59
60         * syntax.cs (BackslashNumber.ResolveReference): Implement fallback
61         to octal numbers, and ECMAScript semantics.
62         * parser.cs (ResolveReferences): Use it.
63
64 2009-08-10  Raja R Harinath  <harinath@hurrynot.org>
65
66         * syntax.cs (BackslashNumber): New class.
67         * parser.cs (ParseSpecial): Create it instead of 'Reference' if a
68         numeric backreference is seen.
69
70 2009-08-10  Raja R Harinath  <harinath@hurrynot.org>
71
72         * parser.cs (ResolveReferences): Allow named groups to be
73         referred-to by their group numbers too.
74
75 2009-04-23  Sebastien Pouliot  <sebastien@ximian.com>
76
77         * Regex.cs: Remove Compiler-related support for NET_2_1
78         * RegexOptions.cs: Remove Compile from values available on NET_2_1
79
80 2009-03-04  Zoltan Varga  <vargaz@gmail.com>
81
82         * RxInterpreter.cs (ResetGroups): Avoid allocating larger than needed
83         arrays.
84
85 2009-02-27  Jonathan Pryor <jpryor@novell.com>
86
87         * Regex.cs (Replace): Check that input & evaluator are not null, as
88           documented in MSDN (and the variance found while testing DbLinq).
89
90 2009-02-27  Zoltan Varga  <vargaz@gmail.com>
91
92         * BaseMachine.cs (LTRReplace): Initialize the StringBuilder with an
93         appropriate initial length.
94
95 2009-02-24  Zoltan Varga  <vargaz@gmail.com>
96
97         * CILCompiler.cs: Partially inline calls to Char.ToLower () to speed
98         up ignorecase matching.
99
100 2009-02-16  Jb Evain  <jbevain@novell.com>
101
102         * Regex.cs: on the NET_2_1 profile, always use the old engine for now.
103
104 2009-02-14  Zoltan Varga  <vargaz@gmail.com>
105
106         * Regex.cs: Add a MONO_NEW_RX variable to enable the new regex
107         engine.
108
109 2009-02-04  Zoltan Varga  <vargaz@gmail.com>
110
111         * Regex.cs: Disable the new regex engine for now.
112
113 2009-01-14  Zoltan Varga  <vargaz@gmail.com>
114
115         * CILCompiler.cs: Avoid throwing exceptions for a few more unhandled opcodes.
116         Implement the reverse/ignorecase versions of Reference. Fix the reverse
117         version of Bitmap. Error out if a Jump opcode jumps outside the current
118         pc range. This works around #466151.
119
120 2009-01-12  Jb Evain  <jbevain@novell.com>
121
122         * RxInterpreter.cs: set trace_rx to false for NET_2_1.
123         * Regex.cs: set old_rx to false for NET_2_1.
124
125 2009-01-07  Zoltan Varga  <vargaz@gmail.com>
126
127         * RxInterpreter.cs: Add support for constant strings in anchors. Fixes
128         #464135.
129
130 2008-11-18 Gonzalo Paniagua Javier <gonzalo@novell.com>
131
132         * cache.cs: avoid infinite loop.
133
134 2008-11-14 Gonzalo Paniagua Javier <gonzalo@novell.com>
135
136         * cache.cs:
137         * Regex.cs: honor CacheSize value.
138
139 2008-11-13  Zoltan Varga  <vargaz@gmail.com>
140
141         * RxInterpreter.cs: Fix pc computation in various opcodes. Fixes #443841.
142
143 2008-11-11  Zoltan Varga  <vargaz@gmail.com>
144
145         * CILCompiler.cs: Implement Reference opcode.
146
147 2008-10-30  Zoltan Varga  <vargaz@gmail.com>
148
149         * CILCompiler.cs: Implement SubExpression opcode.
150         
151         * CILCompiler.cs: Save and restore strpos in the Test opcode. Fixes
152         #439947.
153
154 2008-10-25  Zoltan Varga  <vargaz@gmail.com>
155
156         * CILCompiler.cs: Implement Test opcode.
157
158 2008-10-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
159
160         * RxInterpreter.cs: implement missing Unicode* opcodes and
161         StringReverseIgnoreCase.
162
163 2008-10-25  Zoltan Varga  <vargaz@gmail.com>
164
165         * RxOp.cs: Remove unused Generic opcodes.
166
167         * RxCompiler.cs: Emit opcodes with flags using methods which can be 
168         overriden by CILCompiler.cs, so we only have to override a few methods.
169
170         * CILCompiler.cs: Simplify based on the RxCompiler changes. Implement
171         UnicodeString opcode. Throw a NotImplementedException when an unsupported
172         opcode is encountered, since the IL compiler is now believed to be feature 
173         complete.
174
175 2008-10-24  Zoltan Varga  <vargaz@gmail.com>
176
177         * RxInterpreter.cs CILCompiler.cs gen-interp.cs: Fix the reading of short 
178         values from the instruction stream.
179
180         * RxOp.cs: Add some missing unicode opcodes.
181
182         * gen-interp.cs RxInterpreter.cs: Generate Bitmap/UnicodeBitmap opcodes too.
183
184         * CILCompiler.cs (EmitEvalMethodBody): Add an 'end_pc' argument to mark the
185         end of the bytecode range which needs to be compiled. Use it to avoid
186         compiling the same bytecode multiple times in various opcodes. Fix
187         RxOp.Jump implementation. Add implementation for unicode opcodes.
188
189 2008-10-09  Zoltan Varga  <vargaz@gmail.com>
190
191         * CILCompiler.cs: Implement NoBitmap/NoBitmapIgnoreCase. Fixes #432172.
192
193 2008-09-14  Zoltan Varga  <vargaz@gmail.com>
194
195         * gen-interp.cs: New file to generate the all variants of the character 
196         checking opcodes in RxInterpreter.cs.
197
198         * RxInterpreter.cs: Replace hand written code with code generated by
199         gen-interp.cs.
200         
201         * RxInterpreter.cs: Fix the failure case of the No<XXX> opcodes. Fixes
202         #426142.
203
204 2008-09-13  Zoltan Varga  <vargaz@gmail.com>
205
206         * RxInterpreter.cs RxCompiler.cs: Implement some missing Category opcodes.
207
208 2008-09-07  Zoltan Varga  <vargaz@gmail.com>
209
210         * CILCompiler.cs: Override ICompiler.EmitSet too so we set op_flags for 
211         Bitmap opcodes too. Fixes #424073.
212
213 2008-09-06  Zoltan Varga  <vargaz@gmail.com>
214
215         * Regex.cs: Make the new regex interpreter+compiler the default.
216
217 2008-08-31  Zoltan Varga  <vargaz@gmail.com>
218
219         * RxInterpreter.cs: Port the Anchor+StartOfString optimization from the old
220         interpreter. Add credits.
221
222         * RxCompiler.cs (EmitString): Lowercase the string if ignore is true.
223
224         * CILCompiler.cs: Fix the setting of the match position in the
225         anchor+char optimization.
226         
227         * CILCompiler.cs: Implement FastRepeatLazy.
228
229         * CILCompiler.cs: Get rid of commented out code. Also get rid of
230         frame.local_strpos_res, since the generated code already set Arg1 to
231         the same value.
232
233 2008-08-30  Zoltan Varga  <vargaz@gmail.com>
234
235         * CILCompiler.cs: Initialize all mi_ variables lazily.
236         
237         * CILCompiler.cs: Implement FastRepeat.
238
239         * RxInterpreter.cs: Add back SetStartOfMatch, make it protected so as to
240         avoid a warning.
241
242         * CILCompiler.cs RxOp.cs: Merge lots of changes from RxInterpreter.cs,
243         refactor the code.
244
245 2008-08-29  Zoltan Varga  <vargaz@gmail.com>
246
247         * RxInterpreter.cs RxCompiler.cs RxOp.cs: Implement/fix this so all the
248         regex tests now run. The Repeat code is taken from the old interpreter.
249
250 2008-08-28  Zoltan Varga  <vargaz@gmail.com>
251
252         * RxInterpreter.cs RxCompiler.cs RxOp.cs: Add support for 
253         Category.AnySingleline.
254
255 2008-08-27  Zoltan Varga  <vargaz@gmail.com>
256
257         * RxCompiler.cs: Use Array.Copy since Buffer.BlockCopy operates on bytes.
258         
259 2008-07-31  Jb Evain  <jbevain@novell.com>
260
261         * BaseMachine.cs: clean up for NET_2_1.
262
263 2008-06-05  Roei Erez  <roeie@mainsoft.com>
264
265         * JvmReMachine.jvm.cs: Fix a bug in match that contains
266         empty group at the end.
267
268 2008-04-13  Jb Evain  <jbevain@novell.com>
269
270         * Regex.cs: update undocumented fields for the 2.1 profile.
271         Merged from the Moonlight 2 branch.
272
273 2008-02-26  Zoltan Varga  <vargaz@gmail.com>
274
275         * CILCompiler.cs: Implement StringIgnoreCase.
276         
277         * CILCompiler.cs: Implement grouping support.
278
279         * CILCompiler.cs: Implement character groups.
280
281 2008-02-25  Zoltan Varga  <vargaz@gmail.com>
282
283         * CILCompiler.cs: Implement lots of missing opcodes.
284
285 2008-02-18  Zoltan Varga  <vargaz@gmail.com>
286
287         * CILCompiler.cs (EmitEvalMethodBody): Check for the not-yet supported
288         groups.Count > 1.
289
290 Thu Feb 14 19:03:00 CET 2008 Paolo Molaro <lupus@ximian.com>
291
292         * RxCompiler.cs, RxInterpreter.cs, RxOp.cs, CILCompiler.cs : support for word
293         boundary position opcodes, ignorecase backreference and more capture
294         work.
295
296 Thu Feb 14 17:11:10 CET 2008 Paolo Molaro <lupus@ximian.com>
297
298         * RxCompiler.cs, RxInterpreter.cs, RxOp.cs: replace EcmaDigit with
299         Range, fixed matching of "" =~ /$/, implementedt TestCharGroup.
300         Fixes and other misc opcodes implemented.
301
302 2008-02-13  Zoltan Varga  <vargaz@gmail.com>
303
304         * CILCompiler.cs: Restructure some code to avoid a branch inside a loop.
305         
306         * CILCompiler.cs: Fix the unsafe string matching code.
307
308         * CILCompiler.cs: Improved version which emits only one method in most cases.
309
310         * CILCompiler.cs: Fix some comments.
311
312         * CILCompiler.cs: New file, extracted from RxCompiler.cs.
313
314         * RxInterpreter.cs RxCompiler.cs: First version of regex IL compiler.
315
316 Wed Feb 13 13:18:12 CET 2008 Paolo Molaro <lupus@ximian.com>
317
318         * RxCompiler.cs, RxInterpreter.cs, RxOp.cs: unicode categories and
319         some grouping/capture support.
320
321 Tue Feb 12 19:16:49 CET 2008 Paolo Molaro <lupus@ximian.com>
322
323         * RxCompiler.cs, RxInterpreter.cs, RxOp.cs: experimental new
324         interpreter.
325
326 2008-02-10  Zoltan Varga  <vargaz@gmail.com>
327
328         * replace.cs (NeedsGroupsOrCaptures): New property. Determines whenever the
329         replacement process needs access to the groups or captures properties of the
330         Match object.
331
332         * Group.cs: Add an internal ctor which avoids allocations.
333
334         * Match.cs: Ditto.
335
336         * BaseMachine.cs interpreter.cs: Add an optimization to avoid fully creating
337         Match objects during Replace () if the replacement string is simple.
338
339         * BaseMachine.cs Regex.cs: Make LTRReplace and RTLReplace instance methods to 
340         avoid creating two machines for each Regex.Replace () call.
341
342         * interpreter.cs (Eval): Remove a needless string allocation.
343
344 2007-12-04  Arina Itkes <arinai@mainsoft.com>
345
346         * parser.cs: Max value of m for a construct {n,m} is 2147483647.
347
348 2007-11-15  Miguel de Icaza  <miguel@novell.com>
349
350         * Revert the patch from Juraj Skripsky as it made the class
351         non-thread safe (see #341986).
352
353 2007-11-08  Raja R Harinath  <harinath@gmail.com>
354
355         Fix 324390
356         * BaseMachine.cs (LTRReplace): Don't use non-advancement of 'ptr'
357         to deduce absence of matches -- a match can have length 0.
358         (RTLReplace): Likewise.
359
360 2007-11-07  Raja R Harinath  <harinath@gmail.com>
361
362         Support RegexOptions.RightToLeft in Replace().
363         * BaseMachine.cs (Replace): Use either LTRReplace or RTLReplace
364         based on regex.
365         (LTRReplace): Make internal and rename the MatchAppendEvaluator
366         version of Replace to this.
367         (RTLReplace): New.
368         * Regex.cs (Replace): Use LTRReplace and RTLReplace from BaseMachine.
369         * replace.cs (ReplacementEvaluator.Evaluate): Optimize simple case.
370         Based on patch by Stephane Delcroix.
371
372         * replace.cs (Compile): Don't unescape string.
373
374 2007-11-01  Gert Driesen  <drieseng@users.sourceforge.net>
375
376         * Match.cs: Do not throw NotSupportedException on zero-length
377         replacement argument.
378
379 2007-10-29 Arina Itkes <arinai@mainsoft.com>
380
381         * Regex.cs: Moving creation of Regex machine to ctor.
382         It increases an initialization time of Regex but reduce a 
383         process time while APIs calling. Also it solves the problem 
384         of missed multi thread synchronization.
385
386 2007-10-29 Arina Itkes <arinai@mainsoft.com>
387         
388         * Match.cs: Fix for Result method of Match. Throwing an exception 
389         if Result method was called on a failed Match. 
390
391 2007-10-24  Juraj Skripsky <js@hotfeet.ch>
392
393         * Regex.cs: Store and re-use IMachine, no need to re-instantiate
394         it every time we're matching.
395         
396 2007-10-24 Arina Itkes <arinai@mainsoft.com>
397
398         * Regex.cs Match.cs arch.cs compiler.cs interpreter.cs
399          Refactoring of Interpreter with extracting of base abstract class 
400          that executes some methods that were moved from Regex and Match classes.
401          Added a field that maps group numbers to group names in Regex for 
402          improvement of performance of GroupNameFromNumber method.
403
404 2007-10-21  Gert Driesen  <drieseng@users.sourceforge.net>
405
406         * RegexTest.cs: Removed. Test was already moved to the appropriate
407         location. 
408
409 2007-06-21  Juraj Skripsky <js@hotfeet.ch>
410
411         * quicksearch.ch: Optimization. Add byte array as skip table for
412         chars <= 255, falling back to the hashtable for chars > 255 and
413         skip distances > 255.
414
415 2007-04-18  Raja R Harinath  <rharinath@novell.com>
416
417         Fix #80554
418         * parser.cs (ResolveReferences): Don't throw an expression if a
419         capture assertion reference cannot be resolved.
420         (ParseGroupingConstruct): Provide fallback expression to a capture
421         assertion.
422         * syntax.cs (CaptureAssertion): If the bareword doesn't refer to
423         the name of a capture group, fallback to treating it as a literal
424         expression.
425
426 2007-04-04  Raja R Harinath  <rharinath@novell.com>
427
428         * interpreter.cs (Eval) <OpCode.Reference>: Distribute for loop
429         inside if.
430         for () if (a) s1; else s2; => if (a) for () s1; else for () s2;
431
432 2007-04-03  Raja R Harinath  <rharinath@novell.com>
433
434         * Regex.cs (~Regex): Don't define in NET_2_0 profile.
435
436 2007-01-02  Raja R Harinath  <rharinath@novell.com>
437
438         Fix #79472
439         * parser.cs (Parser.GetMapping): Use the actual group numbers to
440         build the mapping.
441
442 2006-09-28  Andrew Skiba  <andrews@mainsoft.com>
443
444         * Regex.cs: TARGET_JVM
445
446 2006-05-30  Gert Driesen  <drieseng@users.sourceforge.net>
447
448         * CaptureCollection.cs: Removed virtual keyword to fix API mismatches.
449         * MatchCollection.cs: Removed virtual keyword to fix API mismatches.
450         * GroupCollection.cs: Removed virtual keyword to fix API mismatches.
451
452 2006-05-08  Raja R Harinath  <rharinath@novell.com>
453
454         Fix #78278
455         Remove 65535-limit on number of repetitions matched by a pattern.
456         We still have a 65535 limit on the length of a pattern and the
457         number of groups in a pattern.
458         * compiler.cs (PatternCompiler.EmitCount): New.  Emits an int as
459         two ushorts into the program stream.
460         (EmitInfo, EmitRepeat, EmitFastRepeat): Use it to emit integers
461         rather than shorts.
462         * interpreter.cs (Intepreter.ReadProgramCount): Read an int
463         emitted into the program stream.
464         (Interpreter): Use it.  Update counts.
465         (Interpreter.Eval) [OpCode.Repeat, OpCode.FastRepeat]: Likewise.
466         * parser.cs (ParseGroup): Pass 0x7ffffff as the max value for '*'
467         and '+' repetition patterns.
468         * arch.cs (Info, Repeat, FastRepeat): Update description.
469
470 2006-04-18  Raja R Harinath  <rharinath@novell.com>
471
472         Treat fixed repetitions of simple regexes as simple too.
473         * syntax.cs (Expression.IsComplex): Make abstract.
474         (Group.IsComplex, Alternation.IsComplex): Move ...
475         (CompositeExpression.IsComplex): ... here.
476         (Group.GetAnchorInfo): Reduce allocations.  Avoid creating another
477         ArrayList, and use a StringBuilder to build up the string.
478         (Repetition.GetAnchorInfo): Use a StringBuilder to build up the string.
479         (ExpressionAssertion.IsComplex): Override.
480
481 2006-04-17  Florian Gross  <flgr@ccan.de>
482             Raja R Harinath  <rharinath@novell.com>
483
484         * syntax.cs (CharacterClass.Compile): Emit categories after the
485         character intervals so that the evaluator can pick up the
486         'IgnoreCase' flag.
487
488 2006-04-07  Raja R Harinath  <rharinath@novell.com>
489
490         Fix #78007
491         * interpreter.cs (Interpreter.Eval) [Anchor, Position.StartOfString]:
492         Don't reset 'ptr' to 0 during forward scan.
493
494         Fix #76345
495         * interpreter.cs (Interpreter.FastEval) [FastRepeat]: If the first
496         tail operation has a 'negate' flag, avoid the "match next char"
497         optimization.
498
499         Fix #69269
500         * arch.cs (OpCode.NotCategory): New.  Stands for matching a
501         character _not_ from the given category.
502         * debug.cs (DisassembleBlock): Handle it.
503         * compiler.cs (ICompiler.EmitNotCategory): New.
504         (Compiler.EmitNotCategory): New.  Emit OpCode.NotCategory.
505         * syntax.cs (CharacterClass.Compile): Don't conflate negation of
506         the character class and negation of the category.  Use
507         EmitNotCategory.
508         * interpreter.cs (Interpreter.Eval): Pass OpCode.NotCategory to
509         EvalChar.
510         (Interpreter.EvalChar): Handle it.
511
512 2006-04-06  Raja R Harinath  <rharinath@novell.com>
513
514         Fix #77487
515         * interpreter.cs (Eval) [Until, FastUntil]: Set 'deep' to null
516         when evaluating the tail.  Ensure that backtracks don't confuse
517         the recursion vs. iteration detector.
518
519 2006-04-03  Raja R Harinath  <rharinath@novell.com>
520
521         * interpreter.cs (Eval) [Until, lazy]: Avoid extra evaluation on a
522         degenerate match.
523
524 2006-03-30  Raja R Harinath  <harinath@gmail.com>
525
526         Fix #77626
527         * parser.cs (Parser.ParseCharacterClass): Don't automatically
528         assume there's a range when we see '-'.  Ensure that we have seen
529         at least one other character, and that we aren't already parsing a
530         range.  Handle some more errors.
531
532 2005-12-19  Kornél Pál  <kornelpal@hotmail.com>
533
534         * Regex.cs: Added support for regular expressions compiled to
535           assemblies by compiling the pattern. This solution ignores existing
536           CIL code but provides full support for regular expression classes
537           compiled by MS.NET.
538
539 2005-11-21  Sebastien Pouliot  <sebastien@ximian.com> 
540
541         * CaptureCollection.cs: Fixed length check.
542         * Group.cs: Added missing validation for Synchronized method.
543         * Match.cs: Added missing validation for Synchronized and Result 
544         methods.
545         * MatchEvaluator.cs: Added [Serializable] for 2.0 profile.
546         * RegexCompilationInfo.cs: Added missing property validation.
547         * Regex.cs: Implemented UseOptionC and UseOptionR protected methods
548         (now documented). Fixed API for 2.0 profile.
549         * RegexRunner.cs: Stubbed CharInClass for 2.0 profile.
550
551 2005-11-17  Sebastien Pouliot  <sebastien@ximian.com> 
552  
553         * Match.cs: Removed the ": base ()" on the private ctor as it is
554         unrequired and cause an extra public ctor to added (bug #76736).
555         * MatchCollection.cs: Add missing virtual to indexer property.
556
557 2005-09-23  Raja R Harinath  <rharinath@novell.com>
558
559         * interpreter.cs (Interpreter.Eval) [OpCode.Until]: Invert the
560         sense of a test to reflect the code re-organization.
561
562 2005-09-22  Raja R Harinath  <rharinath@novell.com>
563
564         Fix #72152, #72989.
565         * interpreter.cs (Interpreter.Eval) [OpCode.Until]: Avoid some
566         cases of recursion when dealing with eager quantifiers too.  We
567         now avoid recursion when handling the innermost quantifier.
568         (Interpreter.IntStack, Interpreter.stack): New.  Stack to help
569         implement backtracking in eager quantifiers.
570
571 2005-09-21  Raja R Harinath  <rharinath@novell.com>
572
573         * interpreter.cs (Interpreter.Eval) [OpCode.Until]: Avoid some
574         cases of recursion when dealing with the minimum count and lazy
575         quantifiers.
576
577 2005-08-23  Raja R Harinath  <rharinath@novell.com>
578
579         * regex.cs: Remove.  Split into ...
580         * MatchEvaluator.cs, Regex.cs, RegexCompilationInfo.cs, 
581         RegexOptions.cs: ... these.  Now every publicly exposed type in
582         this namespace has its own file.
583
584 2005-07-21  Florian Gross  <flgr@ccan.de>
585
586         * Fixed a bug in category.cs that caused ECMAScript \d to fail.
587
588 2005-07-13  Raja R Harinath  <rharinath@novell.com>
589
590         Make even more lazier.
591         * MatchCollection.cs (TryToGet): Don't generate match i+1 when
592         we're looking for match i.  Change post-conditions.
593         (FullList): New helper property.  Ensures the list is fully populated.
594         (Count, CopyTo): Use it.
595         (Enumerator.Current): Update to new post-conditions of TryToGet.
596         (Enumerator.MoveNext): Likewise.  Don't modify index if we're
597         beyond the end.
598
599 2005-07-08  Raja R Harinath  <rharinath@novell.com>
600
601         * MatchCollection.cs: Convert to incremental mode.
602         * regex.cs (Regex.Matches): Update.  Pass responsibility of
603         generating all matches to MatchCollection.
604
605 2005-06-14  Raja R Harinath  <harinath@gmail.com>
606
607         * parser.cs (Parser.ConsumeWhitespace): Add bounds check.
608
609         Fix #74753.
610         * Match.cs (Match) [zero-argument variant]: Make private.
611         * GroupCollection (Item) [string variant]: Don't look for the
612         group number in an empty match.
613
614 2005-06-10  Raja R Harinath  <rharinath@novell.com>
615
616         * interpreter.cs (Interpreter.GenerateMatch): Avoid allocating two
617         intermediate arrays to build the final result.
618         (Interpreter.GetGroupInfo, Interpreter.PopulateGroup): New helper
619         functions.
620         * CaptureCollection.cs (list): Change from ArrayList to list.
621         (SetValue): New internal helper, used by Interpreter.PopulateGroup.
622         (Enumerator): Remove helper class.
623         (IEnumerator.GetEnumerator): Just use list.GetEnumerator.
624         * GroupCollection.cs: Likewise.
625         * Group.cs (Group): Move responsibility of populating 'Captures'
626         to Interpreter.PopulateGroup.
627         * Match.cs (Match): Move responsibility of populating 'Groups' to
628         Interpreter.GenerateMatch.
629
630 2005-05-25  Raja R Harinath  <rharinath@novell.com>
631
632         * replace.cs (ReplacementEvaluator.Compile): Rewrite to avoid
633         creating several intermediate strings.  Simplify internal
634         intermediate representation.
635         (ReplacementEvaluator.EvaluateAppend): New.  Version of Evaluate
636         that builds the result directly on a passed-in StringBuilder.
637         (ReplacementEvaluator.Evaluate): Just a wrapper around
638         EvaluateAppend.
639         * regex.cs (MatchAppendEvaluator): New internal delegate.
640         (Regex.Replace): Use MatchAppendEvaluator.
641         (Regex.Adapter): New class used to adapt a MatchEvaluator to a
642         MatchAppendEvaluator.
643
644 2005-05-24  Raja R Harinath  <rharinath@novell.com>
645
646         * replace.cs (ReplacementEvaluator.CompileTerm): Fix group
647         returned by $+.
648
649 2005-05-20  Ben Maurer  <bmaurer@ximian.com>
650
651         * regex.cs: Some memory allocation optimizations.
652
653 2005-05-20  Raja R Harinath  <rharinath@novell.com>
654
655         Fix #74735.
656         * replace.cs (ReplacementEvaluator.Compile): Allow CompileTerm to
657         fail and yet have advanced the pointer.  Append the scanned-over
658         portion to the "literal" being built.
659         (ReplacementEvaluator.CompileTerm): Don't throw any exceptions.
660         If a term cannot be recognized, just return null.
661
662         * compiler.cs (InterpreterFactory.GroupCount): Fix.  The 0'th
663         index corresponds to Opcode.Info.
664
665         * parser.cs (Parser.Unescape): If the string doesn't contain any
666         '\' character, don't allocate a new string.
667
668         * replace.cs (ReplacementEvalutator.Term.AppendResult): Rename
669         from GetResult.  Append to a passed-in StringBuilder rather than
670         return a string.
671         (ReplacementEvaluator.Evaluate): Update.
672         
673         * Capture.cs, Group.cs, Match.cs: New files split out of ...
674         * match.cs: ... this.  Remove.
675
676 2005-02-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
677
678         * parser.cs: stuff inside {} might not be a quantifier. Fixes
679         bug #69193.
680
681 2005-01-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
682
683         * quicksearch.cs: handle IgnoreCase when getting the shift distance.
684         Fixes bug #69065. Patch by mei@work.email.ne.jp.
685
686 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
687
688         * syntax.cs: Applied patch from mei@work.email.ne.jp to fix bug
689         #71077.
690
691         * parser.cs: Turns out that \digit sequences are octal sequences
692         (no leading zero is needed);  And the three octal digit rule
693         applies to the leading zero as well.
694
695         This fixes the Unescape method.
696
697 2004-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
698
699         * regex.cs: use NextMatch to move on to the next match. Fixes bug
700         #57274.
701
702 2004-11-09  Atsushi Enomoto  <atsushi@ximian.com>
703
704         * parser.cs : cast.
705
706 2004-11-08  Ben Maurer  <bmaurer@ximian.com>
707
708         * replace.cs, parser.cs: Use stringbuilder for allocation sanity.
709
710 2004-10-21  Joerg Rosenkranz  <joergr@voelcker.com>
711
712         * regex.cs: Fixed a bug introduced with the last patch which
713         prevented any replacements when a postive count is given.
714         This also happens in all overloads without count parameter.
715
716 2004-10-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
717
718         * regex.cs: in Replace, when count is negative, replacement continues
719         to the end of the string.
720
721         Fixes bug #68398. Patch by Jon Larimer.
722
723 2004-06-10  Gert Driesen <drieseng@users.sourceforge.net>
724
725         * RegexRunner.cs: fixed case mismatch of methods
726
727 2004-06-10  Gert Driesen <drieseng@users.sourceforge.net>
728
729         * RegexRunner.cs: marked TODO, added missing protected internal
730         fields, throw NotImplementedException in all methods
731
732 2004-06-10  Gert Driesen <drieseng@users.sourceforge.net>
733
734         * RegexRunnerFactory.cs: removed comment, no longer throw exception
735         from ctor
736         * regex.cs: fixed public API signature by renaming protected 
737         internal fields and adding destructor, added MonoTODO attribute to
738         fields and method that are not yet implemented, changed not 
739         implemented methods to throw NotImplementedException instead of
740         Exception, fixed names of field that are serialized
741
742 2004-06-06  Jambunathan K <kjambunathan@novell.com>
743         
744         * parser.cs: Fixed issues with Regex.Unescape() identified as part of
745         debugging bug #58256. The original problem reported was about
746         inconsistency between the way we treat replacement patterns and the 
747         way microsoft treats the replacement patterns in Regex.Replace(). MS
748         implementation is buggy and doesn't honour escape sequences in the
749         replacement patterns, even though the SDK claims otherwise.
750
751         
752 2004-06-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
753
754         * syntax.cs: re-applied my patch from 2004-05-27 plus a fix which is
755         emitting a Category.All if both a category and its negated value are
756         present.
757
758 2004-06-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
759
760         * syntax.cs: reverting my previous patch. It causes bigger problems.
761
762 2004-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
763
764         * category.cs: added LastValue field to mark the end of enum Category.
765         * syntax.cs: in CharacterClass, use Category.LastValue to get the size
766         of the array needed. Use a BitArray instead of bool[].
767         In AddCategory(), don't set the opposite category as false. Fixes
768         bug #59150. All tests pass.
769
770 2004-05-25  Jackson Harper  <jackson@ximian.com>
771
772         * parser.cs: Allow creating a regular expression using {,n} as the
773         specified. The min bounds is set to -1, I am not completely sure
774         if that is what it is supposed to be but MS does not set it to 0
775         based on testing. Patch by dave-gnome-bugs@earth.li. Fixes bug #56761.
776
777 2004-05-12  Dick Porter  <dick@ximian.com>
778
779         * regex.cs: 
780         * quicksearch.cs: 
781         * RegexRunnerFactory.cs: 
782         * RegexRunner.cs: More public API difference fixes.
783
784         * GroupCollection.cs: 
785         * MatchCollection.cs: 
786         * CaptureCollection.cs: Moved GroupCollection, MatchCollection and
787         CaptureCollection so that they no longer inherit from the
788         non-standard RegexCollectionBase class.  Fixes the API difference.
789
790 2004-04-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
791
792         * arch.cs:
793         * compiler.cs:
794         * interpreter.cs:
795         * parser.cs:
796         * syntax.cs:
797         Patch by Eric Durand Tremblay.
798         1) Capture inner group when named.
799         2) Resolved parse error caused by not capturing inner group
800         3) Resolved incorrect capture group
801         4) Now, not capturing anything when unnamed ( correct behavior)
802
803
804 2004-04-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
805
806         * arch.cs:
807         * compiler.cs:
808         * interpreter.cs:
809         * parser.cs:
810         * syntax.cs: converted to unix line endings.
811
812 2004-03-30  Lluis Sanchez Gual <lluis@ximian.com>
813
814         * collections.cs: In the indexer, return an empty group if the requested
815         group is not found.
816         * match.cs: Added default constructor for Group.
817         
818 2004-03-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
819
820         * parser.cs: fixed group numbering.
821
822 2004-03-22  Jackson Harper  <jackson@ximian.com>
823
824         * parser.cs: Use the group number as the name in mapping. Patch by
825         Gert Driesen.
826         * regex.cs: Fix off by one error. Patch by Gert Driesen.
827
828 2004-03-17  Francois Beauchemin <beauche@softhome.net>
829         * syntax.cs, interpreter.cs, quicksearch.cs, regex.cs, compiler.cs : 
830                 Revised support for RigthToLeft. 
831                 quicksearch has now an reverse option.          
832                 This fixes bug #54537 
833  
834         * regex.cs, compiler.cs :
835                 Some code to support CILCompiler.               
836         * regex.cs : 
837                 Added some undocumented of MS.
838  
839 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
840
841         * parser.cs: allow a @"\0" escape sequence. Fixes bug #54797.
842
843 2004-02-01  Miguel de Icaza  <miguel@ximian.com>
844
845         * syntax.cs, interval.cs: Applied patch from Marco Cravairo
846         through Francois Beauchemin who reviewed on the mailing list.
847         This fixes bug #45976
848
849 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
850
851         * parser.cs: an opening brace without a
852         quantifier do not cause a parse error. Fixes bug #52924.
853
854 2004-01-07  Lluis Sanchez Gual <lluis@ximian.com>
855
856         * regex.cs: In Split(), if the last match is at the end of the string, 
857         an empty string must be added to the array of results.
858
859 2003-12-15  Sanjay Gupta <gsanjay@novell.com>
860         * match.cs: Check for null value before Substring method call.  
861         Fixes bug #52034.
862
863 2003-11-21  Juraj Skripsky <js@hotfeet.ch>
864
865         * quicksearch.cs: Create and use hashtable only for "long" search 
866         strings. 
867
868         (Search): Use simple scan for a single-character search strings.
869         
870         (GetChar): Simplify case sensitivity handling.
871
872 2003-11-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
873
874         * interpreter.cs: when evaluating a degenerate match, restore the
875         RepeatContext if fail. Fixes bug #42529.
876
877 2003-11-22  Jackson Harper <jackson@ximian.com>
878
879         * regex.cs: Add CultureInvariant flag to RegexOptions.
880         
881 2003-11-20  Juraj Skripsky <js@hotfeet.ch>
882
883         * quicksearch.cs: Use a hashtable instead of an array for the
884         shift table to improve the memory usage.  
885
886 2003-11-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
887
888         * regex.cs:
889         (Split): include capture groups in the results, if any. Fixes bug
890         #51146.
891
892 2003-07-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
893
894         * regex.cs: patch from Eric Lindvall <eric@5stops.com> that fixes bug
895         #44830.
896
897 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
898
899         * category.cs (CategoryUtils.CategoryFromName): Use StartsWith
900         ("Is") instead of a substring for (0,2) which was throwing an
901         exception causing Category.None to be returned
902
903 2003-01-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
904
905         * collections.cs: fixed bug #30091.
906
907 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
908
909         * regex.cs: fixed little mistake (closes #35860).
910
911 2002-11-12 Jackson Harper <jackson@latitudegeo.com>
912
913         * arch.cs compiler.cs regex.cs: Added mapping attribute to MachineFactories
914
915 2002-11-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
916
917         * parser.cs: detect illegal \ at end of pattern. Fixes 31334.
918
919 2002-10-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
920
921         * parser.cs: applied fix from Tim Haynes (thaynes@openlinksw.com) to
922         solve bug #32807. Also modified GetMapping to return the same as MS.
923
924 2002-08-28  Juli Mallett  <jmallett@FreeBSD.org>
925
926         * arch.cs, compiler.cs: Give the interpreter machine a property
927         for the retrieval of the group count.
928
929         * regex.cs: Use the new GroupCount property of the factory to
930         initialise the current group count, and restructure code to compile
931         the pattern only the first time it is needed (essentially backing
932         out the previous revision of regex.cs, to use the new code.)
933
934 2002-08-14  Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
935
936         * regex.cs: Added the ctr for ISerializable implementation and
937         implemented the GetObjectData function.
938
939 2002-07-30  Juli Mallett  <jmallett@FreeBSD.org>
940
941         * regex.cs: Fixed bug where the expression would not be
942         re-evaluated for grouping purposes when factory caches were
943         used, resulting in no groups being recognised after one call
944         with a given pattern and no change in options.
945
946 2002-05-13  Dan Lewis  <dihlewis@yahoo.co.uk>
947
948         * regex.cs: Fixed bug in split.
949
950 2002-05-08  Dan Lewis  <dihlewis@yahoo.co.uk>
951
952         * interpreter.cs: Moved to an array-based stack representation
953         for faster captures.
954
955         * match.cs, collections.cs: Decoupled capture representation from
956         interpreter internals.
957
958         * cache.cs: Changed Key type from struct to class for speed.
959
960 2002-04-06  Dan Lewis  <dihlewis@yahoo.co.uk>
961
962         * cache.cs: Object methods should be overridden with "override".
963
964 2002-04-04  Dan Lewis  <dihlewis@yahoo.co.uk>
965
966         * RegexRunner.cs, RegexRunnerFactory.cs: MS support classes. Stubs
967         added for completeness.
968
969         * regex.cs, match.cs, collections.cs: Serializable attribute.
970
971 2002-04-04  Dan Lewis  <dihlewis@yahoo.co.uk>
972
973         * regex.cs: Added static Matches and IsMatch methods.
974
975 2002-04-03  Dan Lewis  <dihlewis@yahoo.co.uk>
976
977         * ChangeLog: Added changelog.
978
979         * cache.cs: Fixed bug in MRUList.Evict.