New test.
[mono.git] / mcs / class / System / System.Text.RegularExpressions / ChangeLog
1 2006-09-28  Andrew Skiba  <andrews@mainsoft.com>
2
3         * Regex.cs: TARGET_JVM
4
5 2006-05-30  Gert Driesen  <drieseng@users.sourceforge.net>
6
7         * CaptureCollection.cs: Removed virtual keyword to fix API mismatches.
8         * MatchCollection.cs: Removed virtual keyword to fix API mismatches.
9         * GroupCollection.cs: Removed virtual keyword to fix API mismatches.
10
11 2006-05-08  Raja R Harinath  <rharinath@novell.com>
12
13         Fix #78278
14         Remove 65535-limit on number of repetitions matched by a pattern.
15         We still have a 65535 limit on the length of a pattern and the
16         number of groups in a pattern.
17         * compiler.cs (PatternCompiler.EmitCount): New.  Emits an int as
18         two ushorts into the program stream.
19         (EmitInfo, EmitRepeat, EmitFastRepeat): Use it to emit integers
20         rather than shorts.
21         * interpreter.cs (Intepreter.ReadProgramCount): Read an int
22         emitted into the program stream.
23         (Interpreter): Use it.  Update counts.
24         (Interpreter.Eval) [OpCode.Repeat, OpCode.FastRepeat]: Likewise.
25         * parser.cs (ParseGroup): Pass 0x7ffffff as the max value for '*'
26         and '+' repetition patterns.
27         * arch.cs (Info, Repeat, FastRepeat): Update description.
28
29 2006-04-18  Raja R Harinath  <rharinath@novell.com>
30
31         Treat fixed repetitions of simple regexes as simple too.
32         * syntax.cs (Expression.IsComplex): Make abstract.
33         (Group.IsComplex, Alternation.IsComplex): Move ...
34         (CompositeExpression.IsComplex): ... here.
35         (Group.GetAnchorInfo): Reduce allocations.  Avoid creating another
36         ArrayList, and use a StringBuilder to build up the string.
37         (Repetition.GetAnchorInfo): Use a StringBuilder to build up the string.
38         (ExpressionAssertion.IsComplex): Override.
39
40 2006-04-17  Florian Gross  <flgr@ccan.de>
41             Raja R Harinath  <rharinath@novell.com>
42
43         * syntax.cs (CharacterClass.Compile): Emit categories after the
44         character intervals so that the evaluator can pick up the
45         'IgnoreCase' flag.
46
47 2006-04-07  Raja R Harinath  <rharinath@novell.com>
48
49         Fix #78007
50         * interpreter.cs (Interpreter.Eval) [Anchor, Position.StartOfString]:
51         Don't reset 'ptr' to 0 during forward scan.
52
53         Fix #76345
54         * interpreter.cs (Interpreter.FastEval) [FastRepeat]: If the first
55         tail operation has a 'negate' flag, avoid the "match next char"
56         optimization.
57
58         Fix #69269
59         * arch.cs (OpCode.NotCategory): New.  Stands for matching a
60         character _not_ from the given category.
61         * debug.cs (DisassembleBlock): Handle it.
62         * compiler.cs (ICompiler.EmitNotCategory): New.
63         (Compiler.EmitNotCategory): New.  Emit OpCode.NotCategory.
64         * syntax.cs (CharacterClass.Compile): Don't conflate negation of
65         the character class and negation of the category.  Use
66         EmitNotCategory.
67         * interpreter.cs (Interpreter.Eval): Pass OpCode.NotCategory to
68         EvalChar.
69         (Interpreter.EvalChar): Handle it.
70
71 2006-04-06  Raja R Harinath  <rharinath@novell.com>
72
73         Fix #77487
74         * interpreter.cs (Eval) [Until, FastUntil]: Set 'deep' to null
75         when evaluating the tail.  Ensure that backtracks don't confuse
76         the recursion vs. iteration detector.
77
78 2006-04-03  Raja R Harinath  <rharinath@novell.com>
79
80         * interpreter.cs (Eval) [Until, lazy]: Avoid extra evaluation on a
81         degenerate match.
82
83 2006-03-30  Raja R Harinath  <harinath@gmail.com>
84
85         Fix #77626
86         * parser.cs (Parser.ParseCharacterClass): Don't automatically
87         assume there's a range when we see '-'.  Ensure that we have seen
88         at least one other character, and that we aren't already parsing a
89         range.  Handle some more errors.
90
91 2005-12-19  Kornél Pál  <kornelpal@hotmail.com>
92
93         * Regex.cs: Added support for regular expressions compiled to
94           assemblies by compiling the pattern. This solution ignores existing
95           CIL code but provides full support for regular expression classes
96           compiled by MS.NET.
97
98 2005-11-21  Sebastien Pouliot  <sebastien@ximian.com> 
99
100         * CaptureCollection.cs: Fixed length check.
101         * Group.cs: Added missing validation for Synchronized method.
102         * Match.cs: Added missing validation for Synchronized and Result 
103         methods.
104         * MatchEvaluator.cs: Added [Serializable] for 2.0 profile.
105         * RegexCompilationInfo.cs: Added missing property validation.
106         * Regex.cs: Implemented UseOptionC and UseOptionR protected methods
107         (now documented). Fixed API for 2.0 profile.
108         * RegexRunner.cs: Stubbed CharInClass for 2.0 profile.
109
110 2005-11-17  Sebastien Pouliot  <sebastien@ximian.com> 
111  
112         * Match.cs: Removed the ": base ()" on the private ctor as it is
113         unrequired and cause an extra public ctor to added (bug #76736).
114         * MatchCollection.cs: Add missing virtual to indexer property.
115
116 2005-09-23  Raja R Harinath  <rharinath@novell.com>
117
118         * interpreter.cs (Interpreter.Eval) [OpCode.Until]: Invert the
119         sense of a test to reflect the code re-organization.
120
121 2005-09-22  Raja R Harinath  <rharinath@novell.com>
122
123         Fix #72152, #72989.
124         * interpreter.cs (Interpreter.Eval) [OpCode.Until]: Avoid some
125         cases of recursion when dealing with eager quantifiers too.  We
126         now avoid recursion when handling the innermost quantifier.
127         (Interpreter.IntStack, Interpreter.stack): New.  Stack to help
128         implement backtracking in eager quantifiers.
129
130 2005-09-21  Raja R Harinath  <rharinath@novell.com>
131
132         * interpreter.cs (Interpreter.Eval) [OpCode.Until]: Avoid some
133         cases of recursion when dealing with the minimum count and lazy
134         quantifiers.
135
136 2005-08-23  Raja R Harinath  <rharinath@novell.com>
137
138         * regex.cs: Remove.  Split into ...
139         * MatchEvaluator.cs, Regex.cs, RegexCompilationInfo.cs, 
140         RegexOptions.cs: ... these.  Now every publicly exposed type in
141         this namespace has its own file.
142
143 2005-07-21  Florian Gross  <flgr@ccan.de>
144
145         * Fixed a bug in category.cs that caused ECMAScript \d to fail.
146
147 2005-07-13  Raja R Harinath  <rharinath@novell.com>
148
149         Make even more lazier.
150         * MatchCollection.cs (TryToGet): Don't generate match i+1 when
151         we're looking for match i.  Change post-conditions.
152         (FullList): New helper property.  Ensures the list is fully populated.
153         (Count, CopyTo): Use it.
154         (Enumerator.Current): Update to new post-conditions of TryToGet.
155         (Enumerator.MoveNext): Likewise.  Don't modify index if we're
156         beyond the end.
157
158 2005-07-08  Raja R Harinath  <rharinath@novell.com>
159
160         * MatchCollection.cs: Convert to incremental mode.
161         * regex.cs (Regex.Matches): Update.  Pass responsibility of
162         generating all matches to MatchCollection.
163
164 2005-06-14  Raja R Harinath  <harinath@gmail.com>
165
166         * parser.cs (Parser.ConsumeWhitespace): Add bounds check.
167
168         Fix #74753.
169         * Match.cs (Match) [zero-argument variant]: Make private.
170         * GroupCollection (Item) [string variant]: Don't look for the
171         group number in an empty match.
172
173 2005-06-10  Raja R Harinath  <rharinath@novell.com>
174
175         * interpreter.cs (Interpreter.GenerateMatch): Avoid allocating two
176         intermediate arrays to build the final result.
177         (Interpreter.GetGroupInfo, Interpreter.PopulateGroup): New helper
178         functions.
179         * CaptureCollection.cs (list): Change from ArrayList to list.
180         (SetValue): New internal helper, used by Interpreter.PopulateGroup.
181         (Enumerator): Remove helper class.
182         (IEnumerator.GetEnumerator): Just use list.GetEnumerator.
183         * GroupCollection.cs: Likewise.
184         * Group.cs (Group): Move responsibility of populating 'Captures'
185         to Interpreter.PopulateGroup.
186         * Match.cs (Match): Move responsibility of populating 'Groups' to
187         Interpreter.GenerateMatch.
188
189 2005-05-25  Raja R Harinath  <rharinath@novell.com>
190
191         * replace.cs (ReplacementEvaluator.Compile): Rewrite to avoid
192         creating several intermediate strings.  Simplify internal
193         intermediate representation.
194         (ReplacementEvaluator.EvaluateAppend): New.  Version of Evaluate
195         that builds the result directly on a passed-in StringBuilder.
196         (ReplacementEvaluator.Evaluate): Just a wrapper around
197         EvaluateAppend.
198         * regex.cs (MatchAppendEvaluator): New internal delegate.
199         (Regex.Replace): Use MatchAppendEvaluator.
200         (Regex.Adapter): New class used to adapt a MatchEvaluator to a
201         MatchAppendEvaluator.
202
203 2005-05-24  Raja R Harinath  <rharinath@novell.com>
204
205         * replace.cs (ReplacementEvaluator.CompileTerm): Fix group
206         returned by $+.
207
208 2005-05-20  Ben Maurer  <bmaurer@ximian.com>
209
210         * regex.cs: Some memory allocation optimizations.
211
212 2005-05-20  Raja R Harinath  <rharinath@novell.com>
213
214         Fix #74735.
215         * replace.cs (ReplacementEvaluator.Compile): Allow CompileTerm to
216         fail and yet have advanced the pointer.  Append the scanned-over
217         portion to the "literal" being built.
218         (ReplacementEvaluator.CompileTerm): Don't throw any exceptions.
219         If a term cannot be recognized, just return null.
220
221         * compiler.cs (InterpreterFactory.GroupCount): Fix.  The 0'th
222         index corresponds to Opcode.Info.
223
224         * parser.cs (Parser.Unescape): If the string doesn't contain any
225         '\' character, don't allocate a new string.
226
227         * replace.cs (ReplacementEvalutator.Term.AppendResult): Rename
228         from GetResult.  Append to a passed-in StringBuilder rather than
229         return a string.
230         (ReplacementEvaluator.Evaluate): Update.
231         
232         * Capture.cs, Group.cs, Match.cs: New files split out of ...
233         * match.cs: ... this.  Remove.
234
235 2005-02-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
236
237         * parser.cs: stuff inside {} might not be a quantifier. Fixes
238         bug #69193.
239
240 2005-01-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
241
242         * quicksearch.cs: handle IgnoreCase when getting the shift distance.
243         Fixes bug #69065. Patch by mei@work.email.ne.jp.
244
245 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
246
247         * syntax.cs: Applied patch from mei@work.email.ne.jp to fix bug
248         #71077.
249
250         * parser.cs: Turns out that \digit sequences are octal sequences
251         (no leading zero is needed);  And the three octal digit rule
252         applies to the leading zero as well.
253
254         This fixes the Unescape method.
255
256 2004-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
257
258         * regex.cs: use NextMatch to move on to the next match. Fixes bug
259         #57274.
260
261 2004-11-09  Atsushi Enomoto  <atsushi@ximian.com>
262
263         * parser.cs : cast.
264
265 2004-11-08  Ben Maurer  <bmaurer@ximian.com>
266
267         * replace.cs, parser.cs: Use stringbuilder for allocation sanity.
268
269 2004-10-21  Joerg Rosenkranz  <joergr@voelcker.com>
270
271         * regex.cs: Fixed a bug introduced with the last patch which
272         prevented any replacements when a postive count is given.
273         This also happens in all overloads without count parameter.
274
275 2004-10-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
276
277         * regex.cs: in Replace, when count is negative, replacement continues
278         to the end of the string.
279
280         Fixes bug #68398. Patch by Jon Larimer.
281
282 2004-06-10  Gert Driesen <drieseng@users.sourceforge.net>
283
284         * RegexRunner.cs: fixed case mismatch of methods
285
286 2004-06-10  Gert Driesen <drieseng@users.sourceforge.net>
287
288         * RegexRunner.cs: marked TODO, added missing protected internal
289         fields, throw NotImplementedException in all methods
290
291 2004-06-10  Gert Driesen <drieseng@users.sourceforge.net>
292
293         * RegexRunnerFactory.cs: removed comment, no longer throw exception
294         from ctor
295         * regex.cs: fixed public API signature by renaming protected 
296         internal fields and adding destructor, added MonoTODO attribute to
297         fields and method that are not yet implemented, changed not 
298         implemented methods to throw NotImplementedException instead of
299         Exception, fixed names of field that are serialized
300
301 2004-06-06  Jambunathan K <kjambunathan@novell.com>
302         
303         * parser.cs: Fixed issues with Regex.Unescape() identified as part of
304         debugging bug #58256. The original problem reported was about
305         inconsistency between the way we treat replacement patterns and the 
306         way microsoft treats the replacement patterns in Regex.Replace(). MS
307         implementation is buggy and doesn't honour escape sequences in the
308         replacement patterns, even though the SDK claims otherwise.
309
310         
311 2004-06-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
312
313         * syntax.cs: re-applied my patch from 2004-05-27 plus a fix which is
314         emitting a Category.All if both a category and its negated value are
315         present.
316
317 2004-06-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
318
319         * syntax.cs: reverting my previous patch. It causes bigger problems.
320
321 2004-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
322
323         * category.cs: added LastValue field to mark the end of enum Category.
324         * syntax.cs: in CharacterClass, use Category.LastValue to get the size
325         of the array needed. Use a BitArray instead of bool[].
326         In AddCategory(), don't set the opposite category as false. Fixes
327         bug #59150. All tests pass.
328
329 2004-05-25  Jackson Harper  <jackson@ximian.com>
330
331         * parser.cs: Allow creating a regular expression using {,n} as the
332         specified. The min bounds is set to -1, I am not completely sure
333         if that is what it is supposed to be but MS does not set it to 0
334         based on testing. Patch by dave-gnome-bugs@earth.li. Fixes bug #56761.
335
336 2004-05-12  Dick Porter  <dick@ximian.com>
337
338         * regex.cs: 
339         * quicksearch.cs: 
340         * RegexRunnerFactory.cs: 
341         * RegexRunner.cs: More public API difference fixes.
342
343         * GroupCollection.cs: 
344         * MatchCollection.cs: 
345         * CaptureCollection.cs: Moved GroupCollection, MatchCollection and
346         CaptureCollection so that they no longer inherit from the
347         non-standard RegexCollectionBase class.  Fixes the API difference.
348
349 2004-04-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
350
351         * arch.cs:
352         * compiler.cs:
353         * interpreter.cs:
354         * parser.cs:
355         * syntax.cs:
356         Patch by Eric Durand Tremblay.
357         1) Capture inner group when named.
358         2) Resolved parse error caused by not capturing inner group
359         3) Resolved incorrect capture group
360         4) Now, not capturing anything when unnamed ( correct behavior)
361
362
363 2004-04-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
364
365         * arch.cs:
366         * compiler.cs:
367         * interpreter.cs:
368         * parser.cs:
369         * syntax.cs: converted to unix line endings.
370
371 2004-03-30  Lluis Sanchez Gual <lluis@ximian.com>
372
373         * collections.cs: In the indexer, return an empty group if the requested
374         group is not found.
375         * match.cs: Added default constructor for Group.
376         
377 2004-03-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
378
379         * parser.cs: fixed group numbering.
380
381 2004-03-22  Jackson Harper  <jackson@ximian.com>
382
383         * parser.cs: Use the group number as the name in mapping. Patch by
384         Gert Driesen.
385         * regex.cs: Fix off by one error. Patch by Gert Driesen.
386
387 2004-03-17  Francois Beauchemin <beauche@softhome.net>
388         * syntax.cs, interpreter.cs, quicksearch.cs, regex.cs, compiler.cs : 
389                 Revised support for RigthToLeft. 
390                 quicksearch has now an reverse option.          
391                 This fixes bug #54537 
392  
393         * regex.cs, compiler.cs :
394                 Some code to support CILCompiler.               
395         * regex.cs : 
396                 Added some undocumented of MS.
397  
398 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
399
400         * parser.cs: allow a @"\0" escape sequence. Fixes bug #54797.
401
402 2004-02-01  Miguel de Icaza  <miguel@ximian.com>
403
404         * syntax.cs, interval.cs: Applied patch from Marco Cravairo
405         through Francois Beauchemin who reviewed on the mailing list.
406         This fixes bug #45976
407
408 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
409
410         * parser.cs: an opening brace without a
411         quantifier do not cause a parse error. Fixes bug #52924.
412
413 2004-01-07  Lluis Sanchez Gual <lluis@ximian.com>
414
415         * regex.cs: In Split(), if the last match is at the end of the string, 
416         an empty string must be added to the array of results.
417
418 2003-12-15  Sanjay Gupta <gsanjay@novell.com>
419         * match.cs: Check for null value before Substring method call.  
420         Fixes bug #52034.
421
422 2003-11-21  Juraj Skripsky <js@hotfeet.ch>
423
424         * quicksearch.cs: Create and use hashtable only for "long" search 
425         strings. 
426
427         (Search): Use simple scan for a single-character search strings.
428         
429         (GetChar): Simplify case sensitivity handling.
430
431 2003-11-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
432
433         * interpreter.cs: when evaluating a degenerate match, restore the
434         RepeatContext if fail. Fixes bug #42529.
435
436 2003-11-22  Jackson Harper <jackson@ximian.com>
437
438         * regex.cs: Add CultureInvariant flag to RegexOptions.
439         
440 2003-11-20  Juraj Skripsky <js@hotfeet.ch>
441
442         * quicksearch.cs: Use a hashtable instead of an array for the
443         shift table to improve the memory usage.  
444
445 2003-11-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
446
447         * regex.cs:
448         (Split): include capture groups in the results, if any. Fixes bug
449         #51146.
450
451 2003-07-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
452
453         * regex.cs: patch from Eric Lindvall <eric@5stops.com> that fixes bug
454         #44830.
455
456 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
457
458         * category.cs (CategoryUtils.CategoryFromName): Use StartsWith
459         ("Is") instead of a substring for (0,2) which was throwing an
460         exception causing Category.None to be returned
461
462 2003-01-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
463
464         * collections.cs: fixed bug #30091.
465
466 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
467
468         * regex.cs: fixed little mistake (closes #35860).
469
470 2002-11-12 Jackson Harper <jackson@latitudegeo.com>
471
472         * arch.cs compiler.cs regex.cs: Added mapping attribute to MachineFactories
473
474 2002-11-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
475
476         * parser.cs: detect illegal \ at end of pattern. Fixes 31334.
477
478 2002-10-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
479
480         * parser.cs: applied fix from Tim Haynes (thaynes@openlinksw.com) to
481         solve bug #32807. Also modified GetMapping to return the same as MS.
482
483 2002-08-28  Juli Mallett  <jmallett@FreeBSD.org>
484
485         * arch.cs, compiler.cs: Give the interpreter machine a property
486         for the retrieval of the group count.
487
488         * regex.cs: Use the new GroupCount property of the factory to
489         initialise the current group count, and restructure code to compile
490         the pattern only the first time it is needed (essentially backing
491         out the previous revision of regex.cs, to use the new code.)
492
493 2002-08-14  Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
494
495         * regex.cs: Added the ctr for ISerializable implementation and
496         implemented the GetObjectData function.
497
498 2002-07-30  Juli Mallett  <jmallett@FreeBSD.org>
499
500         * regex.cs: Fixed bug where the expression would not be
501         re-evaluated for grouping purposes when factory caches were
502         used, resulting in no groups being recognised after one call
503         with a given pattern and no change in options.
504
505 2002-05-13  Dan Lewis  <dihlewis@yahoo.co.uk>
506
507         * regex.cs: Fixed bug in split.
508
509 2002-05-08  Dan Lewis  <dihlewis@yahoo.co.uk>
510
511         * interpreter.cs: Moved to an array-based stack representation
512         for faster captures.
513
514         * match.cs, collections.cs: Decoupled capture representation from
515         interpreter internals.
516
517         * cache.cs: Changed Key type from struct to class for speed.
518
519 2002-04-06  Dan Lewis  <dihlewis@yahoo.co.uk>
520
521         * cache.cs: Object methods should be overridden with "override".
522
523 2002-04-04  Dan Lewis  <dihlewis@yahoo.co.uk>
524
525         * RegexRunner.cs, RegexRunnerFactory.cs: MS support classes. Stubs
526         added for completeness.
527
528         * regex.cs, match.cs, collections.cs: Serializable attribute.
529
530 2002-04-04  Dan Lewis  <dihlewis@yahoo.co.uk>
531
532         * regex.cs: Added static Matches and IsMatch methods.
533
534 2002-04-03  Dan Lewis  <dihlewis@yahoo.co.uk>
535
536         * ChangeLog: Added changelog.
537
538         * cache.cs: Fixed bug in MRUList.Evict.