* parser.cs (gap): New.
(GetMapping): Return it.
(ResolveReferences): Collect explicit numeric groups which may not
match their indices.
(HandleExplicitNumericGroups): New. Process the above list to
assign appropriate indices, and compute the correct value of 'gap'.
svn path=/trunk/mcs/; revision=140290
* System.Text.RegularExpressions/parser.cs (ResolveReferences):
Allow named groups to be referred-to by their group numbers too.
* RegexMatchTests.cs (RegexTrial0053): New.
svn path=/trunk/mcs/; revision=139655
evaluator are not null, as documented in MSDN (and the variance found
while testing DbLinq).
* Test/System.Text.RegularExpressions/RegexReplace.cs: Add null
argument checks for Regex.Replace().
svn path=/trunk/mcs/; revision=128241
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
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
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
* CaptureCas.cs: New. CAS tests.
* CaptureCollectionCas.cs: New. CAS tests.
* GroupCas.cs: New. CAS tests.
* GroupCollectionCas.cs: New. CAS tests.
* GroupTest.cs: New. Unit tests.
* MatchCas.cs: New. CAS tests.
* MatchCollectionCas.cs: New. CAS tests.
* MatchTest.cs: New. Unit tests.
* RegexCas.cs: New. CAS tests.
* RegexCompilationInfoCas.cs: New. CAS tests.
* RegexCompilationInfoTest.cs: New. Unit tests.
* RegexRunnerCas.cs: New. CAS tests.
* RegexRunnerFactoryCas.cs: New. CAS tests.
* RegexTest.cs: Added test cases for new (2.0) CacheSize property.
svn path=/trunk/mcs/; revision=53313
* MatchCollection.cs: Convert to incremental mode.
* regex.cs (Regex.Matches): Update. Pass responsibility of
generating all matches to MatchCollection.
In Test/System.Text.RegularExpressions:
* RegexTest.cs (Matches1, Matches2, ..., Matches10): Combine into ...
(Matches): ... this. Convert to use a data-driven approach. Use ...
(trials): ... this. New variable that lists the regexp, input
text and expected results.
(runTrial): New. Run a suite of MatchCollection tests on each trial.
Tests both incremental and non-incremental modes.
svn path=/trunk/mcs/; revision=47079
Fix#74753.
* Match.cs (Match) [zero-argument variant]: Make private.
* GroupCollection (Item) [string variant]: Don't look for the
group number in an empty match.
In Test/System.Text.RegularExpressions:
* RegexBugs.cs (NameLookupInEmptyMatch): New test from #74753.
svn path=/trunk/mcs/; revision=45958
* RegexReplace.cs: Add testcase for $+.
In System.Text.RegularExpressions:
* replace.cs (ReplacementEvaluator.CompileTerm): Fix group
returned by $+.
svn path=/trunk/mcs/; revision=44925
* System_test.dll.sources: Add
System.Text.RegularExpressions/RegexReplace.cs.
In System.Text.RegularExpressions:
Fix#74735.
* replace.cs (ReplacementEvaluator.Compile): Allow CompileTerm to
fail and yet have advanced the pointer. Append the scanned-over
portion to the "literal" being built.
(ReplacementEvaluator.CompileTerm): Don't throw any exceptions.
If a term cannot be recognized, just return null.
In Test/System.Text.RegularExpressions:
* RegexReplace.cs: New file. Most of the tests were inspired by
#74735.
svn path=/trunk/mcs/; revision=44813
* syntax.cs: Applied patch from [email protected] to fix bug
#71077.
* parser.cs: Turns out that \digit sequences are octal sequences
(no leading zero is needed); And the three octal digit rule
applies to the leading zero as well.
This fixes the Unescape method.
2005-01-08 Miguel de Icaza <[email protected]>
* RegexBugs.cs: Add new test.
svn path=/trunk/mcs/; revision=38517
* Test/System.Text.RegularExpressions/RegexBugs.cs: test case for bug
#57274.
* System.Text.RegularExpressions/regex.cs: use NextMatch to move on to
the next match. Fixes bug #57274.
svn path=/trunk/mcs/; revision=36798