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