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