Commit Graph
44 Commits
Author SHA1 Message Date
Zoltan Varga 03aee949f1 Merge pull request #1200 from akoeplinger/remove-jvm
[Cleanup] Remove TARGET_JVM
2014-08-28 19:17:43 -04:00
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
Martin Potter 1af8016a5c Regex fixes for substring parsing. 2014-08-04 14:42:35 -07:00
Martin Baulig 4db812ca7e Add missing .NET 4.5 APIs
* System.Text.RegularExpressions.Regex.InfiniteMatchTimeout
* System.Net.HttpStatusCode.UpgradeRequired
* Add System.Reflection.TypeAttributes.WindowsRuntime
* System.Runtime.GCLatencyMode.SustainedLowLatency
* System.UriComponents.NormalizedHost
2013-09-02 21:52:13 +02:00
Rolf Bjarne Kvinge 142b670dae [System] Don't use System.Reflection.Emit if we're in a FullAOT runtime. 2013-05-30 23:48:48 +02:00
Martin Baulig dc4eae8d17 Add System.Text.RegularExpressions.Regex timeout APIs. 2013-03-12 17:23:00 -04:00
Rodrigo Kumpera d7b4a3e5a4 Disable the regex compiler under Full AOT. 2012-11-06 18:18:17 -05:00
Miguel de Icaza f48ceb9860 [System] Removal of the NET_2_0 in the source code
Modulo the GUID in the assembly and the GUID embedded in some
field initializers that use the assembly GUID for their name, the
assemblies are idential before and after the patch.
2012-06-02 13:16:40 -04:00
Jonathan Pryor 298a6c4ef9 [System,MOBILE] Add System.Text.RegularExpressions.RegexOptions.Compiled.
Add the RegexOptions.Compiled enumeration value to the MOBILE profile.

Fixes: http://bugzilla.xamarin.com/show_bug.cgi?id=149

MonoTouch and Mono for Android still use `PatternCompiler`, which is
interpreted. Thus RegexOptions.Compiled is ignored, and is present only for
compatibility with Windows Phone 7, which states [0]:

	Present only in Silverlight for Windows Phone, but not supported.

[0] http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regexoptions(VS.96).aspx
2011-08-09 21:19:09 -04:00
Sebastien Pouliot 4eedff1487 Fix parameter name mismatches between Moonlight and Silverlight 2011-03-10 14:33:31 -05:00
Miguel de Icaza 1fb05e0b01 Disable per Zoltan's suggestion
svn path=/trunk/mcs/; revision=156259
2010-04-27 21:35:52 +00:00
Miguel de Icaza 5529d196f3 2010-01-12 Miguel de Icaza <[email protected]>
* Regex.cs: Re-enable the new regex compiler as the bug seems to
	be gone now.

svn path=/trunk/mcs/; revision=149403
2010-01-12 13:54:19 +00:00
Raja R Harinath 2d8031df3c regex: A few more null and bounds checks
* Regex.cs (Escape, Unescape): Add null checks.
(validate_options): Add ECMAScript option checks.
(Replace, Split): Add a few bounds checks.

svn path=/trunk/mcs/; revision=141459
2009-09-07 17:14:37 +00:00
Raja R Harinath e8d4a97211 Add some null checks and bounds checks.
* Regex.cs (default_startat): New.  Replaces the fragment
'RightToLeft ?  input.Length : 0' with a null-safe variant.
(Replace) <string variant>: Add null checks for argument strings.
(Split): Likewise.
(.ctor): Likewise.  Validate regex options partially.
(Match): Add null check on string arguments, and bounds checks for
offset and length arguments.

svn path=/trunk/mcs/; revision=141457
2009-09-07 16:25:50 +00: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 61c45d91d6 Minor code re-organization
* Regex.cs (group_numbers): New.
(GetGroupNumbers): Move array initialization ...
(GroupNumbers): ... to new on-demand initializer.

svn path=/trunk/mcs/; revision=140287
2009-08-19 20:41:51 +00:00
Raja R Harinath 27c8bd541f Use IDictionaryEnumerator in a loop where both key and value are used
* 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
2009-08-19 20:41:26 +00:00
Raja R Harinath a21d173159 Introduce 'gap' concept into all the variants of regex
* arch.cs (IMachineFactory::Gap): New property.
* compiler.cs (InterpreterFactory): Update to changes.
* RxCompiler.cs (RxInterpreterFactory): Likewise.
* JvmReMachineFactory.cs: Likewise.
* parser.cs (GetMapping): Return the 'gap' index.  Move creation
of mapping dictionary ...
* Regex.cs (CreateMachineFactory): ... here.  Update to changes.

svn path=/trunk/mcs/; revision=140285
2009-08-19 20:41:03 +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
Raja R Harinath 3c675a0e62 * Regex.cs (GetGroupNumbers): List group numbers in ascending order.
(GetGroupNames): List names in order of group number.

svn path=/trunk/mcs/; revision=140051
2009-08-17 12:27:57 +00:00
Sebastien Pouliot 4f838e0e43 2009-04-23 Sebastien Pouliot <[email protected]>
* 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
2009-04-23 17:34:25 +00:00
Gonzalo Paniagua Javier 407a62a4cc unused var
svn path=/trunk/mcs/; revision=128508
2009-03-03 23:54:30 +00:00
Jonathan Pryor 247cfd34f0 * System.Text.RegularExpressions/Regex.cs (Replace): Check that input &
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
2009-02-27 21:40:17 +00:00
Jb Evain 85e8848db2 2009-02-16 Jb Evain <[email protected]>
* Regex.cs: on the NET_2_1 profile, always use the old engine for now.


svn path=/trunk/mcs/; revision=127039
2009-02-16 15:28:14 +00:00
Zoltan Varga 69d48eba16 2009-02-14 Zoltan Varga <[email protected]>
* Regex.cs: Add a MONO_NEW_RX variable to enable the new regex
	engine.

svn path=/trunk/mcs/; revision=126923
2009-02-14 14:36:27 +00:00
Zoltan Varga f908a8a6c3 2009-02-04 Zoltan Varga <[email protected]>
* Regex.cs: Disable the new regex engine for now.

svn path=/trunk/mcs/; revision=125637
2009-02-04 02:18:48 +00:00
Jb Evain dccb5600df 2009-01-12 Jb Evain <[email protected]>
* RxInterpreter.cs: set trace_rx to false for NET_2_1.
	* Regex.cs: set old_rx to false for NET_2_1.


svn path=/trunk/mcs/; revision=123110
2009-01-12 19:14:55 +00:00
Gonzalo Paniagua Javier a5ceae5e8f typo
svn path=/trunk/mcs/; revision=118938
2008-11-15 18:03:36 +00:00
Gonzalo Paniagua Javier e75ce1dcee 2008-11-14 Gonzalo Paniagua Javier <[email protected]>
* cache.cs:
	* Regex.cs: honor CacheSize value.


svn path=/trunk/mcs/; revision=118878
2008-11-14 18:51:42 +00:00
Zoltan Varga 891eaef143 2008-09-06 Zoltan Varga <[email protected]>
* Regex.cs: Make the new regex interpreter+compiler the default.

svn path=/trunk/mcs/; revision=112437
2008-09-06 17:42:37 +00:00
Jb Evain 4a6b0bd6e4 share folks from System.Collections in both System and System.Xml
svn path=/branches/jb/ml2/mcs/; revision=99297
2008-03-29 17:08:50 +00:00
Zoltan Varga 3dfa66b847 2008-02-10 Zoltan Varga <[email protected]>
* BaseMachine.cs Regex.cs: Make LTRReplace and RTLReplace instance methods to 
	avoid creating two machines for each Regex.Replace () call.

svn path=/trunk/mcs/; revision=95389
2008-02-10 17:32:04 +00:00
Miguel de Icaza 3cfcca3926 2007-11-12 Atsushi Enomoto <[email protected]>
* System.dll.sources : added S.R.InteropSvcs.ComTypes types.

svn path=/trunk/mcs/; revision=89684
2007-11-15 16:50:05 +00:00
Raja R Harinath b35097bc0b Support RegexOptions.RightToLeft in Replace().
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
2007-11-06 22:03:35 +00:00
Arina Itkes 232e79acdf Moving creation of Regex machine to ctor.
svn path=/trunk/mcs/; revision=88375
2007-10-29 12:20:38 +00:00
Juraj Skripsky e1559f84d7 2007-10-24 Juraj Skripsky <[email protected]>
* Regex.cs: Store and re-use IMachine, no need to re-instantiate
	it every time we're matching.


svn path=/trunk/mcs/; revision=88076
2007-10-24 15:33:49 +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
Raja R Harinath 1b0f319466 * Regex.cs (~Regex): Don't define in NET_2_0 profile.
svn path=/trunk/mcs/; revision=75338
2007-04-03 11:43:49 +00:00
Konstantin Triger a83c9ab209 TARGET_JVM: ifdef unsupported stuff
svn path=/trunk/mcs/; revision=71593
2007-01-24 14:32:12 +00:00
Andrew Skiba 7f0db39bd5 TARGET_JVM
svn path=/trunk/mcs/; revision=66033
2006-09-28 13:45:23 +00:00
Raja R Harinath d96a4c42b2 In System.Text.RegularExpressions:
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
2006-04-07 13:44:55 +00:00
Kornél Pál d993e00c33 * Regex.cs: Added support for regular expressions compiled to assemblies by compiling the pattern. This solution ignores existing CIL code but provides full support for regular expression classes compiled by MS.NET.
svn path=/trunk/mcs/; revision=54917
2005-12-29 19:34:27 +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
Raja R Harinath 38bf36b081 In .:
* System.dll.sources: Update.

In System.Text.RegularExpressions:
	* regex.cs: Remove.  Split into ...
	* MatchEvaluator.cs, Regex.cs, RegexCompilationInfo.cs,	
	RegexOptions.cs: ... these.  Now every publicly exposed type in
	this namespace has its own file.

svn path=/trunk/mcs/; revision=48728
2005-08-23 14:15:25 +00:00