Commit Graph
13 Commits
Author SHA1 Message Date
Alexander Köplinger 48e112d652 [Cleanup] Removed TARGET_JVM
It was once part of a special Java target profile, but this is no longer used today.
2014-08-08 03:28:34 +02:00
Raja R Harinath f6656df299 Implement some more group number/index distinction
* 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
2009-08-19 20:42:13 +00:00
Raja R Harinath fb54e0e6c7 Distinguish between the internal index of a group and group number.
* 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
2009-08-19 20:40:39 +00:00
Noam Lampert 03faa8a1ba Fix Java compilation. Upgrade project file to Visual Studio 2008.
svn path=/trunk/mcs/; revision=98979
2008-03-25 16:18:00 +00:00
Zoltan Varga f1e948d1b0 2008-02-10 Zoltan Varga <[email protected]>
* replace.cs (NeedsGroupsOrCaptures): New property. Determines whenever the
	replacement process needs access to the groups or captures properties of the
	Match object.

	* Group.cs: Add an internal ctor which avoids allocations.

	* Match.cs: Ditto.

	* BaseMachine.cs interpreter.cs: Add an optimization to avoid fully creating
	Match objects during Replace () if the replacement string is simple.

svn path=/trunk/mcs/; revision=95394
2008-02-10 18:08:27 +00:00
Gert Driesen 083af1ff31 * GroupTest.cs: Improved test for null argument check.
* 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
2007-11-01 21:17:50 +00:00
Arina Itkes 4f48041bbd Fix for Result method of Match. Throwing an exception if Result method was called on a failed Match.
svn path=/trunk/mcs/; revision=88356
2007-10-29 09:20:00 +00:00
Arina Itkes 61d27ad7fc - Refactoring of Interpreter with extracting of base abstract class that executes some methods that were moved from Regex and Match classes.
- 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
2007-10-24 14:18:57 +00:00
Sebastien Pouliot 1a7ff3d408 2005-11-21 Sebastien Pouliot <[email protected]>
* CaptureCollection.cs: Fixed length check.
	* Group.cs: Added missing validation for Synchronized method.
	* Match.cs: Added missing validation for Synchronized and Result 
	methods.
	* MatchEvaluator.cs: Added [Serializable] for 2.0 profile.
	* RegexCompilationInfo.cs: Added missing property validation.
	* Regex.cs: Implemented UseOptionC and UseOptionR protected methods
	(now documented). Fixed API for 2.0 profile.
	* RegexRunner.cs: Stubbed CharInClass for 2.0 profile.


svn path=/trunk/mcs/; revision=53312
2005-11-21 18:33:35 +00:00
Sebastien Pouliot 048be78654 2005-11-17 Sebastien Pouliot <[email protected]>
* 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
2005-11-17 20:20:13 +00:00
Raja R Harinath 4e8fc6ec9a In System.Text.RegularExpressions:
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
2005-06-14 11:44:35 +00:00
Raja R Harinath bcc7b46795 * interpreter.cs (Interpreter.GenerateMatch): Avoid allocating two
intermediate arrays to build the final result.
(Interpreter.GetGroupInfo, Interpreter.PopulateGroup): New helper
functions.
* CaptureCollection.cs (list): Change from ArrayList to list.
(SetValue): New internal helper, used by Interpreter.PopulateGroup.
(Enumerator): Remove helper class.
(IEnumerator.GetEnumerator): Just use list.GetEnumerator.
* GroupCollection.cs: Likewise.
* Group.cs (Group): Move responsibility of populating 'Captures'
to Interpreter.PopulateGroup.
* Match.cs (Match): Move responsibility of populating 'Groups' to
Interpreter.GenerateMatch.

This reduced the time for 100000 iterations of the 'regex'[1] benchmark
from 63s to 53s.

svn path=/trunk/mcs/; revision=45757
2005-06-10 13:54:07 +00:00
Raja R Harinath 0db5645ea7 In System.Text.RegularExpressions:
* Capture.cs, Group.cs, Match.cs: New files split out of ...
	* match.cs: ... this.  Remove.

In .:
	* System.dll.sources: Update to reflect split-up of
	System.Text.RegularExpressions/match.cs.

svn path=/trunk/mcs/; revision=44793
2005-05-20 05:44:45 +00:00