In System/System.Text.RegularExpressions:
* BaseMachine.cs (LTRReplace): Don't use non-advancement of 'ptr'
to deduce absence of matches -- a match can have length 0.
(RTLReplace): Likewise.
In System/Test/System.Text.RegularExpressions:
* RegexReplace.cs (tests): New test from #324390.
svn path=/trunk/mcs/; revision=89176
In b/class/System/System.Text.RegularExpressions:
* BaseMachine.cs (Replace): Use either LTRReplace or RTLReplace
based on regex.
(LTRReplace): Make internal and rename the MatchAppendEvaluator
version of Replace to this.
(RTLReplace): New.
* Regex.cs (Replace): Use LTRReplace and RTLReplace from BaseMachine.
* replace.cs (ReplacementEvaluator.Evaluate): Optimize simple case.
Based on patch by Stephane Delcroix.
In b/class/System/Test/System.Text.RegularExpressions:
* MatchTest.cs (Match_Backref): New.
* RegexReplace.cs (direction, testcase.direction): New.
(testcase..ctor): Allow specifying the direction of the replace.
(ReplaceTests): Test replace in both directions.
(EvaluatorTests): New test based on #321036.
svn path=/trunk/mcs/; revision=89034
* replace.cs (Compile): Don't unescape string.
In Test/System.Text.RegularExpressions:
* RegexReplace.cs (tests): New test from #317092.
(ReplaceTests): Don't catch an AssertException.
svn path=/trunk/mcs/; revision=89021
* MatchTest.cs: Improved tests for null argument checks. Added and
fixed replacement tests.
* RegexMatchTest.cs: Marked tests that do not pass on MS as NotDotNet.
Fixed expected result for trial 5.
* RegexResultTests.cs: Fixed Assert.
* Match.cs: Do not throw NotSupportedException on zero-length
replacement argument.
svn path=/trunk/mcs/; revision=88685
- Fixing category construct
- Moving category construct to Mono machine
- Fix grouping meta data for ExplicitCapture options
- Moving machine creation to ctor
- Fix of Result method
svn path=/trunk/mcs/; revision=88376
- Added a field that maps group numbers to group names in Regex for improvement of performance of GroupNameFromNumber method.
svn path=/trunk/mcs/; revision=88065
* quicksearch.ch: Optimization. Add byte array as skip table for
chars <= 255, falling back to the hashtable for chars > 255 and
skip distances > 255.
svn path=/trunk/mcs/; revision=80478
Fix#80554
* parser.cs (ResolveReferences): Don't throw an expression if a
capture assertion reference cannot be resolved.
(ParseGroupingConstruct): Provide fallback expression to a capture
assertion.
* syntax.cs (CaptureAssertion): If the bareword doesn't refer to
the name of a capture group, fallback to treating it as a literal
expression.
In Test/System.Text.RegularExpressions:
* RegexBugs.cs (bug80554_trials): New tests based on #80554.
svn path=/trunk/mcs/; revision=75885
Fix#79472
* parser.cs (Parser.GetMapping): Use the actual group numbers to
build the mapping.
In Test/System.Text.RegularExpressions:
* RegexBugs.cs (GroupNumbers): New test based on #79472.
svn path=/trunk/mcs/; revision=70374
Fix#78278
Remove 65535-limit on number of repetitions matched by a pattern.
We still have a 65535 limit on the length of a pattern and the
number of groups in a pattern.
* compiler.cs (PatternCompiler.EmitCount): New. Emits an int as
two ushorts into the program stream.
(EmitInfo, EmitRepeat, EmitFastRepeat): Use it to emit integers
rather than shorts.
* interpreter.cs (Intepreter.ReadProgramCount): Read an int
emitted into the program stream.
(Interpreter): Use it. Update counts.
(Interpreter.Eval) [OpCode.Repeat, OpCode.FastRepeat]: Likewise.
* parser.cs (ParseGroup): Pass 0x7ffffff as the max value for '*'
and '+' repetition patterns.
* arch.cs (Info, Repeat, FastRepeat): Update description.
In Test/System.Text.RegularExpressions:
* RegexBugs.cs (Kill65535_1, Kill65535_2, No65535Limit): New tests
based on #78278.
svn path=/trunk/mcs/; revision=60401
* syntax.cs (Expression.IsComplex): Make abstract.
(Group.IsComplex, Alternation.IsComplex): Move ...
(CompositeExpression.IsComplex): ... here.
(Group.GetAnchorInfo): Reduce allocations. Avoid creating another
ArrayList, and use a StringBuilder to build up the string.
(Repetition.GetAnchorInfo): Use a StringBuilder to build up the string.
(ExpressionAssertion.IsComplex): Override.
svn path=/trunk/mcs/; revision=59583
2006-04-17 Florian Gross <[email protected]>
Raja R Harinath <[email protected]>
* syntax.cs (CharacterClass.Compile): Emit categories after the
character intervals so that the evaluator can pick up the
'IgnoreCase' flag.
In Test/System.Text.RegularExpressions:
2006-04-17 Florian Gross <[email protected]>
* RegexBugs.cs (CharClassWithIgnoreCase): Ensure that character
classes don't interfere with RegexOptions.IgnoreCase.
Started looking at some of Florian's patches, which I realized now that
he hadn't applied.
svn path=/trunk/mcs/; revision=59538
Fix#78007
* interpreter.cs (Interpreter.Eval) [Anchor, Position.StartOfString]:
Don't reset 'ptr' to 0 during forward scan.
In Test/System.Text.RegularExpressions:
* RegexBugs.cs (Bug78007): New test from #78007.
svn path=/trunk/mcs/; revision=59177
Fix#76345
* interpreter.cs (Interpreter.FastEval) [FastRepeat]: If the first
tail operation has a 'negate' flag, avoid the "match next char"
optimization.
In Test/System.Text.RegularExpressions:
* RegexBugs.cs (Bug76345): New test from #76345.
svn path=/trunk/mcs/; revision=59174
Fix#69269
* arch.cs (OpCode.NotCategory): New. Stands for matching a
character _not_ from the given category.
* debug.cs (DisassembleBlock): Handle it.
* compiler.cs (ICompiler.EmitNotCategory): New.
(Compiler.EmitNotCategory): New. Emit OpCode.NotCategory.
* syntax.cs (CharacterClass.Compile): Don't conflate negation of
the character class and negation of the category. Use
EmitNotCategory.
* interpreter.cs (Interpreter.Eval): Pass OpCode.NotCategory to
EvalChar.
(Interpreter.EvalChar): Handle it.
In Test/System.Text.RegularExpressions:
* RegexBugs.cs (Bug69269): New test from #69269.
svn path=/trunk/mcs/; revision=59173
* System.Text.RegularExpressions/interpreter.cs (Eval) [Until, FastUntil]:
Set 'deep' to null when evaluating the tail. Ensure that backtracks don't
confuse the recursion vs. iteration detector.
* Test/System.Text.RegularExpressions/RegexBugs.cs (Bug77487):
New test based on #77487.
svn path=/trunk/mcs/; revision=59114
* parser.cs (Parser.ParseCharacterClass): Handle some more errors.
In Test/System.Text.RegularExpressions:
* RegexBugs.cs (HangingHyphens1): New testcase for exceptions in character ranges.
svn path=/trunk/mcs/; revision=58806
* parser.cs (Parser.ParseCharacterClass): Don't automatically
assume there's a range when we see '-'. Ensure that we have seen
at least one other character, and that we aren't already parsing a
range.
In Test/System.Text.RegularExpressions:
* RegexBugs.cs (HangingHyphens): New tests from #77626, and
related bugs found by inspection.
svn path=/trunk/mcs/; revision=58776
Fix#77626
* parser.cs (Parser.ParseCharacterClass): Set 'last' when we find
that a '-' doesn't signify a range.
In Test/System.Text.RegularExpressions:
* RegexBugs.cs (HangingHyphens): New test from #77626.
svn path=/trunk/mcs/; revision=58774
* Match.cs: Removed the ": base ()" on the private ctor as it is
unrequired and cause an extra public ctor to added (bug #76736).
svn path=/trunk/mcs/; revision=53207