1 2009-08-19 Raja R Harinath <harinath@hurrynot.org>
3 * Regex.cs (group_numbers): New.
4 (GetGroupNumbers): Move array initialization ...
5 (GroupNumbers): ... to new on-demand initializer.
7 2009-08-19 Raja R Harinath <harinath@hurrynot.org>
9 * Regex.cs (group_names): Rename from _groupNumbersToNameMap.
10 (GetGroupNamesArray): Use an IDictionaryEnumerator to walk the
11 mapping, since both the key and value are used in the loop.
13 2009-08-19 Raja R Harinath <harinath@hurrynot.org>
15 Introduce 'gap' concept into all the variants of regex
16 * arch.cs (IMachineFactory::Gap): New property.
17 * compiler.cs (InterpreterFactory): Update to changes.
18 * RxCompiler.cs (RxInterpreterFactory): Likewise.
19 * JvmReMachineFactory.cs: Likewise.
20 * parser.cs (GetMapping): Return the 'gap' index. Move creation
21 of mapping dictionary ...
22 * Regex.cs (CreateMachineFactory): ... here. Update to changes.
24 2009-08-18 Raja R Harinath <harinath@hurrynot.org>
26 Distinguish between the internal index of a group and group number.
27 * Regex.cs (GetGroupIndex): New.
28 (GroupNameFromNumber): Use it.
29 * GroupCollection.cs (.ctor): Introduce 'gap' argument. It is the
30 index of the first group whose group number differs from its index.
33 2009-08-18 Raja R Harinath <harinath@hurrynot.org>
35 * parser.cs (GetMapping): Extend duplicate check for numeric
38 2009-08-17 Raja R Harinath <harinath@hurrynot.org>
40 * parser.cs (ResolveReferences): Handle some cases of
41 explicitly-named numeric groups.
43 2009-08-17 Raja R Harinath <harinath@hurrynot.org>
45 * parser.cs (ResolveReferences): Rearrange slightly to prepare for
48 2009-08-17 Raja R Harinath <harinath@hurrynot.org>
50 * Regex.cs (GetGroupNumbers): List group numbers in ascending order.
51 (GetGroupNames): List names in order of group number.
53 2009-08-12 Raja R Harinath <harinath@hurrynot.org>
55 * syntax.cs (BackslashNumber.ResolveReference): Improve ECMAScript
56 semantics. Handle cases like "group 43 exists but group 4 doesn't".
58 2009-08-10 Raja R Harinath <harinath@hurrynot.org>
60 * syntax.cs (BackslashNumber.ResolveReference): Implement fallback
61 to octal numbers, and ECMAScript semantics.
62 * parser.cs (ResolveReferences): Use it.
64 2009-08-10 Raja R Harinath <harinath@hurrynot.org>
66 * syntax.cs (BackslashNumber): New class.
67 * parser.cs (ParseSpecial): Create it instead of 'Reference' if a
68 numeric backreference is seen.
70 2009-08-10 Raja R Harinath <harinath@hurrynot.org>
72 * parser.cs (ResolveReferences): Allow named groups to be
73 referred-to by their group numbers too.
75 2009-04-23 Sebastien Pouliot <sebastien@ximian.com>
77 * Regex.cs: Remove Compiler-related support for NET_2_1
78 * RegexOptions.cs: Remove Compile from values available on NET_2_1
80 2009-03-04 Zoltan Varga <vargaz@gmail.com>
82 * RxInterpreter.cs (ResetGroups): Avoid allocating larger than needed
85 2009-02-27 Jonathan Pryor <jpryor@novell.com>
87 * Regex.cs (Replace): Check that input & evaluator are not null, as
88 documented in MSDN (and the variance found while testing DbLinq).
90 2009-02-27 Zoltan Varga <vargaz@gmail.com>
92 * BaseMachine.cs (LTRReplace): Initialize the StringBuilder with an
93 appropriate initial length.
95 2009-02-24 Zoltan Varga <vargaz@gmail.com>
97 * CILCompiler.cs: Partially inline calls to Char.ToLower () to speed
98 up ignorecase matching.
100 2009-02-16 Jb Evain <jbevain@novell.com>
102 * Regex.cs: on the NET_2_1 profile, always use the old engine for now.
104 2009-02-14 Zoltan Varga <vargaz@gmail.com>
106 * Regex.cs: Add a MONO_NEW_RX variable to enable the new regex
109 2009-02-04 Zoltan Varga <vargaz@gmail.com>
111 * Regex.cs: Disable the new regex engine for now.
113 2009-01-14 Zoltan Varga <vargaz@gmail.com>
115 * CILCompiler.cs: Avoid throwing exceptions for a few more unhandled opcodes.
116 Implement the reverse/ignorecase versions of Reference. Fix the reverse
117 version of Bitmap. Error out if a Jump opcode jumps outside the current
118 pc range. This works around #466151.
120 2009-01-12 Jb Evain <jbevain@novell.com>
122 * RxInterpreter.cs: set trace_rx to false for NET_2_1.
123 * Regex.cs: set old_rx to false for NET_2_1.
125 2009-01-07 Zoltan Varga <vargaz@gmail.com>
127 * RxInterpreter.cs: Add support for constant strings in anchors. Fixes
130 2008-11-18 Gonzalo Paniagua Javier <gonzalo@novell.com>
132 * cache.cs: avoid infinite loop.
134 2008-11-14 Gonzalo Paniagua Javier <gonzalo@novell.com>
137 * Regex.cs: honor CacheSize value.
139 2008-11-13 Zoltan Varga <vargaz@gmail.com>
141 * RxInterpreter.cs: Fix pc computation in various opcodes. Fixes #443841.
143 2008-11-11 Zoltan Varga <vargaz@gmail.com>
145 * CILCompiler.cs: Implement Reference opcode.
147 2008-10-30 Zoltan Varga <vargaz@gmail.com>
149 * CILCompiler.cs: Implement SubExpression opcode.
151 * CILCompiler.cs: Save and restore strpos in the Test opcode. Fixes
154 2008-10-25 Zoltan Varga <vargaz@gmail.com>
156 * CILCompiler.cs: Implement Test opcode.
158 2008-10-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
160 * RxInterpreter.cs: implement missing Unicode* opcodes and
161 StringReverseIgnoreCase.
163 2008-10-25 Zoltan Varga <vargaz@gmail.com>
165 * RxOp.cs: Remove unused Generic opcodes.
167 * RxCompiler.cs: Emit opcodes with flags using methods which can be
168 overriden by CILCompiler.cs, so we only have to override a few methods.
170 * CILCompiler.cs: Simplify based on the RxCompiler changes. Implement
171 UnicodeString opcode. Throw a NotImplementedException when an unsupported
172 opcode is encountered, since the IL compiler is now believed to be feature
175 2008-10-24 Zoltan Varga <vargaz@gmail.com>
177 * RxInterpreter.cs CILCompiler.cs gen-interp.cs: Fix the reading of short
178 values from the instruction stream.
180 * RxOp.cs: Add some missing unicode opcodes.
182 * gen-interp.cs RxInterpreter.cs: Generate Bitmap/UnicodeBitmap opcodes too.
184 * CILCompiler.cs (EmitEvalMethodBody): Add an 'end_pc' argument to mark the
185 end of the bytecode range which needs to be compiled. Use it to avoid
186 compiling the same bytecode multiple times in various opcodes. Fix
187 RxOp.Jump implementation. Add implementation for unicode opcodes.
189 2008-10-09 Zoltan Varga <vargaz@gmail.com>
191 * CILCompiler.cs: Implement NoBitmap/NoBitmapIgnoreCase. Fixes #432172.
193 2008-09-14 Zoltan Varga <vargaz@gmail.com>
195 * gen-interp.cs: New file to generate the all variants of the character
196 checking opcodes in RxInterpreter.cs.
198 * RxInterpreter.cs: Replace hand written code with code generated by
201 * RxInterpreter.cs: Fix the failure case of the No<XXX> opcodes. Fixes
204 2008-09-13 Zoltan Varga <vargaz@gmail.com>
206 * RxInterpreter.cs RxCompiler.cs: Implement some missing Category opcodes.
208 2008-09-07 Zoltan Varga <vargaz@gmail.com>
210 * CILCompiler.cs: Override ICompiler.EmitSet too so we set op_flags for
211 Bitmap opcodes too. Fixes #424073.
213 2008-09-06 Zoltan Varga <vargaz@gmail.com>
215 * Regex.cs: Make the new regex interpreter+compiler the default.
217 2008-08-31 Zoltan Varga <vargaz@gmail.com>
219 * RxInterpreter.cs: Port the Anchor+StartOfString optimization from the old
220 interpreter. Add credits.
222 * RxCompiler.cs (EmitString): Lowercase the string if ignore is true.
224 * CILCompiler.cs: Fix the setting of the match position in the
225 anchor+char optimization.
227 * CILCompiler.cs: Implement FastRepeatLazy.
229 * CILCompiler.cs: Get rid of commented out code. Also get rid of
230 frame.local_strpos_res, since the generated code already set Arg1 to
233 2008-08-30 Zoltan Varga <vargaz@gmail.com>
235 * CILCompiler.cs: Initialize all mi_ variables lazily.
237 * CILCompiler.cs: Implement FastRepeat.
239 * RxInterpreter.cs: Add back SetStartOfMatch, make it protected so as to
242 * CILCompiler.cs RxOp.cs: Merge lots of changes from RxInterpreter.cs,
245 2008-08-29 Zoltan Varga <vargaz@gmail.com>
247 * RxInterpreter.cs RxCompiler.cs RxOp.cs: Implement/fix this so all the
248 regex tests now run. The Repeat code is taken from the old interpreter.
250 2008-08-28 Zoltan Varga <vargaz@gmail.com>
252 * RxInterpreter.cs RxCompiler.cs RxOp.cs: Add support for
253 Category.AnySingleline.
255 2008-08-27 Zoltan Varga <vargaz@gmail.com>
257 * RxCompiler.cs: Use Array.Copy since Buffer.BlockCopy operates on bytes.
259 2008-07-31 Jb Evain <jbevain@novell.com>
261 * BaseMachine.cs: clean up for NET_2_1.
263 2008-06-05 Roei Erez <roeie@mainsoft.com>
265 * JvmReMachine.jvm.cs: Fix a bug in match that contains
266 empty group at the end.
268 2008-04-13 Jb Evain <jbevain@novell.com>
270 * Regex.cs: update undocumented fields for the 2.1 profile.
271 Merged from the Moonlight 2 branch.
273 2008-02-26 Zoltan Varga <vargaz@gmail.com>
275 * CILCompiler.cs: Implement StringIgnoreCase.
277 * CILCompiler.cs: Implement grouping support.
279 * CILCompiler.cs: Implement character groups.
281 2008-02-25 Zoltan Varga <vargaz@gmail.com>
283 * CILCompiler.cs: Implement lots of missing opcodes.
285 2008-02-18 Zoltan Varga <vargaz@gmail.com>
287 * CILCompiler.cs (EmitEvalMethodBody): Check for the not-yet supported
290 Thu Feb 14 19:03:00 CET 2008 Paolo Molaro <lupus@ximian.com>
292 * RxCompiler.cs, RxInterpreter.cs, RxOp.cs, CILCompiler.cs : support for word
293 boundary position opcodes, ignorecase backreference and more capture
296 Thu Feb 14 17:11:10 CET 2008 Paolo Molaro <lupus@ximian.com>
298 * RxCompiler.cs, RxInterpreter.cs, RxOp.cs: replace EcmaDigit with
299 Range, fixed matching of "" =~ /$/, implementedt TestCharGroup.
300 Fixes and other misc opcodes implemented.
302 2008-02-13 Zoltan Varga <vargaz@gmail.com>
304 * CILCompiler.cs: Restructure some code to avoid a branch inside a loop.
306 * CILCompiler.cs: Fix the unsafe string matching code.
308 * CILCompiler.cs: Improved version which emits only one method in most cases.
310 * CILCompiler.cs: Fix some comments.
312 * CILCompiler.cs: New file, extracted from RxCompiler.cs.
314 * RxInterpreter.cs RxCompiler.cs: First version of regex IL compiler.
316 Wed Feb 13 13:18:12 CET 2008 Paolo Molaro <lupus@ximian.com>
318 * RxCompiler.cs, RxInterpreter.cs, RxOp.cs: unicode categories and
319 some grouping/capture support.
321 Tue Feb 12 19:16:49 CET 2008 Paolo Molaro <lupus@ximian.com>
323 * RxCompiler.cs, RxInterpreter.cs, RxOp.cs: experimental new
326 2008-02-10 Zoltan Varga <vargaz@gmail.com>
328 * replace.cs (NeedsGroupsOrCaptures): New property. Determines whenever the
329 replacement process needs access to the groups or captures properties of the
332 * Group.cs: Add an internal ctor which avoids allocations.
336 * BaseMachine.cs interpreter.cs: Add an optimization to avoid fully creating
337 Match objects during Replace () if the replacement string is simple.
339 * BaseMachine.cs Regex.cs: Make LTRReplace and RTLReplace instance methods to
340 avoid creating two machines for each Regex.Replace () call.
342 * interpreter.cs (Eval): Remove a needless string allocation.
344 2007-12-04 Arina Itkes <arinai@mainsoft.com>
346 * parser.cs: Max value of m for a construct {n,m} is 2147483647.
348 2007-11-15 Miguel de Icaza <miguel@novell.com>
350 * Revert the patch from Juraj Skripsky as it made the class
351 non-thread safe (see #341986).
353 2007-11-08 Raja R Harinath <harinath@gmail.com>
356 * BaseMachine.cs (LTRReplace): Don't use non-advancement of 'ptr'
357 to deduce absence of matches -- a match can have length 0.
358 (RTLReplace): Likewise.
360 2007-11-07 Raja R Harinath <harinath@gmail.com>
362 Support RegexOptions.RightToLeft in Replace().
363 * BaseMachine.cs (Replace): Use either LTRReplace or RTLReplace
365 (LTRReplace): Make internal and rename the MatchAppendEvaluator
366 version of Replace to this.
368 * Regex.cs (Replace): Use LTRReplace and RTLReplace from BaseMachine.
369 * replace.cs (ReplacementEvaluator.Evaluate): Optimize simple case.
370 Based on patch by Stephane Delcroix.
372 * replace.cs (Compile): Don't unescape string.
374 2007-11-01 Gert Driesen <drieseng@users.sourceforge.net>
376 * Match.cs: Do not throw NotSupportedException on zero-length
377 replacement argument.
379 2007-10-29 Arina Itkes <arinai@mainsoft.com>
381 * Regex.cs: Moving creation of Regex machine to ctor.
382 It increases an initialization time of Regex but reduce a
383 process time while APIs calling. Also it solves the problem
384 of missed multi thread synchronization.
386 2007-10-29 Arina Itkes <arinai@mainsoft.com>
388 * Match.cs: Fix for Result method of Match. Throwing an exception
389 if Result method was called on a failed Match.
391 2007-10-24 Juraj Skripsky <js@hotfeet.ch>
393 * Regex.cs: Store and re-use IMachine, no need to re-instantiate
394 it every time we're matching.
396 2007-10-24 Arina Itkes <arinai@mainsoft.com>
398 * Regex.cs Match.cs arch.cs compiler.cs interpreter.cs
399 Refactoring of Interpreter with extracting of base abstract class
400 that executes some methods that were moved from Regex and Match classes.
401 Added a field that maps group numbers to group names in Regex for
402 improvement of performance of GroupNameFromNumber method.
404 2007-10-21 Gert Driesen <drieseng@users.sourceforge.net>
406 * RegexTest.cs: Removed. Test was already moved to the appropriate
409 2007-06-21 Juraj Skripsky <js@hotfeet.ch>
411 * quicksearch.ch: Optimization. Add byte array as skip table for
412 chars <= 255, falling back to the hashtable for chars > 255 and
413 skip distances > 255.
415 2007-04-18 Raja R Harinath <rharinath@novell.com>
418 * parser.cs (ResolveReferences): Don't throw an expression if a
419 capture assertion reference cannot be resolved.
420 (ParseGroupingConstruct): Provide fallback expression to a capture
422 * syntax.cs (CaptureAssertion): If the bareword doesn't refer to
423 the name of a capture group, fallback to treating it as a literal
426 2007-04-04 Raja R Harinath <rharinath@novell.com>
428 * interpreter.cs (Eval) <OpCode.Reference>: Distribute for loop
430 for () if (a) s1; else s2; => if (a) for () s1; else for () s2;
432 2007-04-03 Raja R Harinath <rharinath@novell.com>
434 * Regex.cs (~Regex): Don't define in NET_2_0 profile.
436 2007-01-02 Raja R Harinath <rharinath@novell.com>
439 * parser.cs (Parser.GetMapping): Use the actual group numbers to
442 2006-09-28 Andrew Skiba <andrews@mainsoft.com>
444 * Regex.cs: TARGET_JVM
446 2006-05-30 Gert Driesen <drieseng@users.sourceforge.net>
448 * CaptureCollection.cs: Removed virtual keyword to fix API mismatches.
449 * MatchCollection.cs: Removed virtual keyword to fix API mismatches.
450 * GroupCollection.cs: Removed virtual keyword to fix API mismatches.
452 2006-05-08 Raja R Harinath <rharinath@novell.com>
455 Remove 65535-limit on number of repetitions matched by a pattern.
456 We still have a 65535 limit on the length of a pattern and the
457 number of groups in a pattern.
458 * compiler.cs (PatternCompiler.EmitCount): New. Emits an int as
459 two ushorts into the program stream.
460 (EmitInfo, EmitRepeat, EmitFastRepeat): Use it to emit integers
462 * interpreter.cs (Intepreter.ReadProgramCount): Read an int
463 emitted into the program stream.
464 (Interpreter): Use it. Update counts.
465 (Interpreter.Eval) [OpCode.Repeat, OpCode.FastRepeat]: Likewise.
466 * parser.cs (ParseGroup): Pass 0x7ffffff as the max value for '*'
467 and '+' repetition patterns.
468 * arch.cs (Info, Repeat, FastRepeat): Update description.
470 2006-04-18 Raja R Harinath <rharinath@novell.com>
472 Treat fixed repetitions of simple regexes as simple too.
473 * syntax.cs (Expression.IsComplex): Make abstract.
474 (Group.IsComplex, Alternation.IsComplex): Move ...
475 (CompositeExpression.IsComplex): ... here.
476 (Group.GetAnchorInfo): Reduce allocations. Avoid creating another
477 ArrayList, and use a StringBuilder to build up the string.
478 (Repetition.GetAnchorInfo): Use a StringBuilder to build up the string.
479 (ExpressionAssertion.IsComplex): Override.
481 2006-04-17 Florian Gross <flgr@ccan.de>
482 Raja R Harinath <rharinath@novell.com>
484 * syntax.cs (CharacterClass.Compile): Emit categories after the
485 character intervals so that the evaluator can pick up the
488 2006-04-07 Raja R Harinath <rharinath@novell.com>
491 * interpreter.cs (Interpreter.Eval) [Anchor, Position.StartOfString]:
492 Don't reset 'ptr' to 0 during forward scan.
495 * interpreter.cs (Interpreter.FastEval) [FastRepeat]: If the first
496 tail operation has a 'negate' flag, avoid the "match next char"
500 * arch.cs (OpCode.NotCategory): New. Stands for matching a
501 character _not_ from the given category.
502 * debug.cs (DisassembleBlock): Handle it.
503 * compiler.cs (ICompiler.EmitNotCategory): New.
504 (Compiler.EmitNotCategory): New. Emit OpCode.NotCategory.
505 * syntax.cs (CharacterClass.Compile): Don't conflate negation of
506 the character class and negation of the category. Use
508 * interpreter.cs (Interpreter.Eval): Pass OpCode.NotCategory to
510 (Interpreter.EvalChar): Handle it.
512 2006-04-06 Raja R Harinath <rharinath@novell.com>
515 * interpreter.cs (Eval) [Until, FastUntil]: Set 'deep' to null
516 when evaluating the tail. Ensure that backtracks don't confuse
517 the recursion vs. iteration detector.
519 2006-04-03 Raja R Harinath <rharinath@novell.com>
521 * interpreter.cs (Eval) [Until, lazy]: Avoid extra evaluation on a
524 2006-03-30 Raja R Harinath <harinath@gmail.com>
527 * parser.cs (Parser.ParseCharacterClass): Don't automatically
528 assume there's a range when we see '-'. Ensure that we have seen
529 at least one other character, and that we aren't already parsing a
530 range. Handle some more errors.
532 2005-12-19 Kornél Pál <kornelpal@hotmail.com>
534 * Regex.cs: Added support for regular expressions compiled to
535 assemblies by compiling the pattern. This solution ignores existing
536 CIL code but provides full support for regular expression classes
539 2005-11-21 Sebastien Pouliot <sebastien@ximian.com>
541 * CaptureCollection.cs: Fixed length check.
542 * Group.cs: Added missing validation for Synchronized method.
543 * Match.cs: Added missing validation for Synchronized and Result
545 * MatchEvaluator.cs: Added [Serializable] for 2.0 profile.
546 * RegexCompilationInfo.cs: Added missing property validation.
547 * Regex.cs: Implemented UseOptionC and UseOptionR protected methods
548 (now documented). Fixed API for 2.0 profile.
549 * RegexRunner.cs: Stubbed CharInClass for 2.0 profile.
551 2005-11-17 Sebastien Pouliot <sebastien@ximian.com>
553 * Match.cs: Removed the ": base ()" on the private ctor as it is
554 unrequired and cause an extra public ctor to added (bug #76736).
555 * MatchCollection.cs: Add missing virtual to indexer property.
557 2005-09-23 Raja R Harinath <rharinath@novell.com>
559 * interpreter.cs (Interpreter.Eval) [OpCode.Until]: Invert the
560 sense of a test to reflect the code re-organization.
562 2005-09-22 Raja R Harinath <rharinath@novell.com>
565 * interpreter.cs (Interpreter.Eval) [OpCode.Until]: Avoid some
566 cases of recursion when dealing with eager quantifiers too. We
567 now avoid recursion when handling the innermost quantifier.
568 (Interpreter.IntStack, Interpreter.stack): New. Stack to help
569 implement backtracking in eager quantifiers.
571 2005-09-21 Raja R Harinath <rharinath@novell.com>
573 * interpreter.cs (Interpreter.Eval) [OpCode.Until]: Avoid some
574 cases of recursion when dealing with the minimum count and lazy
577 2005-08-23 Raja R Harinath <rharinath@novell.com>
579 * regex.cs: Remove. Split into ...
580 * MatchEvaluator.cs, Regex.cs, RegexCompilationInfo.cs,
581 RegexOptions.cs: ... these. Now every publicly exposed type in
582 this namespace has its own file.
584 2005-07-21 Florian Gross <flgr@ccan.de>
586 * Fixed a bug in category.cs that caused ECMAScript \d to fail.
588 2005-07-13 Raja R Harinath <rharinath@novell.com>
590 Make even more lazier.
591 * MatchCollection.cs (TryToGet): Don't generate match i+1 when
592 we're looking for match i. Change post-conditions.
593 (FullList): New helper property. Ensures the list is fully populated.
594 (Count, CopyTo): Use it.
595 (Enumerator.Current): Update to new post-conditions of TryToGet.
596 (Enumerator.MoveNext): Likewise. Don't modify index if we're
599 2005-07-08 Raja R Harinath <rharinath@novell.com>
601 * MatchCollection.cs: Convert to incremental mode.
602 * regex.cs (Regex.Matches): Update. Pass responsibility of
603 generating all matches to MatchCollection.
605 2005-06-14 Raja R Harinath <harinath@gmail.com>
607 * parser.cs (Parser.ConsumeWhitespace): Add bounds check.
610 * Match.cs (Match) [zero-argument variant]: Make private.
611 * GroupCollection (Item) [string variant]: Don't look for the
612 group number in an empty match.
614 2005-06-10 Raja R Harinath <rharinath@novell.com>
616 * interpreter.cs (Interpreter.GenerateMatch): Avoid allocating two
617 intermediate arrays to build the final result.
618 (Interpreter.GetGroupInfo, Interpreter.PopulateGroup): New helper
620 * CaptureCollection.cs (list): Change from ArrayList to list.
621 (SetValue): New internal helper, used by Interpreter.PopulateGroup.
622 (Enumerator): Remove helper class.
623 (IEnumerator.GetEnumerator): Just use list.GetEnumerator.
624 * GroupCollection.cs: Likewise.
625 * Group.cs (Group): Move responsibility of populating 'Captures'
626 to Interpreter.PopulateGroup.
627 * Match.cs (Match): Move responsibility of populating 'Groups' to
628 Interpreter.GenerateMatch.
630 2005-05-25 Raja R Harinath <rharinath@novell.com>
632 * replace.cs (ReplacementEvaluator.Compile): Rewrite to avoid
633 creating several intermediate strings. Simplify internal
634 intermediate representation.
635 (ReplacementEvaluator.EvaluateAppend): New. Version of Evaluate
636 that builds the result directly on a passed-in StringBuilder.
637 (ReplacementEvaluator.Evaluate): Just a wrapper around
639 * regex.cs (MatchAppendEvaluator): New internal delegate.
640 (Regex.Replace): Use MatchAppendEvaluator.
641 (Regex.Adapter): New class used to adapt a MatchEvaluator to a
642 MatchAppendEvaluator.
644 2005-05-24 Raja R Harinath <rharinath@novell.com>
646 * replace.cs (ReplacementEvaluator.CompileTerm): Fix group
649 2005-05-20 Ben Maurer <bmaurer@ximian.com>
651 * regex.cs: Some memory allocation optimizations.
653 2005-05-20 Raja R Harinath <rharinath@novell.com>
656 * replace.cs (ReplacementEvaluator.Compile): Allow CompileTerm to
657 fail and yet have advanced the pointer. Append the scanned-over
658 portion to the "literal" being built.
659 (ReplacementEvaluator.CompileTerm): Don't throw any exceptions.
660 If a term cannot be recognized, just return null.
662 * compiler.cs (InterpreterFactory.GroupCount): Fix. The 0'th
663 index corresponds to Opcode.Info.
665 * parser.cs (Parser.Unescape): If the string doesn't contain any
666 '\' character, don't allocate a new string.
668 * replace.cs (ReplacementEvalutator.Term.AppendResult): Rename
669 from GetResult. Append to a passed-in StringBuilder rather than
671 (ReplacementEvaluator.Evaluate): Update.
673 * Capture.cs, Group.cs, Match.cs: New files split out of ...
674 * match.cs: ... this. Remove.
676 2005-02-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
678 * parser.cs: stuff inside {} might not be a quantifier. Fixes
681 2005-01-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
683 * quicksearch.cs: handle IgnoreCase when getting the shift distance.
684 Fixes bug #69065. Patch by mei@work.email.ne.jp.
686 2005-01-08 Miguel de Icaza <miguel@ximian.com>
688 * syntax.cs: Applied patch from mei@work.email.ne.jp to fix bug
691 * parser.cs: Turns out that \digit sequences are octal sequences
692 (no leading zero is needed); And the three octal digit rule
693 applies to the leading zero as well.
695 This fixes the Unescape method.
697 2004-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
699 * regex.cs: use NextMatch to move on to the next match. Fixes bug
702 2004-11-09 Atsushi Enomoto <atsushi@ximian.com>
706 2004-11-08 Ben Maurer <bmaurer@ximian.com>
708 * replace.cs, parser.cs: Use stringbuilder for allocation sanity.
710 2004-10-21 Joerg Rosenkranz <joergr@voelcker.com>
712 * regex.cs: Fixed a bug introduced with the last patch which
713 prevented any replacements when a postive count is given.
714 This also happens in all overloads without count parameter.
716 2004-10-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
718 * regex.cs: in Replace, when count is negative, replacement continues
719 to the end of the string.
721 Fixes bug #68398. Patch by Jon Larimer.
723 2004-06-10 Gert Driesen <drieseng@users.sourceforge.net>
725 * RegexRunner.cs: fixed case mismatch of methods
727 2004-06-10 Gert Driesen <drieseng@users.sourceforge.net>
729 * RegexRunner.cs: marked TODO, added missing protected internal
730 fields, throw NotImplementedException in all methods
732 2004-06-10 Gert Driesen <drieseng@users.sourceforge.net>
734 * RegexRunnerFactory.cs: removed comment, no longer throw exception
736 * regex.cs: fixed public API signature by renaming protected
737 internal fields and adding destructor, added MonoTODO attribute to
738 fields and method that are not yet implemented, changed not
739 implemented methods to throw NotImplementedException instead of
740 Exception, fixed names of field that are serialized
742 2004-06-06 Jambunathan K <kjambunathan@novell.com>
744 * parser.cs: Fixed issues with Regex.Unescape() identified as part of
745 debugging bug #58256. The original problem reported was about
746 inconsistency between the way we treat replacement patterns and the
747 way microsoft treats the replacement patterns in Regex.Replace(). MS
748 implementation is buggy and doesn't honour escape sequences in the
749 replacement patterns, even though the SDK claims otherwise.
752 2004-06-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
754 * syntax.cs: re-applied my patch from 2004-05-27 plus a fix which is
755 emitting a Category.All if both a category and its negated value are
758 2004-06-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
760 * syntax.cs: reverting my previous patch. It causes bigger problems.
762 2004-05-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
764 * category.cs: added LastValue field to mark the end of enum Category.
765 * syntax.cs: in CharacterClass, use Category.LastValue to get the size
766 of the array needed. Use a BitArray instead of bool[].
767 In AddCategory(), don't set the opposite category as false. Fixes
768 bug #59150. All tests pass.
770 2004-05-25 Jackson Harper <jackson@ximian.com>
772 * parser.cs: Allow creating a regular expression using {,n} as the
773 specified. The min bounds is set to -1, I am not completely sure
774 if that is what it is supposed to be but MS does not set it to 0
775 based on testing. Patch by dave-gnome-bugs@earth.li. Fixes bug #56761.
777 2004-05-12 Dick Porter <dick@ximian.com>
781 * RegexRunnerFactory.cs:
782 * RegexRunner.cs: More public API difference fixes.
784 * GroupCollection.cs:
785 * MatchCollection.cs:
786 * CaptureCollection.cs: Moved GroupCollection, MatchCollection and
787 CaptureCollection so that they no longer inherit from the
788 non-standard RegexCollectionBase class. Fixes the API difference.
790 2004-04-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
797 Patch by Eric Durand Tremblay.
798 1) Capture inner group when named.
799 2) Resolved parse error caused by not capturing inner group
800 3) Resolved incorrect capture group
801 4) Now, not capturing anything when unnamed ( correct behavior)
804 2004-04-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
810 * syntax.cs: converted to unix line endings.
812 2004-03-30 Lluis Sanchez Gual <lluis@ximian.com>
814 * collections.cs: In the indexer, return an empty group if the requested
816 * match.cs: Added default constructor for Group.
818 2004-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
820 * parser.cs: fixed group numbering.
822 2004-03-22 Jackson Harper <jackson@ximian.com>
824 * parser.cs: Use the group number as the name in mapping. Patch by
826 * regex.cs: Fix off by one error. Patch by Gert Driesen.
828 2004-03-17 Francois Beauchemin <beauche@softhome.net>
829 * syntax.cs, interpreter.cs, quicksearch.cs, regex.cs, compiler.cs :
830 Revised support for RigthToLeft.
831 quicksearch has now an reverse option.
832 This fixes bug #54537
834 * regex.cs, compiler.cs :
835 Some code to support CILCompiler.
837 Added some undocumented of MS.
839 2004-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
841 * parser.cs: allow a @"\0" escape sequence. Fixes bug #54797.
843 2004-02-01 Miguel de Icaza <miguel@ximian.com>
845 * syntax.cs, interval.cs: Applied patch from Marco Cravairo
846 through Francois Beauchemin who reviewed on the mailing list.
847 This fixes bug #45976
849 2004-01-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
851 * parser.cs: an opening brace without a
852 quantifier do not cause a parse error. Fixes bug #52924.
854 2004-01-07 Lluis Sanchez Gual <lluis@ximian.com>
856 * regex.cs: In Split(), if the last match is at the end of the string,
857 an empty string must be added to the array of results.
859 2003-12-15 Sanjay Gupta <gsanjay@novell.com>
860 * match.cs: Check for null value before Substring method call.
863 2003-11-21 Juraj Skripsky <js@hotfeet.ch>
865 * quicksearch.cs: Create and use hashtable only for "long" search
868 (Search): Use simple scan for a single-character search strings.
870 (GetChar): Simplify case sensitivity handling.
872 2003-11-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
874 * interpreter.cs: when evaluating a degenerate match, restore the
875 RepeatContext if fail. Fixes bug #42529.
877 2003-11-22 Jackson Harper <jackson@ximian.com>
879 * regex.cs: Add CultureInvariant flag to RegexOptions.
881 2003-11-20 Juraj Skripsky <js@hotfeet.ch>
883 * quicksearch.cs: Use a hashtable instead of an array for the
884 shift table to improve the memory usage.
886 2003-11-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
889 (Split): include capture groups in the results, if any. Fixes bug
892 2003-07-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
894 * regex.cs: patch from Eric Lindvall <eric@5stops.com> that fixes bug
897 2003-03-05 Miguel de Icaza <miguel@ximian.com>
899 * category.cs (CategoryUtils.CategoryFromName): Use StartsWith
900 ("Is") instead of a substring for (0,2) which was throwing an
901 exception causing Category.None to be returned
903 2003-01-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
905 * collections.cs: fixed bug #30091.
907 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
909 * regex.cs: fixed little mistake (closes #35860).
911 2002-11-12 Jackson Harper <jackson@latitudegeo.com>
913 * arch.cs compiler.cs regex.cs: Added mapping attribute to MachineFactories
915 2002-11-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
917 * parser.cs: detect illegal \ at end of pattern. Fixes 31334.
919 2002-10-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
921 * parser.cs: applied fix from Tim Haynes (thaynes@openlinksw.com) to
922 solve bug #32807. Also modified GetMapping to return the same as MS.
924 2002-08-28 Juli Mallett <jmallett@FreeBSD.org>
926 * arch.cs, compiler.cs: Give the interpreter machine a property
927 for the retrieval of the group count.
929 * regex.cs: Use the new GroupCount property of the factory to
930 initialise the current group count, and restructure code to compile
931 the pattern only the first time it is needed (essentially backing
932 out the previous revision of regex.cs, to use the new code.)
934 2002-08-14 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
936 * regex.cs: Added the ctr for ISerializable implementation and
937 implemented the GetObjectData function.
939 2002-07-30 Juli Mallett <jmallett@FreeBSD.org>
941 * regex.cs: Fixed bug where the expression would not be
942 re-evaluated for grouping purposes when factory caches were
943 used, resulting in no groups being recognised after one call
944 with a given pattern and no change in options.
946 2002-05-13 Dan Lewis <dihlewis@yahoo.co.uk>
948 * regex.cs: Fixed bug in split.
950 2002-05-08 Dan Lewis <dihlewis@yahoo.co.uk>
952 * interpreter.cs: Moved to an array-based stack representation
955 * match.cs, collections.cs: Decoupled capture representation from
956 interpreter internals.
958 * cache.cs: Changed Key type from struct to class for speed.
960 2002-04-06 Dan Lewis <dihlewis@yahoo.co.uk>
962 * cache.cs: Object methods should be overridden with "override".
964 2002-04-04 Dan Lewis <dihlewis@yahoo.co.uk>
966 * RegexRunner.cs, RegexRunnerFactory.cs: MS support classes. Stubs
967 added for completeness.
969 * regex.cs, match.cs, collections.cs: Serializable attribute.
971 2002-04-04 Dan Lewis <dihlewis@yahoo.co.uk>
973 * regex.cs: Added static Matches and IsMatch methods.
975 2002-04-03 Dan Lewis <dihlewis@yahoo.co.uk>
977 * ChangeLog: Added changelog.
979 * cache.cs: Fixed bug in MRUList.Evict.