* 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
* compiler.cs (LinkRef.ToString) [TRACE_REGEX]: Add pretty-printer
in TRACE_REGEX mode.
(TraceRegexp): Indent the output.
(TraceRegexpLabel): New. Prints out a line label.
(EmitCount): Don't trace. All callers are traced.
(ResolveLink): Trace line labels.
svn path=/trunk/mcs/; revision=159646
* compiler.cs: Add new internal flag to switch on regexp
* tracing.
The code is a statc readonly variable so the JIT can eliminate
all tracing code during normal runs.
svn path=/trunk/mcs/; revision=159286
* BaseMachine.cs (Split): Don't add empty strings if they don't
* come from
the first capture group. Fixes#566117.
svn path=/trunk/mcs/; revision=150786
* 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
* Regex.cs (gap, Gap): New.
(Init, InitNewRegex): Update it.
(GroupNumberFromName): If the 'name' is beyond the gap, it is an
explicit numeric group -- use the name as the group number.
GetGroupIndex): Use a binary search to map a group number to its
index when we know that they don't match.
(GroupNumbers): Use group number, not group index, for explicit
numeric groups.
* Match.cs (.ctor): Use the newly introduce 'Regex.Gap'.
svn path=/trunk/mcs/; revision=140288
* Regex.cs (group_names): Rename from _groupNumbersToNameMap.
(GetGroupNamesArray): Use an IDictionaryEnumerator to walk the
mapping, since both the key and value are used in the loop.
svn path=/trunk/mcs/; revision=140286
* Regex.cs (GetGroupIndex): New.
(GroupNameFromNumber): Use it.
* GroupCollection.cs (.ctor): Introduce 'gap' argument. It is the
index of the first group whose group number differs from its index.
(Item.get): Likewise.
svn path=/trunk/mcs/; revision=140284
* 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
* Regex.cs: Remove Compiler-related support for NET_2_1
* RegexOptions.cs: Remove Compile from values available on NET_2_1
svn path=/trunk/mcs/; revision=132491
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
* CILCompiler.cs: Avoid throwing exceptions for a few more unhandled opcodes.
Implement the reverse/ignorecase versions of Reference. Fix the reverse
version of Bitmap. Error out if a Jump opcode jumps outside the current
pc range. This works around #466151.
svn path=/trunk/mcs/; revision=123417
* RxOp.cs: Remove unused Generic opcodes.
* RxCompiler.cs: Emit opcodes with flags using methods which can be
overriden by CILCompiler.cs, so we only have to override a few methods.
* CILCompiler.cs: Simplify based on the RxCompiler changes. Implement
UnicodeString opcode. Throw a NotImplementedException when an unsupported
opcode is encountered, since the IL compiler is now believed to be feature
complete.
svn path=/trunk/mcs/; revision=117047
* RxOp.cs: Add some missing unicode opcodes.
* gen-interp.cs RxInterpreter.cs: Generate Bitmap/UnicodeBitmap opcodes too.
* CILCompiler.cs (EmitEvalMethodBody): Add an 'end_pc' argument to mark the
end of the bytecode range which needs to be compiled. Use it to avoid
compiling the same bytecode multiple times in various opcodes. Fix
RxOp.Jump implementation. Add implementation for unicode opcodes.
svn path=/trunk/mcs/; revision=116926
* gen-interp.cs: New file to generate the all variants of the character
checking opcodes in RxInterpreter.cs.
* RxInterpreter.cs: Replace hand written code with code generated by
gen-interp.cs.
svn path=/trunk/mcs/; revision=112947