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