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