* parser.cs (ParseEscape): Now parses with some context, whether
we are parsing inside a character range which can not contain
back-references or when we are parsing on a string context which
can contain back references.
This fixes bug #577346 which exposed a bug parsing this:
new Regex("[\\177-\\377]")
svn path=/trunk/mcs/; revision=160626
* 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
* syntax.cs (BackslashNumber): New class.
* parser.cs (ParseSpecial): Create it instead of 'Reference' if a
numeric backreference is seen.
svn path=/trunk/mcs/; revision=139656
* 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
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
* 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
* 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
debugging bug #58256. The original problem reported was about
inconsistency between the way we treat replacement patterns and the
way microsoft treats the replacement patterns in Regex.Replace(). MS
implementation is buggy and doesn't honour escape sequences in the
replacement patterns, even though the SDK claims otherwise.
svn path=/trunk/mcs/; revision=28912
specified. The min bounds is set to -1, I am not completely sure
if that is what it is supposed to be but MS does not set it to 0
based on testing. Patch by [email protected]. Fixes bug
#56761.
svn path=/trunk/mcs/; revision=28061
* System.Text.RegularExpressions/parser.cs: an opening brace without a
quantifier do not cause a parse error. Fixes bug #52924.
* Test/System.Text.RegularExpressions/RegexBugs.cs: added test from
bug #52924.
svn path=/trunk/mcs/; revision=22160
* parser.cs: applied fix from Tim Haynes ([email protected]) to
solve bug #32807. Also modified GetMapping to return the same as MS.
svn path=/trunk/mcs/; revision=8549