Compare commits

...
98 Commits
Author SHA1 Message Date
nobody 920d6fe40d This commit was manufactured by cvs2svn to create tag 'MONO_0_95'.
svn path=/tags/MONO_0_95/mono/; revision=28568
2004-05-31 17:51:14 +00:00
Miguel de Icaza 3389912d8f This is Beta2
svn path=/trunk/mono/; revision=28567
2004-05-31 17:51:14 +00:00
Miguel de Icaza f131483ce6 UPdate
svn path=/trunk/mono/; revision=28566
2004-05-31 17:28:06 +00:00
Atsushi Eno f2bfd9fe48 2004-05-31 Atsushi Enomoto <[email protected]>
* XmlDataInferenceLoader.cs : Fixed GetMappedTable() that incorrectly
	  rejected same-named tables in different hierarchy. Thanks to Boris.

svn path=/trunk/mcs/; revision=28565
2004-05-31 17:16:55 +00:00
Ben Maurer e45a69164c add multi-6
svn path=/trunk/mcs/; revision=28564
2004-05-31 17:12:21 +00:00
Gonzalo Paniagua Javier 1602cb9de7 2004-05-31 Gonzalo Paniagua Javier <[email protected]>
* configure.in: fixlets for windows.

svn path=/trunk/mono/; revision=28562
2004-05-31 17:01:48 +00:00
Paolo Molaro d273b61a20 Mon May 31 19:41:46 CEST 2004 Paolo Molaro <[email protected]>
* mini.c revert Zoltan's fix to bug#58863 on ppc, since it causes
	regressions in gtk-sharp.

svn path=/trunk/mono/; revision=28561
2004-05-31 17:01:25 +00:00
Miguel de Icaza 81e825559a 2004-05-31 Miguel de Icaza <[email protected]>
* Reverted patch to namespace.cs (Use lookuptypedirect).  This
	caused a regression: #59343.  Referencing nested classes from an
	assembly stopped working.

svn path=/trunk/mcs/; revision=28560
2004-05-31 16:57:21 +00:00
Atsushi Eno b1000500d6 2004-05-31 Atsushi Enomoto <[email protected]>
* XmlDiffLoader.cs : Added some Skip() that is required not to go to
	  infinite loop. Thanks to Boris for this fix.

svn path=/trunk/mcs/; revision=28558
2004-05-31 16:50:16 +00:00
Atsushi Eno 4557407d6d 2004-05-31 Atsushi Enomoto <[email protected]>
* Directory.cs, File.cs : Fixed Exists() that raised
	  DirectoryNotFoundException. Quick fix for bug #59354.

svn path=/trunk/mcs/; revision=28557
2004-05-31 16:44:03 +00:00
Zoltan Varga a84be32229 2004-05-31 Zoltan Varga <[email protected]>
* marshal.c (mono_marshal_get_runtime_invoke): Fix CR/LFs.

svn path=/trunk/mono/; revision=28555
2004-05-31 15:47:57 +00:00
Miguel de Icaza 862d515398 Updated with new tests
svn path=/trunk/mcs/; revision=28554
2004-05-31 15:18:47 +00:00
Miguel de Icaza 27adaadb5b Add new test files
svn path=/trunk/mcs/; revision=28553
2004-05-31 15:13:25 +00:00
Atsushi Eno 0820f840a5 2004-05-31 Atsushi Enomoto <[email protected]>
* SignedXml.cs : partial fix for bug #59165 that does not output
	  namespace that conflicts with element's namespace.

svn path=/trunk/mcs/; revision=28551
2004-05-31 12:06:45 +00:00
Atsushi Eno 87aa3d424c The latest tests were by Boris Kirzner (thanks!)
svn path=/trunk/mcs/; revision=28550
2004-05-31 10:47:19 +00:00
Atsushi Eno acec2a5772 2004-05-31 Atsushi Enomoto <[email protected]>
* DataTableTest.cs : Added test for serialization.
	* DataSetInferXmlSchemaTest.cs : Added test for schema element skip.

svn path=/trunk/mcs/; revision=28549
2004-05-31 10:45:27 +00:00
Atsushi Eno c4c84f3d00 2004-05-31 Atsushi Enomoto <[email protected]>
* XmlDataInferenceLoader.cs : XmlSchema elements should not be infered.
	  Thanks to Boris for this fix.

svn path=/trunk/mcs/; revision=28548
2004-05-31 10:29:27 +00:00
Atsushi Eno d538cb0571 2004-05-31 Atsushi Enomoto <[email protected]>
* RncParser.jay : now error output is disabled.
	* RncTokenizer.cs : It should not be public class.

svn path=/trunk/mcs/; revision=28547
2004-05-31 10:23:31 +00:00
Atsushi Eno 9c5f8f2746 2004-05-31 Atsushi Enomoto <[email protected]>
* Misc.cs : made Util class internal.
	* RelaxngDatatypeProvider.cs : looks commit was missing.
	* RelaxngException.cs : made one .ctor() internal that accepts
	  RdpPattern.
	* RelaxngNameClas.cs : Names list should not be settable.
	* RelaxngPattern.cs : RelaxngRefPattern class is internal use only.
	* RelaxngPatternType.cs : there is not "Include" pattern.

svn path=/trunk/mcs/; revision=28546
2004-05-31 10:22:51 +00:00
Atsushi Eno da5275f248 2004-05-31 Atsushi Enomoto <[email protected]>
* anglia-test-runner.cs : Added support for RELAX NG compact syntax
	  parser tests.
	* Makefile : added anglia-test support.
	* README : ditto.

svn path=/trunk/mcs/; revision=28545
2004-05-31 10:22:02 +00:00
Rafael Teixeira 776110a374 2004-05-31 Rafael Teixeira <[email protected]>
* OptionDetails.cs : ShortForm member now a string to favor some simplifications, fixes for Bug 58672
	* OptionList.cs : Fixes for Bug 58672 and better handling for mixed-form options (linux/windows)

svn path=/trunk/mcs/; revision=28543
2004-05-31 09:15:09 +00:00
Rafael Teixeira 386481ff06 Exercise Mono.GetOptions a bit in the testmbas/WriteOK.exe target
svn path=/trunk/mcs/; revision=28542
2004-05-31 08:57:22 +00:00
Ravindra 956c67906f * pie.cs: Made the output image little organized and added a
case where DrawPie and FillPie were crashing the system. It
	was happening with zero degree sweep angle.

svn path=/trunk/mcs/; revision=28541
2004-05-31 08:43:54 +00:00
Rafael Teixeira a9c884eaef 2004-05-31 Rafael Teixeira <[email protected]>
* OptionDetails.cs: Assemble an one-line authors' list in about processor (also abandon after about)

svn path=/trunk/mcs/; revision=28534
2004-05-31 07:03:50 +00:00
Rafael Teixeira 86a295501e 2004/05/31 Rafael Teixeira <[email protected]>
* AssemblyInfo.cs : Anirban is and author too

svn path=/trunk/mcs/; revision=28532
2004-05-31 07:00:05 +00:00
Rafael Teixeira 7ebae8306a 2004-05-31 Rafael Teixeira <[email protected]>
* Financial.cs:
		Correct IRR and MIRR method signatures and prevent public default constructor, all according to Class Status Page (corcompare)

svn path=/trunk/mcs/; revision=28530
2004-05-31 05:35:21 +00:00
Rafael Teixeira b1853cba15 BETTER ALPHA WARNING
svn path=/trunk/mcs/; revision=28529
2004-05-31 04:51:11 +00:00
Martin Baulig 5d7664c3cc 2004-05-31 Martin Baulig <[email protected]>
MCS is now frozen for beta 2.

svn path=/trunk/mcs/; revision=28528
2004-05-31 02:55:34 +00:00
Martin Baulig 1390efe910 **** Merged from MCS ****
svn path=/trunk/mcs/; revision=28527
2004-05-31 02:46:01 +00:00
Martin Baulig b5c5563b18 **** Merged from MCS ****
svn path=/trunk/mcs/; revision=28526
2004-05-31 02:44:20 +00:00
Martin Baulig a02bf8816d Reverted everything back until 14:15 this afternoon.
svn path=/trunk/mcs/; revision=28525
2004-05-31 02:32:48 +00:00
Martin Baulig 7e9bc7847d 2004-05-30 Ben Maurer <[email protected]>
* decl.cs: If possible, use lookuptypedirect here. We can only do
	this if there is no `.' after the namespace. Avoids using
	LookupType, which does lots of slow processing.
	(FindNestedType) New method, does what it says :-).
	* namespace.cs: use LookupTypeDirect.
	* rootcontext.cs: use membercache, if possible.
	* typemanager.cs (LookupTypeDirect): Cache negative hits too.

svn path=/trunk/mcs/; revision=28523
2004-05-31 02:31:16 +00:00
Martin Baulig 42981c413a 2004-05-30 Ben Maurer <[email protected]>
* expression.cs:
	According to the spec,

	In a member access of the form E.I, if E is a single identifier,
	and if the meaning of E as a simple-name (�7.5.2) is a constant,
	field, property, localvariable, or parameter with the same type as
	the meaning of E as a type-name (�3.8), then both possible
	meanings of E are permitted.

	We did not check that E as a simple-name had the same type as E as
	a type name.

	This trivial check gives us 5-7% on bootstrap time.

2004-05-30 Ben Maurer  <[email protected]>

	* expression.cs (Invocation.OverloadResolve): Avoid the
	use of hashtables and boxing here by allocating on demand.

svn path=/trunk/mcs/; revision=28522
2004-05-31 02:26:38 +00:00
Martin Baulig d31c6ef8d0 2004-05-30 Martin Baulig <[email protected]>
* rootcontext.cs (RootContext.LookupType): Don't cache things if
	we're doing a silent lookup.  Don't try to lookup nested types in
	TypeManager.object_type (thanks to Ben Maurer).

2004-05-30  Martin Baulig  <[email protected]>

	Committing a patch from Ben Maurer.

	* rootcontext.cs (RootContext.LookupType): Cache negative results.

svn path=/trunk/mcs/; revision=28521
2004-05-31 02:24:04 +00:00
Martin Baulig 7af71bde6d Reverted everything back until 14:15:00 this afternoon.
svn path=/trunk/mcs/; revision=28520
2004-05-31 02:12:45 +00:00
Martin Baulig 53624cf702 Moved the marker again.
svn path=/trunk/mcs/; revision=28519
2004-05-31 01:18:45 +00:00
Martin Baulig 4f900ec539 **** Merged from MCS ****
svn path=/trunk/mcs/; revision=28518
2004-05-31 01:18:06 +00:00
Ben Maurer aa976d180b hush little baby, dont say a word
svn path=/trunk/mcs/; revision=28517
2004-05-31 01:13:30 +00:00
Ben Maurer 9221c586f1 disable this for now
svn path=/trunk/mcs/; revision=28516
2004-05-31 01:11:56 +00:00
Ben Maurer 74df29cff8 2004-05-30 Ben Maurer <[email protected]>
* convert.cs: add a trivial cache for overload operator resolution.

svn path=/trunk/mcs/; revision=28515
2004-05-30 23:11:04 +00:00
Ben Maurer f333a7fbb7 revert this patch, it broke the build
svn path=/trunk/mcs/; revision=28514
2004-05-30 22:49:58 +00:00
Jackson Harper 518da7775c * library.make: Install to 2.0 package if building with the
net_2_0 profile.

svn path=/trunk/mcs/; revision=28513
2004-05-30 22:44:38 +00:00
Ben Maurer de1565c510 2004-05-31 Marek Safar <[email protected]>
* attribute.cs
	(AttributeTester.GetObsoleteAttribute): Returns instance of
	ObsoleteAttribute when type is obsolete.

	* class.cs
	(TypeContainer.VerifyObsoleteAttribute): Override.
	(Method.GetSignatureForError): New method for usage when MethodBuilder is null.
	(MethodCode.VerifyObsoleteAttribute): Override.

svn path=/trunk/mcs/; revision=28512
2004-05-30 22:10:04 +00:00
Marek Safar df8d224980 2004-05-31 Marek Safar <[email protected]>
* attribute.cs
	(AttributeTester.GetObsoleteAttribute): Returns instance of
	ObsoleteAttribute when type is obsolete.

	* class.cs
	(TypeContainer.VerifyObsoleteAttribute): Override.
	(Method.GetSignatureForError): New method for usage when MethodBuilder is null.
	(MethodCode.VerifyObsoleteAttribute): Override.
	(MemberBase.VerifyObsoleteAttribute): Override.

	* decl.cs
	(MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
	and report proper error.

	*delegate.cs
	(Delegate.VerifyObsoleteAttribute): Override.

	* ecore.cs
	(Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
	and report proper error.
	(FieldExpr.DoResolve): Added tests for ObsoleteAttribute.

	* enum.cs
	(Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
	and enum member.

	* expression.cs
	(Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
	New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
	Added test for ObsoleteAttribute.

	* statement.cs
	(Catch): Derived from Statement.

svn path=/trunk/mcs/; revision=28511
2004-05-30 21:56:07 +00:00
Marek Safar 27e7e8ce15 2004-05-31 Marek Safar <[email protected]>
* attribute.cs
	(GetConditionalAttributeValue): New method. Returns
	condition of ConditionalAttribute.
	(SearchMulti): New method.  Returns all attributes of type 't'.
	Use it when attribute is AllowMultiple = true.

	* class.cs
	(Method.IsExcluded): Implemented. Returns true if method has conditional
	attribute and the conditions is not defined (method is excluded).
	(IMethodData): Extended interface for ConditionalAttribute support.
	(PropertyMethod.IsExcluded): Implemented.

svn path=/trunk/mcs/; revision=28510
2004-05-30 21:37:08 +00:00
Martin Baulig c69e5cf3df Oooops, forgot to add this.
svn path=/trunk/mcs/; revision=28509
2004-05-30 21:32:23 +00:00
Marek Safar 88c51c34b5 2004-05-30 Marek Safar <[email protected]>
* test-240.cs: Enable test.

svn path=/trunk/mcs/; revision=28508
2004-05-30 21:28:21 +00:00
Gonzalo Paniagua Javier a2890ef65c 2004-05-30 Gonzalo Paniagua Javier <[email protected]>
* Mono.Data.SqliteClient.dll.sources: added SqliteTransaction.cs

	* Mono.Data.SqliteClient/SqliteConnection.cs:
	* Mono.Data.SqliteClient/SqliteTransaction.cs: patch from
	[email protected] that adds transactions support.

svn path=/trunk/mcs/; revision=28507
2004-05-30 20:50:33 +00:00
Gonzalo Paniagua Javier 370c785c91 2004-05-30 Gert Driesen ([email protected])
* SetWin32ContextInIDispatchAttribute.cs: only build
	for NET_2_0 profile
	* VariantWrapper.cs: only build for NET_2_0 profile

svn path=/trunk/mcs/; revision=28506
2004-05-30 20:42:47 +00:00
Ben Maurer 03fc690667 2004-05-30 Ben Maurer <[email protected]>
* expression.cs:
	According to the spec,

	In a member access of the form E.I, if E is a single identifier,
	and if the meaning of E as a simple-name (�7.5.2) is a constant,
	field, property, localvariable, or parameter with the same type as
	the meaning of E as a type-name (�3.8), then both possible
	meanings of E are permitted.

	We did not check that E as a simple-name had the same type as E as
	a type name.

	This trivial check gives us 5-7% on bootstrap time.

svn path=/trunk/mcs/; revision=28505
2004-05-30 20:37:58 +00:00
Ben Maurer 9027e9d1b2 add this
svn path=/trunk/mcs/; revision=28504
2004-05-30 20:33:08 +00:00
Atsushi Eno e21ad29117 2004-05-30 Atsushi Enomoto <[email protected]>
* RncTests.cs : fixed test that got impossible to build anymore.

svn path=/trunk/mcs/; revision=28503
2004-05-30 20:23:52 +00:00
Atsushi Eno 5cd74c6e93 2004-05-30 Atsushi Enomoto <[email protected]>
* RncParser.jay :
	  Now RncParser.Parse() returns RelaxngPattern, not RelaxngGrammar.
	  Fixed many "confusing RelaxngPattern and RelaxngPatternList"
	  problems, and ditto for other "List" stuff.
	  To avoid complex situations, mostly removed unused annotation stuff.

svn path=/trunk/mcs/; revision=28502
2004-05-30 20:23:26 +00:00
Atsushi Eno f03957145f 2004-05-30 Atsushi Enomoto <[email protected]>
* RelaxngDatatypeProvider.cs : removed meaningless using alias.
	* RelaxngGrammar.cs : modified ArrayList to RelaxngGrammarContentList.
	  RelaxngMergedProvider.cs : Added #if PNET switch to support non-
	  xmlschema available environment.
	* RelaxngPattern.cs : added IGrammarContent and
	  RelaxngGrammarContentList.

svn path=/trunk/mcs/; revision=28501
2004-05-30 20:22:51 +00:00
Miguel de Icaza 022f2a162c Start
svn path=/trunk/mono/; revision=28500
2004-05-30 20:18:01 +00:00
Martin Baulig 8bdc8dbbb8 2004-05-30 Martin Baulig <[email protected]>
* Makefile (net_2_0_dir): New variable; also use the correct
	directory here.

svn path=/trunk/mcs/; revision=28499
2004-05-30 19:52:04 +00:00
Marek Safar 86108c6777 2004-05-30 Marek Safar <[email protected]>
Fixed bug #59071 & cs0160.cs
	* statement.cs (Try.Resolve): Check here whether order of catch
	clauses matches their dependencies.

svn path=/trunk/mcs/; revision=28498
2004-05-30 19:51:00 +00:00
Sebastien Pouliot 782aff048c 2004-05-30 Sebastien Pouliot <[email protected]>
* FileStream.cs: Added missing validations.

svn path=/trunk/mcs/; revision=28497
2004-05-30 19:34:26 +00:00
Sebastien Pouliot 3666377b63 2004-05-30 Sebastien Pouliot <[email protected]>
* FileStream.cs: Lots of new tests for exception handling (negatives,
	disposed) and test reading a byte ast the end of the stream.

svn path=/trunk/mcs/; revision=28496
2004-05-30 19:18:50 +00:00
Atsushi Eno b20f049e63 2004-05-30 Atsushi Enomoto <[email protected]>
* DataTable.cs : serialization .ctor() should use XmlReadMode.DiffGram
	  for ReadXml(). Thanks to Boris.

svn path=/trunk/mcs/; revision=28495
2004-05-30 19:13:00 +00:00
Marek Safar 2f31aa3e43 2004-05-30 Marek Safar <[email protected]>
* cs1017.cs: New test.

svn path=/trunk/mcs/; revision=28494
2004-05-30 19:08:00 +00:00
Marek Safar b18d980fab 2004-05-30 Marek Safar <[email protected]>
Fixed bug #58624
	* ecore.cs (SimpleName.SimpleNameResolve): Added test for
	unsafe type.

svn path=/trunk/mcs/; revision=28493
2004-05-30 19:00:12 +00:00
Jackson Harper d857e242ab * AssemblyInfo.cs: Sign corlib for net_2_0 now too.
svn path=/trunk/mcs/; revision=28492
2004-05-30 17:58:43 +00:00
Sebastien Pouliot c716a7bd6f 2004-05-30 Sebastien Pouliot <[email protected]>
* BufferedStreamTest.cs: Added tests for Position after SetLength,
	SetLength after Close and Seek logic exception handling.
	* FileStream.cs: Added test for invalid SeekOrigin in Seek.
	* MemoryStream.cs: Added test for Seek after Close.

svn path=/trunk/mcs/; revision=28491
2004-05-30 17:58:09 +00:00
Sebastien Pouliot 50ad571d70 2004-05-30 Sebastien Pouliot <[email protected]>
* BufferedStream.cs: Fixed Seek logic (check for CanSeek and dispose).
	SetLength must also reset Position and check for dispose.
	* FileStream.cs: Added missing check for invalid SeekOrigin.

svn path=/trunk/mcs/; revision=28490
2004-05-30 17:52:35 +00:00
Jackson Harper 1fc3bcc2b8 * reflection.c: Do not hardcode assembly versions or public key
tokens anymore. All of this except the corlib section was dead
	code anyways.

svn path=/trunk/mono/; revision=28489
2004-05-30 17:19:24 +00:00
Martin Baulig 94abf32795 Small fix for NET_2_0.
svn path=/trunk/mcs/; revision=28488
2004-05-30 17:17:15 +00:00
Martin Baulig b47870a87b Small fix.
svn path=/trunk/mcs/; revision=28487
2004-05-30 17:04:33 +00:00
Martin Baulig 957bc1dbe3 Make things work again.
This should have been done during merging.

svn path=/trunk/mcs/; revision=28486
2004-05-30 16:59:41 +00:00
Martin Baulig a5d9b3f229 Fix typo (base_classs_type' -> base_class_type').
svn path=/trunk/mcs/; revision=28485
2004-05-30 16:20:02 +00:00
Martin Baulig 374bdf5cd7 Moved the marker.
svn path=/trunk/mcs/; revision=28484
2004-05-30 16:08:34 +00:00
Martin Baulig fee32a49f5 **** Merged from MCS ****
svn path=/trunk/mcs/; revision=28483
2004-05-30 16:06:13 +00:00
Ben Maurer c7f63eecba 2004-05-30 Ben Maurer <[email protected]>
* expression.cs (Invocation.OverloadResolve): Avoid the
	use of hashtables and boxing here by allocating on demand.

svn path=/trunk/mcs/; revision=28482
2004-05-30 15:48:50 +00:00
Martin Baulig 3920aa8c5c 2004-05-30 Martin Baulig <[email protected]>
* rootcontext.cs (RootContext.LookupType): Don't cache things if
	we're doing a silent lookup.  Don't try to lookup nested types in
	TypeManager.object_type (thanks to Ben Maurer).

svn path=/trunk/mcs/; revision=28481
2004-05-30 15:42:56 +00:00
Sebastien Pouliot 502882dde2 2004-05-30 Sebastien Pouliot <[email protected]>
* BinaryReader.cs: Added missing disposed check for most methods.
	Reordered some exceptions to match MS implementation.

svn path=/trunk/mcs/; revision=28480
2004-05-30 15:10:15 +00:00
Martin Baulig 6a30d9b3c6 2004-05-30 Martin Baulig <[email protected]>
Merged latest changes into gmcs.  Please keep this comment in
	here, it makes it easier for me to see what changed in MCS since
	the last time I merged.

svn path=/trunk/mcs/; revision=28477
2004-05-30 14:12:23 +00:00
Martin Baulig e1029c24e4 **** Merged from MCS ****
svn path=/trunk/mcs/; revision=28476
2004-05-30 14:10:53 +00:00
Martin Baulig e6971e6673 2004-05-30 Martin Baulig <[email protected]>
Committing a patch from Ben Maurer.

	* rootcontext.cs (RootContext.LookupType): Cache negative results.

svn path=/trunk/mcs/; revision=28475
2004-05-30 12:58:09 +00:00
Gonzalo Paniagua Javier 2f8403bcf4 *** empty log message ***
svn path=/trunk/mcs/; revision=28474
2004-05-30 11:57:18 +00:00
Gonzalo Paniagua Javier 83c5cdea3c 2004-05-30 Gonzalo Paniagua Javier <[email protected]>
* DateTime.cs: adjust milliseconds for fraction specifier ('f').

svn path=/trunk/mcs/; revision=28473
2004-05-30 11:45:33 +00:00
David Sheldon cd7a35cae1 2004-05-30 David Sheldon <[email protected]>
* StackFrameTest.cs: Mark the failures that have been failing
	for months due to bug 45730 as ignored as it doesn't look like
	it will be fixed soon.

My aim with these commits is that eventually people will run the test cases,
and see what errors they have caused, rather than tens of pages of stacktraces.

svn path=/trunk/mcs/; revision=28472
2004-05-30 08:23:00 +00:00
David Sheldon b03e7fffb8 2004-05-30 David Sheldon <[email protected]>
* DecimalTest.cs: Moved the rounding test that fails due to
    bug 37744 (bankers rounding) into its own test, and annotated it as ignored
    until the bug is fixed.

svn path=/trunk/mcs/; revision=28471
2004-05-30 08:02:01 +00:00
Miguel de Icaza 819395604c 2004-05-30 Miguel de Icaza <[email protected]>
* Console.cs: Remove *again* the version of WriteLine with four
	arguments;  That should *not* be added.

	Flag it as internal as people migrate their code.

svn path=/trunk/mcs/; revision=28469
2004-05-30 05:39:21 +00:00
Atsushi Eno 4fc67d1a14 2004-05-30 Atsushi Enomoto <[email protected]>
* XmlTextReader.cs : Fixed version mismatch; ProhibitDtd should be
	  NET_2_0.

svn path=/trunk/mcs/; revision=28468
2004-05-30 04:07:19 +00:00
Sebastien Pouliot 2c47c798a5 2004-05-29 Sebastien Pouliot <[email protected]>
* BinaryReader.cs: Added new cases to check exceptions thrown by Read
	methods.

svn path=/trunk/mcs/; revision=28467
2004-05-29 22:44:01 +00:00
Zoltan Varga 4a791732ff 2004-05-29 Zoltan Varga <[email protected]>
* invoke.cs: Add an Invoke test.

svn path=/trunk/mono/; revision=28465
2004-05-29 19:22:32 +00:00
Zoltan Varga a1e21f8406 2004-05-29 Zoltan Varga <[email protected]>
* object.c (mono_runtime_invoke_array): Automatically create boxed
	objects for byref valuetypes if needed. Fixes #59300.

svn path=/trunk/mono/; revision=28464
2004-05-29 19:20:49 +00:00
Sebastien Pouliot 942bdbd5f4 2004-05-29 Sebastien Pouliot <[email protected]>
* Convert.cs: Fixed ChangeTo where null could be misinterpreted
	between null and Empty.

svn path=/trunk/mcs/; revision=28462
2004-05-29 18:47:09 +00:00
Zoltan Varga ae63609233 2004-05-29 Zoltan Varga <[email protected]>
* object.c (mono_method_return_message_restore): Handle
	MONO_TYPE_OBJECT as well.

svn path=/trunk/mono/; revision=28461
2004-05-29 18:29:35 +00:00
Zoltan Varga 5e69101fb5 2004-05-29 Zoltan Varga <[email protected]>
* exceptions.cs: New regression tests.

	* jit-icalls.c (mono_llmult_ovf): Fix some boundary conditions.

svn path=/trunk/mono/; revision=28460
2004-05-29 18:16:08 +00:00
Sebastien Pouliot 71e6af6bfb 2004-05-29 Sebastien Pouliot <[email protected]>
* ConvertTest.cs: Added test to ChangeType to Empty.

svn path=/trunk/mcs/; revision=28459
2004-05-29 18:12:28 +00:00
Martin Baulig 4cb79d4939 2004-05-29 Martin Baulig <[email protected]>
* class.cs (IMethodData.ShouldIgnore): New method.

	* typemanager.cs (TypeManager.MethodFlags): Don't take a
	`Location' argument, we don't need it anywhere.  Use
	`IMethodData.ShouldIgnore ()' instead of
	`MethodData.GetMethodFlags ()'.
	(TypeManager.AddMethod): Removed.
	(TypeManager.AddMethod2): Renamed to AddMethod.

svn path=/trunk/mcs/; revision=28458
2004-05-29 18:03:07 +00:00
Martin Baulig c299d9423a 2004-05-29 Martin Baulig <[email protected]>
* test-266.cs: New test for #52578.

svn path=/trunk/mcs/; revision=28457
2004-05-29 17:41:42 +00:00
Martin Baulig 4b82041b60 2004-05-29 Martin Baulig <[email protected]>
Committing a patch from Benjamin Jemlich <[email protected]>.

	* convert.cs (Convert.ImplicitReferenceConversion): If we're
	converting from a class type S to an interface type and we already
	have an object on the stack, don't box it again.  Fixes #52578.

svn path=/trunk/mcs/; revision=28456
2004-05-29 17:40:21 +00:00
Martin Baulig fe699eac7f 2004-05-29 Martin Baulig <[email protected]>
* test-265.cs: New test for #59267.

svn path=/trunk/mcs/; revision=28455
2004-05-29 17:29:34 +00:00
Martin Baulig 1a336cbb03 2004-05-29 Martin Baulig <[email protected]>
* test-264.cs: New test for #59188.

svn path=/trunk/mcs/; revision=28454
2004-05-29 17:28:30 +00:00
Martin Baulig 6cb5277b61 2004-05-29 Martin Baulig <[email protected]>
* class.cs (ConstructorInitializer.GetOverloadedConstructor):
	Added support for `params' parameters.  Fixes #59267.

svn path=/trunk/mcs/; revision=28453
2004-05-29 17:27:57 +00:00
Sebastien Pouliot ac9098f000 2004-05-29 Sebastien Pouliot <[email protected]>
* Convert.cs: Fixed ToSByte(string,IFormatProvider) to throw
	ArgumentNullException (only case, all other returns 0). Fixed exception
	reporting for hex prefix only strings.

svn path=/trunk/mcs/; revision=28450
2004-05-29 16:56:04 +00:00
118 changed files with 2134 additions and 1263 deletions

No files matched your search

+4
View File
@@ -1,3 +1,7 @@
2004-05-31 Gonzalo Paniagua Javier <[email protected]>
* configure.in: fixlets for windows.
2004-05-29 Zoltan Varga <[email protected]>
* configure.in: export CC instead of passing it to libgc/configure.
+6 -2
View File
@@ -1,7 +1,7 @@
AC_INIT(README)
AC_CANONICAL_SYSTEM
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(mono,0.94)
AM_INIT_AUTOMAKE(mono,0.95)
AM_MAINTAINER_MODE
dnl
@@ -50,6 +50,9 @@ case "$host" in
libdl=
libgc_threads=win32
gc_default=boehm
with_nptl=no
with_sigaltstack=no
;;
*-*-*netbsd*)
platform_win32=no
@@ -898,6 +901,7 @@ if test x$platform_win32 = xno; then
AC_DEFINE_UNQUOTED(SIGVAL_PTR,$SIGVAL_PTR,[Pointer field name in 'union sigval'])
fi
else
jdk_headers_found=no
AC_CHECK_LIB(ws2_32, main, LIBS="$LIBS -lws2_32", AC_ERROR(bad mingw install?))
AC_CHECK_LIB(psapi, main, LIBS="$LIBS -lpsapi", AC_ERROR(bad mingw install?))
fi
@@ -949,7 +953,7 @@ case "{$target}" in
dnl Win32 does not have /dev/random, they have their own method...
*-*-mingw*|*-*-cygwin*)
ac_cv_have_dev_random = no
ac_cv_have_dev_random=no
;;
dnl Everywhere else, it's /dev/random
-246
View File
@@ -1,246 +0,0 @@
System.Object
System.Exception
System.ValueType
System.Delegate
System.MulticastDelegate
System.Enum
System.Activator
System.ArgIterator
System.__ComObject
System.TypedReference
System.Security.AllowPartiallyTrustedCallersAttribute
System.Runtime.Serialization.Formatter
System.Runtime.Serialization.FormatterConverter
System.Runtime.Serialization.FormatterServices
System.Runtime.Serialization.ObjectIDGenerator
System.Runtime.Serialization.ObjectManager
System.Reflection.ModuleResolveEventHandler
System.Reflection.Pointer
System.Globalization.CompareInfo
System.Globalization.HebrewCalendar
System.Globalization.HijriCalendar
System.Globalization.JapaneseCalendar
System.Globalization.KoreanCalendar
System.Globalization.SortKey
System.Globalization.StringInfo
System.Globalization.TaiwanCalendar
System.Globalization.TextElementEnumerator
System.Globalization.TextInfo
System.Globalization.ThaiBuddhistCalendar
System.IO.IsolatedStorage.IsolatedStorageFile
System.Reflection.Emit.MethodRental
System.Runtime.CompilerServices.AccessedThroughPropertyAttribute
System.Runtime.CompilerServices.CallConvCdecl
System.Runtime.CompilerServices.CallConvStdcall
System.Runtime.CompilerServices.CallConvThiscall
System.Runtime.CompilerServices.CallConvFastcall
System.Runtime.CompilerServices.CustomConstantAttribute
System.Runtime.CompilerServices.DateTimeConstantAttribute
System.Runtime.CompilerServices.DiscardableAttribute
System.Runtime.CompilerServices.DecimalConstantAttribute
System.Runtime.CompilerServices.CompilationRelaxationsAttribute
System.Runtime.CompilerServices.CompilerGlobalScopeAttribute
System.Runtime.CompilerServices.IDispatchConstantAttribute
System.Runtime.CompilerServices.IsVolatile
System.Runtime.CompilerServices.IUnknownConstantAttribute
System.Runtime.CompilerServices.RequiredAttributeAttribute
System.Runtime.InteropServices.ArrayWithOffset
System.Runtime.InteropServices.DispIdAttribute
System.Runtime.InteropServices.ClassInterfaceType
System.Runtime.InteropServices.ClassInterfaceAttribute
System.Runtime.InteropServices.ComVisibleAttribute
System.Runtime.InteropServices.LCIDConversionAttribute
System.Runtime.InteropServices.ComRegisterFunctionAttribute
System.Runtime.InteropServices.ComUnregisterFunctionAttribute
System.Runtime.InteropServices.ProgIdAttribute
System.Runtime.InteropServices.ImportedFromTypeLibAttribute
System.Runtime.InteropServices.IDispatchImplType
System.Runtime.InteropServices.IDispatchImplAttribute
System.Runtime.InteropServices.ComSourceInterfacesAttribute
System.Runtime.InteropServices.ComConversionLossAttribute
System.Runtime.InteropServices.TypeLibTypeFlags
System.Runtime.InteropServices.TypeLibFuncFlags
System.Runtime.InteropServices.TypeLibVarFlags
System.Runtime.InteropServices.TypeLibTypeAttribute
System.Runtime.InteropServices.TypeLibFuncAttribute
System.Runtime.InteropServices.TypeLibVarAttribute
System.Runtime.InteropServices.ComImportAttribute
System.Runtime.InteropServices.PreserveSigAttribute
System.Runtime.InteropServices.ComAliasNameAttribute
System.Runtime.InteropServices.AutomationProxyAttribute
System.Runtime.InteropServices.PrimaryInteropAssemblyAttribute
System.Runtime.InteropServices.CoClassAttribute
System.Runtime.InteropServices.ComEventInterfaceAttribute
System.Runtime.InteropServices.COMException
System.Runtime.InteropServices.ComMemberType
System.Runtime.InteropServices.CurrencyWrapper
System.Runtime.InteropServices.DispatchWrapper
System.Runtime.InteropServices.ErrorWrapper
System.Runtime.InteropServices.ExtensibleClassFactory
System.Runtime.InteropServices.HandleRef
System.Runtime.InteropServices.InvalidComObjectException
System.Runtime.InteropServices.InvalidOleVariantTypeException
System.Runtime.InteropServices.TypeLibImporterFlags
System.Runtime.InteropServices.ExporterEventKind
System.Runtime.InteropServices.ITypeLibExporterNotifySink
System.Runtime.InteropServices.ITypeLibConverter
System.Runtime.InteropServices.MarshalDirectiveException
System.Runtime.InteropServices.ObjectCreationDelegate
System.Runtime.InteropServices.RuntimeEnvironment
System.Runtime.InteropServices.RegistrationServices
System.Runtime.InteropServices.SafeArrayRankMismatchException
System.Runtime.InteropServices.SafeArrayTypeMismatchException
System.Runtime.InteropServices.SEHException
System.Runtime.InteropServices.TypeLibConverter
System.Runtime.InteropServices.BIND_OPTS
System.Runtime.InteropServices.UCOMIBindCtx
System.Runtime.InteropServices.UCOMIConnectionPointContainer
System.Runtime.InteropServices.UCOMIConnectionPoint
System.Runtime.InteropServices.UCOMIEnumMoniker
System.Runtime.InteropServices.CONNECTDATA
System.Runtime.InteropServices.UCOMIEnumConnections
System.Runtime.InteropServices.UCOMIEnumConnectionPoints
System.Runtime.InteropServices.UCOMIEnumString
System.Runtime.InteropServices.UCOMIEnumVARIANT
System.Runtime.InteropServices.FILETIME
System.Runtime.InteropServices.UCOMIMoniker
System.Runtime.InteropServices.UCOMIPersistFile
System.Runtime.InteropServices.UCOMIRunningObjectTable
System.Runtime.InteropServices.STATSTG
System.Runtime.InteropServices.UCOMIStream
System.Runtime.InteropServices.DESCKIND
System.Runtime.InteropServices.BINDPTR
System.Runtime.InteropServices.UCOMITypeComp
System.Runtime.InteropServices.TYPEKIND
System.Runtime.InteropServices.TYPEFLAGS
System.Runtime.InteropServices.IMPLTYPEFLAGS
System.Runtime.InteropServices.TYPEATTR
System.Runtime.InteropServices.FUNCDESC
System.Runtime.InteropServices.IDLFLAG
System.Runtime.InteropServices.IDLDESC
System.Runtime.InteropServices.PARAMFLAG
System.Runtime.InteropServices.PARAMDESC
System.Runtime.InteropServices.TYPEDESC
System.Runtime.InteropServices.ELEMDESC
System.Runtime.InteropServices.VARDESC
System.Runtime.InteropServices.DISPPARAMS
System.Runtime.InteropServices.EXCEPINFO
System.Runtime.InteropServices.FUNCKIND
System.Runtime.InteropServices.INVOKEKIND
System.Runtime.InteropServices.CALLCONV
System.Runtime.InteropServices.FUNCFLAGS
System.Runtime.InteropServices.VARFLAGS
System.Runtime.InteropServices.UCOMITypeInfo
System.Runtime.InteropServices.SYSKIND
System.Runtime.InteropServices.LIBFLAGS
System.Runtime.InteropServices.TYPELIBATTR
System.Runtime.InteropServices.UCOMITypeLib
System.Runtime.InteropServices.UnknownWrapper
System.Runtime.Remoting.IObjectHandle
System.Runtime.Remoting.IRemotingTypeInfo
System.Runtime.Remoting.IChannelInfo
System.Runtime.Remoting.IEnvoyInfo
System.Runtime.Remoting.RemotingConfiguration
System.Runtime.Remoting.TypeEntry
System.Runtime.Remoting.ActivatedClientTypeEntry
System.Runtime.Remoting.ActivatedServiceTypeEntry
System.Runtime.Remoting.WellKnownClientTypeEntry
System.Runtime.Remoting.WellKnownServiceTypeEntry
System.Runtime.Remoting.RemotingException
System.Runtime.Remoting.ServerException
System.Runtime.Remoting.RemotingTimeoutException
System.Runtime.Remoting.RemotingServices
System.Runtime.Remoting.InternalRemotingServices
System.Runtime.Remoting.SoapServices
System.Runtime.Remoting.Activation.UrlAttribute
System.Runtime.Remoting.Messaging.IMessageSink
System.Runtime.Remoting.Messaging.AsyncResult
System.Runtime.Remoting.Messaging.CallContext
System.Runtime.Remoting.Messaging.ILogicalThreadAffinative
System.Runtime.Remoting.Messaging.InternalMessageWrapper
System.Runtime.Remoting.Messaging.IMethodCallMessage
System.Runtime.Remoting.Messaging.MethodCallMessageWrapper
System.Runtime.Remoting.Messaging.HeaderHandler
System.Runtime.Remoting.Messaging.IMessageCtrl
System.Runtime.Remoting.Messaging.IRemotingFormatter
System.Runtime.Remoting.Messaging.ReturnMessage
System.Runtime.Remoting.Messaging.MethodCall
System.Runtime.Remoting.Messaging.ConstructionCall
System.Runtime.Remoting.Messaging.MethodResponse
System.Runtime.Remoting.Messaging.ConstructionResponse
System.Runtime.Remoting.Messaging.MethodReturnMessageWrapper
System.Runtime.Remoting.Messaging.OneWayAttribute
System.Runtime.Remoting.Messaging.MessageSurrogateFilter
System.Runtime.Remoting.Messaging.RemotingSurrogateSelector
System.Runtime.Remoting.Contexts.CrossContextDelegate
System.Runtime.Remoting.Contexts.ContextProperty
System.Runtime.Remoting.Contexts.IContextPropertyActivator
System.Runtime.Remoting.Contexts.IContributeClientContextSink
System.Runtime.Remoting.Contexts.IContributeDynamicSink
System.Runtime.Remoting.Contexts.IContributeEnvoySink
System.Runtime.Remoting.Contexts.IContributeObjectSink
System.Runtime.Remoting.Contexts.IContributeServerContextSink
System.Runtime.Serialization.Formatters.InternalRM
System.Runtime.Serialization.Formatters.InternalST
System.Runtime.Serialization.Formatters.SoapMessage
System.Runtime.Serialization.Formatters.SoapFault
System.Runtime.Serialization.Formatters.ServerFault
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
System.Security.Cryptography.CryptoConfig
System.Security.Cryptography.KeyedHashAlgorithm
System.Security.Cryptography.HMACSHA1
System.Security.Cryptography.MACTripleDES
System.Security.Cryptography.MaskGenerationMethod
System.Security.Cryptography.PasswordDeriveBytes
System.Security.Cryptography.PKCS1MaskGenerationMethod
System.Security.Cryptography.RC2
System.Security.Cryptography.RC2CryptoServiceProvider
System.Security.Cryptography.RSACryptoServiceProvider
System.Security.Cryptography.RSAOAEPKeyExchangeDeformatter
System.Security.Cryptography.RSAOAEPKeyExchangeFormatter
System.Security.Cryptography.RSAPKCS1KeyExchangeDeformatter
System.Security.Cryptography.RSAPKCS1KeyExchangeFormatter
System.Security.Cryptography.RSAPKCS1SignatureDeformatter
System.Security.Cryptography.RSAPKCS1SignatureFormatter
System.Security.Cryptography.SHA1Managed
System.Security.Cryptography.TripleDES
System.Security.Cryptography.TripleDESCryptoServiceProvider
System.Security.Permissions.EnvironmentPermission
System.Security.Permissions.FileDialogPermission
System.Security.Permissions.IsolatedStorageFilePermission
System.Security.Permissions.PrincipalPermissionAttribute
System.Security.Permissions.SecurityPermissionAttribute
System.Security.Permissions.PublisherIdentityPermissionAttribute
System.Security.Permissions.PublisherIdentityPermission
System.Security.Permissions.ReflectionPermission
System.Security.Permissions.RegistryPermission
System.Security.Permissions.PrincipalPermission
System.Security.Permissions.SiteIdentityPermission
System.Security.Permissions.StrongNameIdentityPermission
System.Security.Permissions.StrongNamePublicKeyBlob
System.Security.Permissions.UIPermission
System.Security.Permissions.UrlIdentityPermission
System.Security.Permissions.ZoneIdentityPermission
System.Security.Policy.ApplicationDirectory
System.Security.Policy.ApplicationDirectoryMembershipCondition
System.Security.Policy.FirstMatchCodeGroup
System.Security.Policy.Hash
System.Security.Policy.HashMembershipCondition
System.Security.Policy.NetCodeGroup
System.Security.Policy.PermissionRequestEvidence
System.Security.Policy.Publisher
System.Security.Policy.PublisherMembershipCondition
System.Security.Policy.Site
System.Security.Policy.SiteMembershipCondition
System.Security.Policy.StrongName
System.Security.Policy.StrongNameMembershipCondition
System.Security.Policy.UnionCodeGroup
System.Security.Policy.Url
System.Security.Policy.UrlMembershipCondition
System.Security.Policy.Zone
System.Security.Policy.ZoneMembershipCondition
System.Security.Principal.WindowsIdentity
System.Security.Principal.WindowsImpersonationContext
System.Security.Principal.WindowsPrincipal
System.Threading.CompressedStack
+16
View File
@@ -0,0 +1,16 @@
<h1>Mono 1.0 Release Notes</h1>
<h2>What does Mono Include</h2>
<h2>Missing functionality</h2>
<p>COM support.
<p>EnterpriseServices are non-existant.
<p>Windows.Forms is only available as a preview, it is not
completed nor stable.
<h3>Assembly: System.Drawing</h3>
<p>System.Drawing.Printing is not supported.
+5
View File
@@ -1,3 +1,8 @@
2004-05-30 Jackson Harper <[email protected]>
* library.make: Install to 2.0 package if building with the
net_2_0 profile.
2004-05-26 Gonzalo Paniagua Javier <[email protected]>
* library.make: reference nunti.core.dll and nunit.util.dll when
+2 -2
View File
@@ -43,13 +43,13 @@ gacutil = $(topdir)/tools/gacutil/gacutil.exe
PACKAGE = 1.0
ifeq ($(PROFILE), net_2_0)
PACKAGE = 1.1
PACKAGE = 2.0
endif
all-local: $(the_lib)
install-local: $(the_lib) $(gacutil)
$(RUNTIME) $(gacutil) /i $(the_lib) /f /root $(DESTDIR)$(prefix)/lib /package 1.0
$(RUNTIME) $(gacutil) /i $(the_lib) /f /root $(DESTDIR)$(prefix)/lib /package $(PACKAGE)
uninstall-local: $(gacutil)
$(RUNTIME) $(gacutil) /u $$(basename $(the_lib) .dll) ; \
@@ -1,3 +1,16 @@
2004-05-31 Atsushi Enomoto <[email protected]>
* RncParser.jay : now error output is disabled.
* RncTokenizer.cs : It should not be public class.
2004-05-30 Atsushi Enomoto <[email protected]>
* RncParser.jay :
Now RncParser.Parse() returns RelaxngPattern, not RelaxngGrammar.
Fixed many "confusing RelaxngPattern and RelaxngPatternList"
problems, and ditto for other "List" stuff.
To avoid complex situations, mostly removed unused annotation stuff.
2004-05-09 Atsushi Enomoto <[email protected]>
* RncParser.jay :
File diff suppressed because it is too large. Load diff
@@ -16,7 +16,7 @@ using Commons.Xml.Relaxng;
namespace Commons.Xml.Relaxng.Rnc
{
public class RncTokenizer : Commons.Xml.Relaxng.Rnc.yyParser.yyInput
internal class RncTokenizer : Commons.Xml.Relaxng.Rnc.yyParser.yyInput
{
TextReader source;
@@ -1,3 +1,22 @@
2004-05-31 Atsushi Enomoto <[email protected]>
* Misc.cs : made Util class internal.
* RelaxngDatatypeProvider.cs : looks commit was missing.
* RelaxngException.cs : made one .ctor() internal that accepts
RdpPattern.
* RelaxngNameClas.cs : Names list should not be settable.
* RelaxngPattern.cs : RelaxngRefPattern class is internal use only.
* RelaxngPatternType.cs : there is not "Include" pattern.
2004-05-30 Atsushi Enomoto <[email protected]>
* RelaxngDatatypeProvider.cs : removed meaningless using alias.
* RelaxngGrammar.cs : modified ArrayList to RelaxngGrammarContentList.
RelaxngMergedProvider.cs : Added #if PNET switch to support non-
xmlschema available environment.
* RelaxngPattern.cs : added IGrammarContent and
RelaxngGrammarContentList.
2004-03-17 Atsushi Enomoto <[email protected]>
* RelaxngNameClass.cs : Introduced RelaxngNameClassList class.
@@ -14,7 +14,7 @@ using Commons.Xml.Relaxng.Derivative;
namespace Commons.Xml.Relaxng
{
public class Util
internal class Util
{
public static string ResolveUri (string baseUri, string href)
{
@@ -10,9 +10,6 @@
using System;
using System.Xml;
using System.Xml.Schema;
using Commons.Xml.Relaxng.XmlSchema;
using XSchema = System.Xml.Schema.XmlSchema;
namespace Commons.Xml.Relaxng
{
@@ -22,7 +22,7 @@ namespace Commons.Xml.Relaxng
public RelaxngException (string message) : base (message) {}
public RelaxngException (string message, Exception innerException)
: base (message, innerException) {}
public RelaxngException (string message, RdpPattern invalidatedPattern)
internal RelaxngException (string message, RdpPattern invalidatedPattern)
: base (message)
{
debugXml = RdpUtil.DebugRdpPattern (invalidatedPattern, new Hashtable ());
@@ -23,10 +23,10 @@ namespace Commons.Xml.Relaxng
"http://relaxng.org/ns/structure/1.0";
// object model fields
ArrayList starts = new ArrayList ();
ArrayList defs = new ArrayList ();
ArrayList includes = new ArrayList ();
ArrayList divs = new ArrayList ();
RelaxngGrammarContentList starts = new RelaxngGrammarContentList ();
RelaxngGrammarContentList defs = new RelaxngGrammarContentList ();
RelaxngGrammarContentList includes = new RelaxngGrammarContentList ();
RelaxngGrammarContentList divs = new RelaxngGrammarContentList ();
RelaxngDatatypeProvider provider;
@@ -75,19 +75,19 @@ namespace Commons.Xml.Relaxng
get { return RelaxngPatternType.Grammar; }
}
public IList Starts {
public RelaxngGrammarContentList Starts {
get { return starts; }
}
public IList Defines {
public RelaxngGrammarContentList Defines {
get { return defs; }
}
public IList Includes {
public RelaxngGrammarContentList Includes {
get { return includes; }
}
public IList Divs {
public RelaxngGrammarContentList Divs {
get { return divs; }
}
@@ -20,8 +20,10 @@ namespace Commons.Xml.Relaxng
static RelaxngMergedProvider ()
{
RelaxngMergedProvider p = new RelaxngMergedProvider ();
#if !PNET
p ["http://www.w3.org/2001/XMLSchema-datatypes"] = XsdDatatypeProvider.Instance;
p [XSchema.Namespace] = XsdDatatypeProvider.Instance;
#endif
p [String.Empty] = RelaxngNamespaceDatatypeProvider.Instance;
defaultProvider = p;
}
@@ -260,7 +260,6 @@ namespace Commons.Xml.Relaxng
public RelaxngNameClassList Names {
get { return names; }
set { names = value; }
}
public override void Write (XmlWriter writer)
@@ -121,7 +121,11 @@ namespace Commons.Xml.Relaxng
#endregion
#region Grammatical elements
public class RelaxngStart : RelaxngElementBase
public interface IGrammarContent
{
}
public class RelaxngStart : RelaxngElementBase, IGrammarContent
{
RelaxngPattern p;
string combine;
@@ -155,7 +159,7 @@ namespace Commons.Xml.Relaxng
}
}
public class RelaxngDefine : RelaxngElementBase
public class RelaxngDefine : RelaxngElementBase, IGrammarContent
{
string name;
private RelaxngPatternList patterns = new RelaxngPatternList ();
@@ -211,12 +215,12 @@ namespace Commons.Xml.Relaxng
}
}
public class RelaxngInclude : RelaxngElementBase
public class RelaxngInclude : RelaxngElementBase, IGrammarContent
{
string href;
IList starts = new ArrayList ();
IList defines = new ArrayList ();
IList divs = new ArrayList ();
RelaxngGrammarContentList starts = new RelaxngGrammarContentList ();
RelaxngGrammarContentList defines = new RelaxngGrammarContentList ();
RelaxngGrammarContentList divs = new RelaxngGrammarContentList ();
string ns;
public RelaxngInclude ()
@@ -228,15 +232,15 @@ namespace Commons.Xml.Relaxng
set { href = value; }
}
public IList Starts {
public RelaxngGrammarContentList Starts {
get { return starts; }
}
public IList Defines {
public RelaxngGrammarContentList Defines {
get { return defines; }
}
public IList Divs {
public RelaxngGrammarContentList Divs {
get { return divs; }
}
@@ -292,7 +296,7 @@ namespace Commons.Xml.Relaxng
// starts.
if (this.Starts.Count > 0 && g.Starts.Count == 0)
throw new RelaxngException ("When the included grammar does not contain start components, this include component must not contain start components.");
IList appliedStarts = (this.starts.Count > 0) ?
RelaxngGrammarContentList appliedStarts = (this.starts.Count > 0) ?
this.starts : g.Starts;
RelaxngDiv div = new RelaxngDiv ();
@@ -325,30 +329,30 @@ namespace Commons.Xml.Relaxng
}
}
public class RelaxngDiv : RelaxngElementBase
public class RelaxngDiv : RelaxngElementBase, IGrammarContent
{
IList starts = new ArrayList ();
IList defines = new ArrayList ();
IList includes = new ArrayList ();
IList divs = new ArrayList ();
RelaxngGrammarContentList starts = new RelaxngGrammarContentList ();
RelaxngGrammarContentList defines = new RelaxngGrammarContentList ();
RelaxngGrammarContentList includes = new RelaxngGrammarContentList ();
RelaxngGrammarContentList divs = new RelaxngGrammarContentList ();
public RelaxngDiv ()
{
}
public IList Starts {
public RelaxngGrammarContentList Starts {
get { return starts; }
}
public IList Defines {
public RelaxngGrammarContentList Defines {
get { return defines; }
}
public IList Includes {
public RelaxngGrammarContentList Includes {
get { return includes; }
}
public IList Divs {
public RelaxngGrammarContentList Divs {
get { return divs; }
}
@@ -480,6 +484,33 @@ namespace Commons.Xml.Relaxng
}
}
public class RelaxngGrammarContentList : CollectionBase
{
public RelaxngGrammarContentList ()
{
}
public void Add (IGrammarContent p)
{
List.Add (p);
}
public IGrammarContent this [int i] {
get { return this.List [i] as IGrammarContent; }
set { this.List [i] = value; }
}
public void Insert (int pos, IGrammarContent p)
{
List.Insert (pos, p);
}
public void Remove (IGrammarContent p)
{
List.Remove (p);
}
}
// strict to say, it's not a pattern ;)
public class RelaxngNotAllowed : RelaxngPattern
{
@@ -1317,7 +1348,7 @@ namespace Commons.Xml.Relaxng
}
}
public class RelaxngRefPattern
internal class RelaxngRefPattern
{
RelaxngPattern patternRef;
string name;
@@ -36,7 +36,7 @@ namespace Commons.Xml.Relaxng
ZeroOrMore = 17, // no use in derivative
Mixed = 18, // no use in derivative
Optional = 19, // no use in derivative
Include = 20, // no use in derivative
// Include = 20, // no use in derivative
ExternalRef = 21, // no use in derivative
ParentRef = 22, // no use in derivative
}
@@ -1,3 +1,7 @@
2004-05-30 Atsushi Enomoto <[email protected]>
* RncTests.cs : fixed test that got impossible to build anymore.
2004-05-08 Gonzalo Paniagua Javier <[email protected]>
* RelaxngValidatingReaderTests.cs: this compiled with mcs but fails with
@@ -24,7 +24,7 @@ namespace MonoTests.Commons.Xml.Relaxng
{
RncParser parser = new RncParser (new NameTable ());
using (StreamReader sr = new StreamReader ("Test/XmlFiles/relaxng.rnc")) {
RelaxngGrammar g = parser.Parse (sr);
RelaxngPattern g = parser.Parse (sr);
g.Compile ();
}
}
@@ -1,3 +1,10 @@
2004-05-31 Atsushi Enomoto <[email protected]>
* anglia-test-runner.cs : Added support for RELAX NG compact syntax
parser tests.
* Makefile : added anglia-test support.
* README : ditto.
2004-02-25 Atsushi Enomoto <[email protected]>
* Added README, Makefile, relaxngtest.cs, prep.xsl, copying.html
@@ -1,26 +1,44 @@
RUNTIME = mono
MCS_RUNTIME =
MCS = mcs
TESTS = relax-ng/001/i.rng
TEST_ARCHIVE = testSuite.zip
RNCTESTS = test/RNCTest.xml
RNCTEST_ARCHIVE = anglia-test-suite.zip
all : relaxngtest.exe anglia-test-runner.exe
relaxngtest.exe : relaxngtest.cs $(TESTS)
$(MCS_RUNTIME) $(MCS) relaxngtest.cs -r:Commons.Xml.Relaxng.dll
$(MCS_RUNTIME) $(MCS) -debug+ relaxngtest.cs -r:Commons.Xml.Relaxng.dll
anglia-test-runner.exe : anglia-test-runner.cs $(RNCTESTS)
$(MCS_RUNTIME) $(MCS) -debug+ anglia-test-runner.cs -r:Commons.Xml.Relaxng.dll
$(TESTS) : $(TEST_ARCHIVE) relax-ng
cd relax-ng; unzip -n ../$(TEST_ARCHIVE); \
xsltproc split.xsl spectest.xml; cd ..; \
cp prep.xsl relax-ng
$(RNCTESTS) : $(RNCTEST_ARCHIVE)
unzip -n anglia-test-suite.zip
$(TEST_ARCHIVE) :
wget http://www.thaiopensource.com/relaxng/testSuite.zip
$(RNCTEST_ARCHIVE) :
wget http://www.jeffrafter.com/anglia/anglia-test-suite.zip
relax-ng:
mkdir relax-ng
test :
test : relaxngtest.exe
$(RUNTIME) relaxngtest.exe
anglia-test : anglia-test-runner.exe
$(RUNTIME) anglia-test-runner.exe
# be careful to use it. This removes ALL files in xml-test-suite!
# clean:
# rm -rf xml-test-suite
@@ -1,17 +1,41 @@
* standalone RELAX NG test program for the Test Suite
** Introduction
* Standalone test collection for Commons.Xml.Relaxng.dll
** standalone RELAX NG test program for the Test Suite
It is a test runner for James Clark's test collection.
prep.xsl is included in Jing (a Java implementation of RELAX NG validator).
copying.html is license information for prep.xsl and relaxng.rng.
prep.xsl is originally included in Jing (a Java implementation of RELAX NG
validator). copying.html is license information for prep.xsl and relaxng.rng.
** Usage
To set up test runner, you need xsltproc, which is included in libxslt.
** standalone RELAX NG Compact Syntax test program for the "anglia" test suite
It is a test runner for Jeff Rafter's "anglia" RNC test collection.
** How to build
NOTE: To set up test runner, you need xsltproc, which is included in libxslt.
(Since the stylesheet uses extensions, we cannot use our xslt engine.)
"make" will download the test collection from http://www.thaiopensource.com/relaxng/testSuite.zip , run xsltproc and create test directories and files.
"make" will do the same as "make relaxngtest.exe" and
"make anglia-test-runner.exe".
"make relaxngtest.exe" will download the test collection from
http://www.thaiopensource.com/relaxng/testSuite.zip and then run
xsltproc to split tests and create test directories and files, and finally
will compile relaxngtest.cs.
"make anglia-test-runner.exe" will download the test collection from
http://www.jeffrafter.com/anglia/anglia-test-suite.zip , and then will expand
that archive, and finally will compile anglia-test-runner.cs.
*** How to run
"make test" will run relaxngtest.exe and will output the error cases.
"make anglia-test" will run anglia-test-runner.exe and will output the
error cases.
"make test" will run the test program and will output the error cases.
@@ -0,0 +1,46 @@
using System;
using System.IO;
using System.Xml;
using Commons.Xml.Relaxng;
using Commons.Xml.Relaxng.Rnc;
public class Driver
{
public static void Main ()
{
try {
XmlDocument doc = new XmlDocument ();
doc.Load ("test/RNCTest.xml");
int success = 0;
int failure = 0;
foreach (XmlElement el in doc.SelectNodes ("/RNCTestCases/TestCase")) {
string id = el.GetAttribute ("id");
bool isValid = el.GetAttribute ("legal") == "true";
RncParser p = new RncParser (new NameTable ());
try {
string s = new StreamReader ("test" + Path.DirectorySeparatorChar + el.GetAttribute ("path")).ReadToEnd ();
p.Parse (new StringReader (s));
if (isValid) {
success++;
// Console.Error.WriteLine ("valid " + id);
} else {
failure++;
Console.Error.WriteLine ("INCORRECTLY VALID " + id);
}
} catch (Exception ex) {
if (isValid) {
failure++;
Console.Error.WriteLine ("INCORRECTLY INVALID " + id + " --> " + ex.Message);
} else {
success++;
// Console.Error.WriteLine ("invalid " + id);
}
}
}
Console.Error.WriteLine ("Total success: " + success);
Console.Error.WriteLine ("Total failure: " + failure);
} catch (Exception ex) {
Console.Error.WriteLine ("Unexpected Exception: " + ex);
}
}
}
@@ -1,3 +1,7 @@
2004-05-31 Rafael Teixeira <[email protected]>
* Financial.cs:
Correct IRR and MIRR method signatures and prevent public default constructor, all according to Class Status Page (corcompare)
2004-04-26 Rafael Teixeira <[email protected]>
* DateAndTime.cs:
Catch FormatException and rethrow as InvalidCastException in:
@@ -8,13 +8,15 @@
//
using System;
using Microsoft.VisualBasic.CompilerServices;
namespace Microsoft.VisualBasic
{
[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
[StandardModule]
sealed public class Financial {
// Declarations
// Constructors
private Financial() {} // prevent public default constructor
// Properties
// Methods
[MonoTODO]
@@ -24,9 +26,9 @@ namespace Microsoft.VisualBasic
[MonoTODO]
public static System.Double IPmt (System.Double Rate, System.Double Per, System.Double NPer, System.Double PV, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] System.Double FV, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] Microsoft.VisualBasic.DueDate Due) { throw new NotImplementedException (); }
[MonoTODO]
public static System.Double IRR (ref System.Double[] ValueArray, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0.1)] ref System.Double Guess) { throw new NotImplementedException (); }
public static System.Double IRR (ref System.Double[] ValueArray, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0.1)] System.Double Guess) { throw new NotImplementedException (); }
[MonoTODO]
public static System.Double MIRR (ref System.Double[] ValueArray, ref System.Double FinanceRate, ref System.Double ReinvestRate) { throw new NotImplementedException (); }
public static System.Double MIRR (ref System.Double[] ValueArray, System.Double FinanceRate, System.Double ReinvestRate) { throw new NotImplementedException (); }
[MonoTODO]
public static System.Double NPer (System.Double Rate, System.Double Pmt, System.Double PV, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] System.Double FV, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] Microsoft.VisualBasic.DueDate Due) { throw new NotImplementedException (); }
[MonoTODO]
@@ -1,3 +1,11 @@
2004-05-30 Gonzalo Paniagua Javier <[email protected]>
* Mono.Data.SqliteClient.dll.sources: added SqliteTransaction.cs
* Mono.Data.SqliteClient/SqliteConnection.cs:
* Mono.Data.SqliteClient/SqliteTransaction.cs: patch from
[email protected] that adds transactions support.
2004-04-29 Gonzalo Paniagua Javier <[email protected]>
* Mono.Data.SqliteClient/SqliteCommand.cs: implement LastInsertRowId.
@@ -5,3 +5,4 @@ Mono.Data.SqliteClient/SqliteConnection.cs
Mono.Data.SqliteClient/SqliteDataReader.cs
Mono.Data.SqliteClient/SqliteParameter.cs
Mono.Data.SqliteClient/SqliteParameterCollection.cs
Mono.Data.SqliteClient/SqliteTransaction.cs
@@ -174,8 +174,16 @@ namespace Mono.Data.SqliteClient
}
public IDbTransaction BeginTransaction ()
{
return null;
{
if (state != ConnectionState.Open)
throw new InvalidOperationException("Invalid operation: The connection is close");
SqliteTransaction t = new SqliteTransaction();
t.Connection = this;
SqliteCommand cmd = this.CreateCommand();
cmd.CommandText = "BEGIN";
cmd.ExecuteNonQuery();
return t;
}
public IDbTransaction BeginTransaction (IsolationLevel il)
@@ -0,0 +1,94 @@
// Mono.Data.SqliteClient data access components for .Net
// Derived from ByteFX.Data
// With permission from Reggie Burnett to relicense under MIT/X11
using System;
using System.Data;
namespace Mono.Data.SqliteClient
{
/// <summary>
/// Represents a SQL transaction to be made in a Sqlite database. This class cannot be inherited.
/// </summary>
public sealed class SqliteTransaction : IDbTransaction
{
private IsolationLevel _level;
private SqliteConnection _conn;
private bool _open;
internal SqliteTransaction()
{
_open = true;
}
#region Properties
/// <summary>
/// Gets the <see cref="SqliteConnection"/> object associated with the transaction, or a null reference (Nothing in Visual Basic) if the transaction is no longer valid.
/// </summary>
public IDbConnection Connection
{
get { return _conn; }
set { _conn = (SqliteConnection)value; }
}
/// <summary>
/// Specifies the <see cref="IsolationLevel"/> for this transaction.
/// </summary>
public IsolationLevel IsolationLevel
{
get { return _level; }
set { _level = value; }
}
#endregion
void System.IDisposable.Dispose()
{
}
/// <summary>
/// Commits the database transaction.
/// </summary>
public void Commit()
{
if (_conn == null || _conn.State != ConnectionState.Open)
throw new InvalidOperationException("Connection must be valid and open to commit transaction");
if (!_open)
throw new InvalidOperationException("Transaction has already been committed or is not pending");
try
{
SqliteCommand cmd = _conn.CreateCommand();
cmd.CommandText = "COMMIT";
cmd.ExecuteNonQuery();
_open = false;
}
catch (Exception ex)
{
throw ex;
}
}
/// <summary>
/// Overloaded. Rolls back a transaction from a pending state.
/// </summary>
public void Rollback()
{
if (_conn == null || _conn.State != ConnectionState.Open)
throw new InvalidOperationException("Connection must be valid and open to commit transaction");
if (!_open)
throw new InvalidOperationException("Transaction has already been rolled back or is not pending");
try
{
SqliteCommand cmd = _conn.CreateCommand();
cmd.CommandText = "COMMIT";
cmd.ExecuteNonQuery();
_open = false;
}
catch (Exception ex)
{
throw ex;
}
}
}
}
+7
View File
@@ -1,3 +1,10 @@
2004-05-31 Rafael Teixeira <[email protected]>
* OptionDetails.cs : ShortForm member now a string to favor some simplifications, fixes for Bug 58672
* OptionList.cs : Fixes for Bug 58672 and better handling for mixed-form options (linux/windows)
2004-05-31 Rafael Teixeira <[email protected]>
* OptionDetails.cs: Assemble an one-line authors' list in about processor (also abandon after about)
2004-04-08 Rafael Teixeira <[email protected]>
* OptionDetails.cs: Implemented Jonathan Pryor request for multiplicity in boolean properties
+20 -29
View File
@@ -28,13 +28,14 @@ namespace Mono.GetOptions
internal class OptionDetails : IComparable
{
public char ShortForm;
public string ShortForm;
public string LongForm;
public string AlternateForm;
public string ShortDescription;
public bool NeedsParameter;
public int MaxOccurs; // negative means there is no limit
public int Occurs;
public bool BooleanOption;
public Options OptionBundle;
public MemberInfo MemberInfo;
public ArrayList Values;
@@ -74,6 +75,7 @@ namespace Mono.GetOptions
// TODO: Yet not that good
string shortPrefix;
string longPrefix;
bool hasLongForm = (this.LongForm != null && this.LongForm != string.Empty);
if(this.OptionBundle.ParsingMode == Mono.GetOptions.OptionsParsingMode.Windows)
{
shortPrefix = "/";
@@ -85,11 +87,11 @@ namespace Mono.GetOptions
longPrefix = "--";
}
optionHelp = " ";
optionHelp += (this.ShortForm != ' ') ? shortPrefix+this.ShortForm+" " : " ";
optionHelp += (this.LongForm != string.Empty && this.LongForm != null) ? longPrefix+this.LongForm : "";
optionHelp += (this.ShortForm != string.Empty) ? shortPrefix+this.ShortForm+" " : " ";
optionHelp += hasLongForm ? longPrefix+this.LongForm : "";
if (NeedsParameter)
{
if (this.LongForm != string.Empty && this.LongForm != null)
if (hasLongForm)
optionHelp += ":";
optionHelp += ParamName;
}
@@ -125,12 +127,13 @@ namespace Mono.GetOptions
public OptionDetails(MemberInfo memberInfo, OptionAttribute option, Options optionBundle)
{
this.ShortForm = option.ShortForm;
this.ShortForm = ("" + option.ShortForm).Trim();
this.LongForm = (option.LongForm == string.Empty)? memberInfo.Name:option.LongForm;
this.AlternateForm = option.AlternateForm;
this.ShortDescription = option.ShortDescription;
this.Occurs = 0;
this.OptionBundle = optionBundle;
this.BooleanOption = false;
this.MemberInfo = memberInfo;
this.NeedsParameter = false;
this.Values = null;
@@ -166,6 +169,7 @@ namespace Mono.GetOptions
}
else
{
this.BooleanOption = true;
if (option.MaxOccurs != 1)
{
if (this.MemberInfo is MethodInfo || this.MemberInfo is PropertyInfo)
@@ -180,7 +184,7 @@ namespace Mono.GetOptions
internal string Key
{
get { return ((this.ShortForm != ' ') ? this.ShortForm + "" : "") + this.LongForm; }
get { return this.ShortForm + this.LongForm; }
}
int IComparable.CompareTo(object other)
@@ -217,7 +221,7 @@ namespace Mono.GetOptions
throw new IndexOutOfRangeException("Option " + ShortForm + " can be used at most " + MaxOccurs + " times");
}
private void DoIt()
private void DoIt(bool setValue)
{
if (!NeedsParameter)
{
@@ -228,12 +232,12 @@ namespace Mono.GetOptions
if (MemberInfo is FieldInfo)
{
((FieldInfo)MemberInfo).SetValue(OptionBundle, true);
((FieldInfo)MemberInfo).SetValue(OptionBundle, setValue);
return;
}
if (MemberInfo is PropertyInfo)
{
((PropertyInfo)MemberInfo).SetValue(OptionBundle, true, null);
((PropertyInfo)MemberInfo).SetValue(OptionBundle, setValue, null);
return;
}
if ((WhatToDoNext)((MethodInfo)MemberInfo).Invoke(OptionBundle, null) == WhatToDoNext.AbandonProgram)
@@ -287,17 +291,12 @@ namespace Mono.GetOptions
}
}
private bool StartsLikeAnOption(string arg)
{
return (arg != null && arg[0] == '-');
}
private bool IsThisOption(string arg)
{
if (StartsLikeAnOption(arg))
if (arg != null && arg != string.Empty)
{
arg = arg.TrimStart('-');
return (arg == "" + ShortForm || arg == LongForm || arg == AlternateForm);
arg = arg.TrimStart('-', '/');
return (arg == ShortForm || arg == LongForm || arg == AlternateForm);
}
return false;
}
@@ -308,27 +307,19 @@ namespace Mono.GetOptions
{
if (!NeedsParameter)
{
DoIt();
DoIt(true); // in preparation for vbc-like booleans
return OptionProcessingResult.OptionAlone;
}
else
{
if (StartsLikeAnOption(nextArg))
{
DoIt(null);
return OptionProcessingResult.OptionAlone;
}
else
{
DoIt(nextArg);
return OptionProcessingResult.OptionConsumedParameter;
}
DoIt(nextArg);
return OptionProcessingResult.OptionConsumedParameter;
}
}
if (IsThisOption(arg + ":" + nextArg))
{
DoIt();
DoIt(true);
return OptionProcessingResult.OptionConsumedParameter;
}
+29 -31
View File
@@ -10,6 +10,7 @@ using System;
using System.Collections;
using System.IO;
using System.Reflection;
using System.Text;
namespace Mono.GetOptions
{
@@ -48,6 +49,12 @@ namespace Mono.GetOptions
private ArrayList argumentsTail = new ArrayList();
private MethodInfo argumentProcessor = null;
internal bool MaybeAnOption(string arg)
{
return ((parsingMode & OptionsParsingMode.Windows) > 0 && arg[0] == '/') ||
((parsingMode & OptionsParsingMode.Linux) > 0 && arg[0] == '-');
}
public string Usage
{
get
@@ -189,10 +196,17 @@ namespace Mono.GetOptions
{
ShowTitleLines();
Console.WriteLine(appAboutDetails);
Console.WriteLine();
Console.WriteLine("Authors:");
StringBuilder sb = new StringBuilder("Authors: ");
bool first = true;
foreach(string s in appAuthors)
Console.WriteLine ("\t" + s);
{
if (first)
first = false;
else
sb.Append(", ");
sb.Append(s);
}
Console.WriteLine(sb.ToString());
}
private void ShowHelp()
@@ -209,7 +223,7 @@ namespace Mono.GetOptions
Console.WriteLine(Usage);
Console.Write("Short Options: ");
foreach (OptionDetails option in list)
Console.Write((option.ShortForm != ' ') ? option.ShortForm.ToString() : "");
Console.Write(option.ShortForm.Trim());
Console.WriteLine();
}
@@ -229,7 +243,7 @@ namespace Mono.GetOptions
internal WhatToDoNext DoAbout()
{
ShowAbout();
return WhatToDoNext.GoAhead;
return WhatToDoNext.AbandonProgram;
}
internal WhatToDoNext DoHelp()
@@ -296,35 +310,19 @@ namespace Mono.GetOptions
continue;
}
if (arg[0] == '/')
if ((parsingMode & OptionsParsingMode.Linux) > 0 &&
arg[0] == '-' && arg[1] != '-' &&
breakSingleDashManyLettersIntoManyOptions)
{
if ((parsingMode & OptionsParsingMode.Windows) > 0)
{
string newArg = '-' + arg.TrimStart('/');
result.AddRange(newArg.Split(':'));
continue;
}
foreach(char c in arg.Substring(1)) // many single-letter options
result.Add("-" + c); // expand into individualized options
continue;
}
if ((parsingMode & OptionsParsingMode.Linux) > 0)
if (MaybeAnOption(arg))
{
if ((arg[0] == '-') && (arg[1] != '-'))
{
if (breakSingleDashManyLettersIntoManyOptions)
{
foreach(char c in arg.Substring(1)) // many single-letter options
result.Add("-" + c); // expand into individualized options
}
else
result.Add(arg);
continue;
}
if (arg.StartsWith("--"))
{
result.AddRange(arg.Split('=')); // put in the same form of one-letter options with a parameter
continue;
}
result.AddRange(arg.Split(':','='));
continue;
}
}
else
@@ -364,7 +362,7 @@ namespace Mono.GetOptions
OptionWasProcessed = false;
if (arg.StartsWith("-"))
if (arg.StartsWith("-") || arg.StartsWith("/"))
{
foreach(OptionDetails option in list)
{
@@ -30,7 +30,11 @@ namespace System.Data.Common {
[Obsolete ("use DBDataPermission (PermissionState.None)", true)]
#endif
protected DBDataPermission ()
#if NET_2_0
: this (PermissionState.None)
#else
: this (PermissionState.None, false)
#endif
{
}
@@ -30,7 +30,11 @@ namespace System.Data.SqlClient {
[Obsolete ("Use SqlClientPermission(PermissionState.None)", true)]
public SqlClientPermission ()
#if NET_2_0
: this (PermissionState.None)
#else
// : this (PermissionState.None, false)
#endif
{
}
@@ -41,6 +45,9 @@ namespace System.Data.SqlClient {
[Obsolete ("Use SqlClientPermission(PermissionState.None)", true)]
public SqlClientPermission (PermissionState state, bool allowBlankPassword)
#if NET_2_0
: this (state)
#endif
{
AllowBlankPassword = allowBlankPassword;
}
@@ -1,3 +1,23 @@
2004-05-31 Atsushi Enomoto <[email protected]>
* XmlDataInferenceLoader.cs : Fixed GetMappedTable() that incorrectly
rejected same-named tables in different hierarchy. Thanks to Boris.
2004-05-31 Atsushi Enomoto <[email protected]>
* XmlDiffLoader.cs : Added some Skip() that is required not to go to
infinite loop. Thanks to Boris for this fix.
2004-05-31 Atsushi Enomoto <[email protected]>
* XmlDataInferenceLoader.cs : XmlSchema elements should not be infered.
Thanks to Boris for this fix.
2004-05-30 Atsushi Enomoto <[email protected]>
* DataTable.cs : serialization .ctor() should use XmlReadMode.DiffGram
for ReadXml(). Thanks to Boris.
2004-05-27 Boris Kirzner <[email protected]>
* DataRow.cs :
- CheckReadOnlyStatus : use typed (and faster comparing).
@@ -141,7 +141,7 @@ namespace System.Data {
ds.Tables [0].CopyProperties (this);
ds = new DataSet ();
ds.Tables.Add (this);
ds.ReadXml (new StringReader (data), XmlReadMode.IgnoreSchema);
ds.ReadXml (new StringReader (data), XmlReadMode.DiffGram);
ds.Tables.Remove (this);
/* keeping for a while. With the change above, we shouldn't have to consider
* DataTable mode in schema inference/read.
@@ -15,6 +15,7 @@ using System.Data;
using System.IO; // for Driver
using System.Text; // for Driver
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;
namespace System.Data
@@ -165,9 +166,12 @@ namespace System.Data
dataset.DataSetName = localName;
dataset.Namespace = el.NamespaceURI;
dataset.Prefix = el.Prefix;
foreach (XmlNode n in el.ChildNodes)
foreach (XmlNode n in el.ChildNodes) {
if (n.NamespaceURI == XmlSchema.Namespace)
continue;
if (n.NodeType == XmlNodeType.Element)
InferTopLevelTable (n as XmlElement);
}
}
foreach (TableMapping map in tables) {
@@ -374,7 +378,7 @@ namespace System.Data
{
TableMapping map = tables [tableName];
if (map != null) {
if (map.ParentTable != parent)
if (parent != null && map.ParentTable != null && map.ParentTable != parent)
throw new DataException (String.Format ("The table {0} is already allocated as another table's child table.", tableName));
} else {
map = new TableMapping (tableName, ns);
@@ -93,8 +93,10 @@ namespace System.Data {
private void LoadCurrent (XmlReader reader)
{
if (reader.IsEmptyElement) return;
if (reader.IsEmptyElement) {
reader.Skip ();
return;
}
reader.ReadStartElement (); // Dataset root
reader.MoveToContent ();
@@ -122,8 +124,10 @@ namespace System.Data {
private void LoadBefore (XmlReader reader)
{
if (reader.IsEmptyElement) return;
if (reader.IsEmptyElement) {
reader.Skip ();
return;
}
reader.ReadStartElement ();
reader.MoveToContent ();
@@ -147,8 +151,10 @@ namespace System.Data {
private void LoadErrors (XmlReader reader)
{
if (reader.IsEmptyElement) return;
if (reader.IsEmptyElement) {
reader.Skip ();
return;
}
reader.ReadStartElement ();
reader.MoveToContent ();
@@ -184,8 +190,10 @@ namespace System.Data {
private void LoadColumns (DataTable Table, DataRow Row, XmlReader reader, DataRowVersion loadType)
{
if (reader.IsEmptyElement) return;
if (reader.IsEmptyElement) {
reader.Skip ();
return;
}
reader.ReadStartElement ();
reader.MoveToContent ();
@@ -1,3 +1,9 @@
2004-05-31 Atsushi Enomoto <[email protected]>
* DataTableTest.cs : Added test for serialization by Boris Kirzner.
* DataSetInferXmlSchemaTest.cs : Added test for schema element skip
by Boris Kirzner.
2004-05-27 Nick Drochak <[email protected]>
* DataRelationCollectionTest.cs: Fixed build when using csc.
@@ -475,5 +475,35 @@ namespace MonoTests.System.Data
// a:foo is ignored
AssertDataTable ("dt", ds.Tables [0], "root", 1, 0, 0, 0, 0, 0);
}
[Test]
public void ContainsSchema ()
{
DataSet ds = new DataSet();
DataTable dt1 = new DataTable();
ds.Tables.Add(dt1);
DataColumn dc1 = new DataColumn("Col1");
dt1.Columns.Add(dc1);
dt1.Rows.Add(new string[] { "aaa" } );
DataTable dt2 = new DataTable();
ds.Tables.Add(dt2);
DataColumn dc2 = new DataColumn("Col2");
dt2.Columns.Add(dc2);
dt2.Rows.Add(new string[] { "bbb" } );
DataRelation rel = new DataRelation("Rel1",dc1,dc2,false);
ds.Relations.Add(rel);
StringWriter sw = new StringWriter ();
ds.WriteXml(sw, XmlWriteMode.WriteSchema);
ds = new DataSet();
ds.ReadXml(new StringReader (sw.ToString ()));
sw = new StringWriter ();
ds.WriteXml(sw);
XmlDocument doc = new XmlDocument ();
doc.LoadXml (sw.ToString ());
AssertEquals (2, doc.DocumentElement.ChildNodes.Count);
}
}
}
@@ -12,6 +12,9 @@ using NUnit.Framework;
using System;
using System.Data;
using System.Globalization;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Xml;
namespace MonoTests.System.Data
{
@@ -1169,5 +1172,54 @@ namespace MonoTests.System.Data
#endif
AssertEquals ("#A05", 0, table.ChildRelations.Count);
}
[Test]
public void Serialize ()
{
MemoryStream fs = new MemoryStream ();
// Construct a BinaryFormatter and use it
// to serialize the data to the stream.
BinaryFormatter formatter = new BinaryFormatter();
// Create an array with multiple elements refering to
// the one Singleton object.
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("Id", typeof(string)));
dt.Columns.Add(new DataColumn("ContactName", typeof(string)));
dt.Columns.Add(new DataColumn("ContactTitle", typeof(string)));
dt.Columns.Add(new DataColumn("ContactAreaCode", typeof(string)));
dt.Columns.Add(new DataColumn("ContactPhone", typeof(string)));
DataRow loRowToAdd;
loRowToAdd = dt.NewRow();
loRowToAdd[0] = "a";
loRowToAdd[1] = "b";
loRowToAdd[2] = "c";
loRowToAdd[3] = "d";
loRowToAdd[4] = "e";
dt.Rows.Add(loRowToAdd);
DataTable[] dtarr = new DataTable[] {dt};
// Serialize the array elements.
formatter.Serialize(fs, dtarr);
// Deserialize the array elements.
fs.Position = 0;
DataTable[] a2 = (DataTable[]) formatter.Deserialize(fs);
DataSet ds = new DataSet();
ds.Tables.Add(a2[0]);
StringWriter sw = new StringWriter ();
ds.WriteXml(sw);
XmlDocument doc = new XmlDocument ();
doc.LoadXml (sw.ToString ());
AssertEquals (5, doc.DocumentElement.FirstChild.ChildNodes.Count);
}
}
}
@@ -1,3 +1,9 @@
2004-05-31 Ravindra <[email protected]>
* pie.cs: Made the output image little organized and added a
case where DrawPie and FillPie were crashing the system. It
was happening with zero degree sweep angle.
2004-05-04 Ravindra <[email protected]>
* ImageRotateFlip.cs: Changed text color from white to
@@ -17,7 +17,7 @@ public class graphicsUI
public static void Main ()
{
Bitmap bmp = new Bitmap (300, 300);
Bitmap bmp = new Bitmap (400, 600);
Graphics dc = Graphics.FromImage (bmp);
// Clears and set the background color to red
@@ -28,34 +28,44 @@ public class graphicsUI
SolidBrush yellowBrush = new SolidBrush (Color.Yellow);
SolidBrush whiteBrush = new SolidBrush (Color.White);
Pen bluePen = new Pen (Color.Blue);
Rectangle rect1 = new Rectangle (0,0, 75, 75);
dc.DrawPie (bluePen, rect1, 10, 60);
Rectangle rect2 = new Rectangle (100,100, 75, 75);
dc.DrawPie (bluePen, rect2, 100, 75);
Rectangle rect2a = new Rectangle (100, 200, 75, 75);
dc.DrawPie (bluePen, rect2a, 100, 400);
// We have a column starting at x=50 for Draw operations
// and another column starting at x=200 for Fill operations.
// Both the columns grow downwards.
// Column 1
Rectangle rect11 = new Rectangle (50, 0, 75, 75);
dc.DrawPie (bluePen, rect11, 10, 60);
Rectangle rect3 = new Rectangle (100, 0, 75, 75);
dc.FillPie (yellowBrush, rect3, 0, 300);
Rectangle rect12 = new Rectangle (50,100, 75, 75);
dc.DrawPie (bluePen, rect12, 100, 75);
Rectangle rect13 = new Rectangle (50, 200, 75, 75);
dc.DrawPie (bluePen, rect13, 100, 400);
Rectangle rect14 = new Rectangle (50, 300, 75, 75);
dc.DrawPie (bluePen, rect14, 0, 0);
// Column 2
Rectangle rect21 = new Rectangle (200, 0, 75, 75);
dc.FillPie (yellowBrush, rect21, 0, 300);
Rectangle rect4 = new Rectangle (0, 100, 75, 75);
dc.FillPie (whiteBrush, rect4, 200, 30);
Rectangle rect22 = new Rectangle (200, 100, 75, 75);
dc.FillPie (whiteBrush, rect22, 200, 30);
Rectangle rect4a = new Rectangle (0, 100, 75, 75);
dc.FillPie (whiteBrush, rect4a, 200, 400);
Rectangle rect23 = new Rectangle (200, 200, 75, 75);
dc.FillPie (whiteBrush, rect23, 200, 400);
Rectangle rect5 = new Rectangle (200, 0, 75, 75);
dc.FillPie (yellowBrush, rect5, 190, 300);
Rectangle rect24 = new Rectangle (200, 300, 75, 75);
dc.FillPie (yellowBrush, rect24, 190, 300);
Rectangle rect6 = new Rectangle (200, 100, 75, 75);
dc.FillPie (whiteBrush, rect6, 200, 20);
Rectangle rect25 = new Rectangle (200, 400, 75, 75);
dc.FillPie (whiteBrush, rect25, 200, 20);
bmp.Save("fillpie.png", ImageFormat.Png); 
}
Rectangle rect26 = new Rectangle (200, 500, 75, 75);
dc.FillPie (yellowBrush, rect26, 50, 0);
bmp.Save("fillpie.png", ImageFormat.Png);
}
}
@@ -1,3 +1,8 @@
2004-05-31 Atsushi Enomoto <[email protected]>
* SignedXml.cs : partial fix for bug #59165 that does not output
namespace that conflicts with element's namespace.
2004-05-13 Sebastien Pouliot <[email protected]>
* SignedXml.cs: Update TODO informations.
@@ -315,9 +315,10 @@ namespace System.Security.Cryptography.Xml {
continue;
if (attr.LocalName == "xml")
continue;
if (attr.Prefix == el.Prefix)
continue;
attr.WriteTo (xtw);
}
foreach (XmlNode attr in el.Attributes)
attr.WriteTo (xtw);
foreach (XmlNode n in el.ChildNodes)
@@ -1,3 +1,8 @@
2004-05-30 Atsushi Enomoto <[email protected]>
* XmlTextReader.cs : Fixed version mismatch; ProhibitDtd should be
NET_2_0.
2004-05-29 Gert Driesen ([email protected])
* XmlTextReader.cs: Added ProhibitDtd property for NET 1.1 to match
@@ -252,7 +252,7 @@ namespace System.Xml
get { return cursorToken.Prefix; }
}
#if NET_1_1
#if NET_2_0
[MonoTODO ("Not documented in .NET SDK")]
public bool ProhibitDtd {
@@ -955,7 +955,7 @@ namespace System.Xml
private WhitespaceHandling whitespaceHandling = WhitespaceHandling.All;
private XmlResolver resolver = new XmlUrlResolver ();
private bool normalization = false;
#if NET_1_1
#if NET_2_0
private bool prohibitDtd = false;
#endif
+2 -6
View File
@@ -44,9 +44,5 @@ using System.Runtime.InteropServices;
[assembly: AllowPartiallyTrustedCallers]
[assembly: Guid("BED7F4EA-1A96-11D2-8F08-00A0C9A6186D")]
#if ! NET_2_0 && ! BOOTSTRAP_NET_2_0
#if ! BOOTSTRAP_WITH_OLDLIB
[assembly: AssemblyDelaySign(true)]
[assembly: AssemblyKeyFile("../ecma.pub")]
#endif
#endif
[assembly: AssemblyDelaySign(true)]
[assembly: AssemblyKeyFile("../ecma.pub")]
+4
View File
@@ -1,3 +1,7 @@
2004-05-29 Jackson Harper <[email protected]>
* AssemblyInfo.cs: Sign corlib for net_2_0 now too.
2004-05-26 Jordi Mas <[email protected]>
* AssemblyInfo.cs: fixes CS1024: Preprocessor directive expected
+5
View File
@@ -1,3 +1,8 @@
2004-05-30 Martin Baulig <[email protected]>
* Makefile (net_2_0_dir): New variable; also use the correct
directory here.
2004-05-29 Gert Driesen ([email protected])
* corlib.dll.sources: added SetWin32ContextInIDispatchAttribute
+8 -6
View File
@@ -38,6 +38,8 @@ stampfile = $(depsdir)/$(PROFILE)_corlib.dll.stamp
#corlib_flags = /unsafe /nostdlib /d:INSIDE_CORLIB
corlib_flags = /unsafe /nostdlib
net_2_0_dir = $(DESTDIR)$(prefix)/lib/mono/2.0
net_2_0_bootstrap_response = $(depsdir)/corlib_net_2_0_bootstrap.dll.response
net_2_0_bootstrap_makefrag = $(depsdir)/corlib_net_2_0_bootstrap.dll.makefrag
net_2_0_bootstrap_stampfile = $(depsdir)/corlib_net_2_0_bootstrap.dll.stamp
@@ -75,10 +77,10 @@ all-local: $(corlib)
install-local: $(corlib) $(makefrag)
@if test $(PROFILE) = "net_2_0" ; then \
echo $(MKINSTALLDIRS) $(DESTDIR)$(prefix)/lib/net_2_0 ; \
$(MKINSTALLDIRS) $(DESTDIR)$(prefix)/lib/net_2_0 ; \
echo $(INSTALL_LIB) $(corlib) $(DESTDIR)$(prefix)/lib/net_2_0 ; \
$(INSTALL_LIB) $(corlib) $(DESTDIR)$(prefix)/lib/net_2_0 ; \
echo $(MKINSTALLDIRS) $(net_2_0_dir) ; \
$(MKINSTALLDIRS) $(net_2_0_dir) ; \
echo $(INSTALL_LIB) $(corlib) $(net_2_0_dir) ; \
$(INSTALL_LIB) $(corlib) $(net_2_0_dir) ; \
else \
echo $(MKINSTALLDIRS) $(DESTDIR)$(prefix)/lib ; \
$(MKINSTALLDIRS) $(DESTDIR)$(prefix)/lib ; \
@@ -88,9 +90,9 @@ install-local: $(corlib) $(makefrag)
uninstall-local:
@if test $(PROFILE) = "net_2_0" ; then \
-rm -f $(DESTDIR)$(prefix)/lib/net_2_0/corlib.dll
-rm -f $(net_2_0_dir)/mscorlib.dll
else \
-rm -f $(DESTDIR)$(prefix)/lib/corlib.dll
-rm -f $(DESTDIR)$(prefix)/lib/mscorlib.dll
fi
clean-local:
+12 -10
View File
@@ -62,10 +62,12 @@ namespace System.IO {
Dispose (true);
}
protected virtual void FillBuffer(int bytes) {
if(m_stream==null) {
protected virtual void FillBuffer (int bytes)
{
if (m_disposed)
throw new ObjectDisposedException ("BinaryReader", "Cannot read from a closed BinaryReader.");
if (m_stream==null)
throw new IOException("Stream is invalid");
}
CheckBuffer(bytes);
@@ -96,7 +98,7 @@ namespace System.IO {
return -1;
}
char[] result = new char[1];
char[] result = new char[1];
byte[] bytes;
int bcount;
@@ -139,15 +141,15 @@ namespace System.IO {
if (buffer == null) {
throw new ArgumentNullException("buffer is null");
}
if (buffer.Length - index < count) {
throw new ArgumentException("buffer is too small");
}
if (index < 0) {
throw new ArgumentOutOfRangeException("index is less than 0");
}
if (count < 0) {
throw new ArgumentOutOfRangeException("count is less than 0");
}
if (buffer.Length - index < count) {
throw new ArgumentException("buffer is too small");
}
int bytes_read=m_stream.Read(buffer, index, count);
@@ -167,15 +169,15 @@ namespace System.IO {
if (buffer == null) {
throw new ArgumentNullException("buffer is null");
}
if (buffer.Length - index < count) {
throw new ArgumentException("buffer is too small");
}
if (index < 0) {
throw new ArgumentOutOfRangeException("index is less than 0");
}
if (count < 0) {
throw new ArgumentOutOfRangeException("count is less than 0");
}
if (buffer.Length - index < count) {
throw new ArgumentException("buffer is too small");
}
int bytes_read;
byte[] bytes;
+10 -2
View File
@@ -112,13 +112,21 @@ namespace System.IO {
public override long Seek (long offset, SeekOrigin origin)
{
Flush();
return m_stream.Seek(offset, origin);
CheckObjectDisposedException ();
if (!CanSeek) {
throw new NotSupportedException (
Locale.GetText ("Non seekable stream."));
}
Flush ();
return m_stream.Seek (offset, origin);
}
public override void SetLength (long value)
{
CheckObjectDisposedException ();
m_stream.SetLength(value);
if (Position > value)
Position = value;
}
public override int ReadByte ()
+14
View File
@@ -1,3 +1,17 @@
2004-05-31 Atsushi Enomoto <[email protected]>
* Directory.cs, File.cs : Fixed Exists() that raised
DirectoryNotFoundException. Quick fix for bug #59354.
2004-05-30 Sebastien Pouliot <[email protected]>
* BinaryReader.cs: Added missing disposed check for most methods.
Reordered some exceptions to match MS implementation.
* BufferedStream.cs: Fixed Seek logic (check for CanSeek and dispose).
SetLength must also reset Position and check for dispose.
* FileStream.cs: Added missing check for invalid SeekOrigin. Added
missing validations.
2004-05-27 Dick Porter <[email protected]>
* FileSystemInfo.cs: Take out the error checking in Refresh(), it
+14 -10
View File
@@ -131,19 +131,23 @@ namespace System.IO
public static bool Exists (string path)
{
if (path == null)
return false;
try {
if (path == null)
return false;
MonoIOError error;
bool exists;
MonoIOError error;
bool exists;
exists = MonoIO.ExistsDirectory (path, out error);
if (error != MonoIOError.ERROR_SUCCESS &&
error != MonoIOError.ERROR_PATH_NOT_FOUND) {
throw MonoIO.GetException (path, error);
}
exists = MonoIO.ExistsDirectory (path, out error);
if (error != MonoIOError.ERROR_SUCCESS &&
error != MonoIOError.ERROR_PATH_NOT_FOUND) {
throw MonoIO.GetException (path, error);
}
return(exists);
return(exists);
} catch (Exception) {
return false;
}
}
public static DateTime GetLastAccessTime (string path)
+22 -18
View File
@@ -129,26 +129,30 @@ namespace System.IO
public static bool Exists (string path)
{
// For security reasons no exceptions are
// thrown, only false is returned if there is
// any problem with the path or permissions.
// Minimizes what information can be
// discovered by using this method.
if (null == path || String.Empty == path.Trim()
|| path.IndexOfAny(Path.InvalidPathChars) >= 0) {
try {
// For security reasons no exceptions are
// thrown, only false is returned if there is
// any problem with the path or permissions.
// Minimizes what information can be
// discovered by using this method.
if (null == path || String.Empty == path.Trim()
|| path.IndexOfAny(Path.InvalidPathChars) >= 0) {
return false;
}
MonoIOError error;
bool exists;
exists = MonoIO.ExistsFile (path, out error);
if (error != MonoIOError.ERROR_SUCCESS &&
error != MonoIOError.ERROR_FILE_NOT_FOUND) {
throw MonoIO.GetException (path, error);
}
return(exists);
} catch (Exception) {
return false;
}
MonoIOError error;
bool exists;
exists = MonoIO.ExistsFile (path, out error);
if (error != MonoIOError.ERROR_SUCCESS &&
error != MonoIOError.ERROR_FILE_NOT_FOUND) {
throw MonoIO.GetException (path, error);
}
return(exists);
}
public static FileAttributes GetAttributes (string path)
+30 -3
View File
@@ -12,6 +12,7 @@
using System;
using System.Collections;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Remoting.Messaging;
@@ -38,6 +39,8 @@ namespace System.IO
internal FileStream (IntPtr handle, FileAccess access, bool ownsHandle, int bufferSize, bool isAsync, bool noBuffering)
{
this.handle = MonoIO.InvalidHandle;
if (handle == this.handle)
throw new ArgumentException ("handle", Locale.GetText ("Invalid."));
if (access < FileAccess.Read || access > FileAccess.ReadWrite)
throw new ArgumentOutOfRangeException ("access");
@@ -251,6 +254,9 @@ namespace System.IO
return(buf_start + buf_offset);
}
set {
if (handle == MonoIO.InvalidHandle)
throw new ObjectDisposedException ("Stream has been closed");
if(CanSeek == false) {
throw new NotSupportedException("The stream does not support seeking");
}
@@ -321,8 +327,10 @@ namespace System.IO
if (!CanRead)
throw new NotSupportedException ("Stream does not support reading");
int len = dest.Length;
if (dest_offset < 0 || count < 0)
throw new ArgumentException ("dest or count is negative");
if (dest_offset < 0)
throw new ArgumentOutOfRangeException ("dest_offset", "< 0");
if (count < 0)
throw new ArgumentOutOfRangeException ("count", "< 0");
if (dest_offset > len)
throw new ArgumentException ("destination offset is beyond array size");
// reordered to avoid possible integer overflow
@@ -383,6 +391,9 @@ namespace System.IO
public override IAsyncResult BeginRead (byte [] buffer, int offset, int count,
AsyncCallback cback, object state)
{
if (handle == MonoIO.InvalidHandle)
throw new ObjectDisposedException ("Stream has been closed");
if (!CanRead)
throw new NotSupportedException ("This stream does not support reading");
@@ -528,6 +539,9 @@ namespace System.IO
public override IAsyncResult BeginWrite (byte [] buffer, int offset, int count,
AsyncCallback cback, object state)
{
if (handle == MonoIO.InvalidHandle)
throw new ObjectDisposedException ("Stream has been closed");
if (!CanWrite)
throw new NotSupportedException ("This stream does not support writing");
@@ -650,9 +664,12 @@ namespace System.IO
pos = Position + offset;
break;
case SeekOrigin.Begin: default:
case SeekOrigin.Begin:
pos = offset;
break;
default:
throw new ArgumentException ("origin", "Invalid SeekOrigin");
}
if (pos < 0) {
@@ -692,6 +709,9 @@ namespace System.IO
public override void SetLength (long length)
{
if (handle == MonoIO.InvalidHandle)
throw new ObjectDisposedException ("Stream has been closed");
if(CanSeek == false) {
throw new NotSupportedException("The stream does not support seeking");
}
@@ -712,6 +732,9 @@ namespace System.IO
if (error != MonoIOError.ERROR_SUCCESS) {
throw MonoIO.GetException (name, error);
}
if (Position > length)
Position = length;
}
public override void Flush ()
@@ -736,6 +759,8 @@ namespace System.IO
public virtual void Lock (long position, long length)
{
if (handle == MonoIO.InvalidHandle)
throw new ObjectDisposedException ("Stream has been closed");
if (position < 0) {
throw new ArgumentOutOfRangeException ("position must not be negative");
}
@@ -756,6 +781,8 @@ namespace System.IO
public virtual void Unlock (long position, long length)
{
if (handle == MonoIO.InvalidHandle)
throw new ObjectDisposedException ("Stream has been closed");
if (position < 0) {
throw new ArgumentOutOfRangeException ("position must not be negative");
}
@@ -1,3 +1,9 @@
2004-05-30 Gert Driesen ([email protected])
* SetWin32ContextInIDispatchAttribute.cs: only build
for NET_2_0 profile
* VariantWrapper.cs: only build for NET_2_0 profile
2004-05-29 Gert Driesen ([email protected])
* SetWin32ContextInIDispatchAttribute.cs: added
@@ -7,6 +7,8 @@
// (C) Novell, Inc. http://www.ximian.com
//
#if NET_2_0
using System;
namespace System.Runtime.InteropServices
@@ -20,3 +22,4 @@ namespace System.Runtime.InteropServices
}
}
#endif
@@ -7,6 +7,8 @@
// (C) Novell, Inc. http://www.ximian.com
//
#if NET_2_0
namespace System.Runtime.InteropServices
{
public sealed class VariantWrapper
@@ -27,3 +29,5 @@ namespace System.Runtime.InteropServices
}
}
}
#endif
+18
View File
@@ -1,3 +1,21 @@
2004-05-30 Gonzalo Paniagua Javier <[email protected]>
* DateTime.cs: adjust milliseconds for fraction specifier ('f').
2004-05-30 Miguel de Icaza <[email protected]>
* Console.cs: Remove *again* the version of WriteLine with four
arguments; That should *not* be added.
Flag it as internal as people migrate their code.
2004-05-29 Sebastien Pouliot <[email protected]>
* Convert.cs: Fixed ToSByte(string,IFormatProvider) to throw
ArgumentNullException (only case, all other returns 0). Fixed exception
reporting for hex prefix only strings. Fixed ChangeTo where null could
be misinterpreted between null and Empty.
2004-05-28 Sebastien Pouliot <[email protected]>
* Convert.cs: Fixed integer parsing for special cases (0x, 0X for base
+1 -2
View File
@@ -327,8 +327,7 @@ namespace System
}
[CLSCompliant (false)]
[MonoTODO ("Arglist is missing")]
public static void WriteLine (string format, object arg0, object arg1, object arg2, object arg3)
internal static void WriteLine (string format, object arg0, object arg1, object arg2, object arg3)
{
stdout.WriteLine (String.Format (format, arg0, arg1, arg2, arg3));
}
+8 -4
View File
@@ -1469,7 +1469,7 @@ namespace System {
public static sbyte ToSByte (string value, IFormatProvider provider)
{
if (value == null)
return 0; // LAMESPEC: Spec says throw ArgumentNullException
throw new ArgumentNullException ("value");
return SByte.Parse (value, provider);
}
@@ -2326,7 +2326,9 @@ namespace System {
// ========== Conversion / Helper Functions ========== //
public static object ChangeType (object value, Type conversionType)
{
{
if ((value != null) && (conversionType == null))
throw new ArgumentNullException ("conversionType");
CultureInfo ci = CultureInfo.CurrentCulture;
NumberFormatInfo number = ci.NumberFormat;
return ToType (value, conversionType, number);
@@ -2342,6 +2344,8 @@ namespace System {
public static object ChangeType (object value, Type conversionType, IFormatProvider provider)
{
if ((value != null) && (conversionType == null))
throw new ArgumentNullException ("conversionType");
return ToType (value, conversionType, provider);
}
@@ -2394,7 +2398,7 @@ namespace System {
i+=2;
}
if (len == i) {
throw new OverflowException (
throw new FormatException (
Locale.GetText ("Missing number after prefix"));
}
}
@@ -2560,7 +2564,7 @@ namespace System {
return null;
if (conversionType == null)
throw new ArgumentNullException ("convertionType");
throw new InvalidCastException ("Cannot cast to destination type.");
if (value.GetType () == conversionType)
return value;
+19 -7
View File
@@ -957,14 +957,26 @@ namespace System
return false;
break;
case 'f':
if (millisecond != -1)
return false;
num = Math.Min (num, 6);
case 'f':
if (millisecond != -1)
return false;
num = Math.Min (num, 6);
millisecond = _ParseNumber (s, num+1, true, sloppy_parsing, next_not_digit, out num_parsed);
if (millisecond >= 1000)
return false;
break;
if (num_parsed == -1)
return false;
if (num_parsed != 3) {
int k;
if (num_parsed > 3) {
for (k = num_parsed; k > 3; k--)
millisecond /= 10;
} else {
for (k = num_parsed; k < 3; k++) {
millisecond *= 10;
}
}
}
break;
case 't':
if (ampm != -1)
return false;
@@ -1,3 +1,9 @@
2004-05-30 David Sheldon <[email protected]>
* StackFrameTest.cs: Mark the failures that have been failing
for months due to bug 45730 as ignored as it doesn't look like
it will be fixed soon.
2003-10-07 Nick Drochak <[email protected]>
* StackFrameTest.cs: Get tests to pass on .NET 1.1.
@@ -145,6 +145,7 @@ namespace MonoTests.System.Diagnostics {
/// <summary>
/// Tests whether getting file line number works.
/// </summary>
[Ignore ("Bug 45730 - Incorrect line numbers returned")]
public void TestGetFileLineNumber() {
AssertEquals("Line number (1)",
0,
@@ -162,6 +163,7 @@ namespace MonoTests.System.Diagnostics {
/// <summary>
/// Tests whether getting file column number works.
/// </summary>
[Ignore ("Bug 45730 - Column numbers always zero")]
public void TestGetFileColumnNumber() {
AssertEquals("Column number (1)",
0,
@@ -267,6 +269,7 @@ namespace MonoTests.System.Diagnostics {
/// <summary>
/// Tests whether getting file line number works.
/// </summary>
[Ignore ("Bug 45730 - Incorrect line numbers returned")]
public void TestGetFileLineNumber() {
AssertEquals("Line number (1)",
0,
@@ -280,6 +283,7 @@ namespace MonoTests.System.Diagnostics {
/// <summary>
/// Tests whether getting file column number works.
/// </summary>
[Ignore ("Bug 45730 - Column numbers always zero")]
public void TestGetFileColumnNumber() {
AssertEquals("Column number (1)",
0,
@@ -4,7 +4,9 @@
//
// (C) Eduardo Garcia Cebollero.
// (C) Ximian, Inc. http://www.ximian.com
// Copyright (C) 2004 Novell (http://www.novell.com)
//
using NUnit.Framework;
using System;
using System.IO;
@@ -30,7 +32,6 @@ namespace MonoTests.System.IO
[TearDown]
public void TearDown ()
{
if (Directory.Exists (TempFolder))
Directory.Delete (TempFolder, true);
}
@@ -550,7 +551,87 @@ namespace MonoTests.System.IO
stream.Close ();
}
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void Read_Bytes_BufferNull ()
{
byte[] b = null;
new BinaryReader (new MemoryStream ()).Read (b, 0, 1);
}
[Test]
[ExpectedException (typeof (ArgumentOutOfRangeException))]
public void Read_Bytes_IndexNegative ()
{
byte[] array = new byte [8];
new BinaryReader (new MemoryStream ()).Read (array, -1, array.Length);
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Read_Bytes_IndexOverflow ()
{
byte[] array = new byte [8];
new BinaryReader (new MemoryStream ()).Read (array, Int32.MaxValue, array.Length);
}
[Test]
[ExpectedException (typeof (ArgumentOutOfRangeException))]
public void Read_Bytes_CountNegative ()
{
byte[] array = new byte [8];
new BinaryReader (new MemoryStream ()).Read (array, 0, -1);
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Read_Bytes_CountOverflow ()
{
byte[] array = new byte [8];
new BinaryReader (new MemoryStream ()).Read (array, 0, Int32.MaxValue);
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void Read_Chars_BufferNull ()
{
char[] c = null;
new BinaryReader (new MemoryStream ()).Read (c, 0, 1);
}
[Test]
[ExpectedException (typeof (ArgumentOutOfRangeException))]
public void Read_Chars_IndexNegative ()
{
char[] array = new char [8];
new BinaryReader (new MemoryStream ()).Read (array, -1, array.Length);
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Read_Chars_IndexOverflow ()
{
char[] array = new char [8];
new BinaryReader (new MemoryStream ()).Read (array, Int32.MaxValue, array.Length);
}
[Test]
[ExpectedException (typeof (ArgumentOutOfRangeException))]
public void Read_Chars_CountNegative ()
{
char[] array = new char [8];
new BinaryReader (new MemoryStream ()).Read (array, 0, -1);
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Read_Chars_CountOverflow ()
{
char[] array = new char [8];
new BinaryReader (new MemoryStream ()).Read (array, 0, Int32.MaxValue);
}
[Test]
public void PeakChar ()
{
@@ -535,5 +535,43 @@ public class BufferedStreamTest : Assertion {
AssertEquals ("test#01", 9, stream.Position);
AssertEquals ("test#02", 9, stream.ReadByte ());
}
[Test]
public void PositionAfterSetLength ()
{
BufferedStream stream = new BufferedStream (new MemoryStream ());
stream.SetLength (32);
stream.Position = 32;
stream.SetLength (16);
AssertEquals ("Position==16", 16, stream.Position);
}
[Test]
[ExpectedException (typeof (ObjectDisposedException))]
public void SetLength_Disposed ()
{
BufferedStream stream = new BufferedStream (new MemoryStream ());
stream.Close ();
stream.SetLength (16);
}
[Test]
[ExpectedException (typeof (NotSupportedException))]
public void Seek_ClosedMemoryStream ()
{
MemoryStream ms = new MemoryStream ();
BufferedStream stream = new BufferedStream (ms);
ms.Close ();
stream.Seek (0, SeekOrigin.Begin);
}
[Test]
[ExpectedException (typeof (ObjectDisposedException))]
public void Seek_ClosedBufferedStream ()
{
BufferedStream stream = new BufferedStream (new MemoryStream ());
stream.Close ();
stream.Seek (0, SeekOrigin.Begin);
}
}
}
+15 -1
View File
@@ -1,4 +1,18 @@
2003-05-26 Atsushi Enomoto <atsushi@ximian.com>
2004-05-30 Sebastien Pouliot <sebastien@ximian.com>
* BufferedStreamTest.cs: Added tests for Position after SetLength,
SetLength after Close and Seek logic exception handling.
* FileStream.cs: Added test for invalid SeekOrigin in Seek. Lots of
new tests for exception handling (negatives, disposed) and test
reading a byte ast the end of the stream.
* MemoryStream.cs: Added test for Seek after Close.
2004-05-29 Sebastien Pouliot <[email protected]>
* BinaryReader.cs: Added new cases to check exceptions thrown by Read
methods.
2004-05-26 Atsushi Enomoto <[email protected]>
* FileInfoTest.cs : more incorrect \ fix.
@@ -769,6 +769,18 @@ namespace MonoTests.System.IO
if (File.Exists (path))
File.Delete (path);
}
[Test]
[ExpectedException (typeof (ArgumentOutOfRangeException))]
public void Read_OffsetNegative ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "temp";
DeleteFile (path);
using (FileStream stream = new FileStream (path, FileMode.OpenOrCreate, FileAccess.Read)) {
stream.Read (new byte[0], -1, 1);
}
}
[Test]
[ExpectedException (typeof (ArgumentException))]
@@ -782,6 +794,18 @@ namespace MonoTests.System.IO
}
}
[Test]
[ExpectedException (typeof (ArgumentOutOfRangeException))]
public void Read_CountNegative ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "temp";
DeleteFile (path);
using (FileStream stream = new FileStream (path, FileMode.OpenOrCreate, FileAccess.Read)) {
stream.Read (new byte[0], 1, -1);
}
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Read_CountOverflow ()
@@ -794,6 +818,18 @@ namespace MonoTests.System.IO
}
}
[Test]
[ExpectedException (typeof (ArgumentOutOfRangeException))]
public void Write_OffsetNegative ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "temp";
DeleteFile (path);
using (FileStream stream = new FileStream (path, FileMode.OpenOrCreate, FileAccess.Write)) {
stream.Write (new byte[0], -1, 1);
}
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Write_OffsetOverflow ()
@@ -806,6 +842,18 @@ namespace MonoTests.System.IO
}
}
[Test]
[ExpectedException (typeof (ArgumentOutOfRangeException))]
public void Write_CountNegative ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "temp";
DeleteFile (path);
using (FileStream stream = new FileStream (path, FileMode.OpenOrCreate, FileAccess.Write)) {
stream.Write (new byte[0], 1, -1);
}
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Write_CountOverflow ()
@@ -817,6 +865,117 @@ namespace MonoTests.System.IO
stream.Write (new byte[0], 1, Int32.MaxValue);
}
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Seek_InvalidSeekOrigin ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "temp";
DeleteFile (path);
using (FileStream stream = new FileStream (path, FileMode.OpenOrCreate, FileAccess.Read)) {
stream.Seek (0, (SeekOrigin) (-1));
}
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Constructor_InvalidFileHandle ()
{
new FileStream ((IntPtr)(-1), FileAccess.Read);
}
[Test]
public void PositionAfterSetLength ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "temp";
DeleteFile (path);
using (FileStream stream = new FileStream (path, FileMode.OpenOrCreate, FileAccess.Write)) {
stream.SetLength (32);
stream.Position = 32;
stream.SetLength (16);
AssertEquals ("Position==16", 16, stream.Position);
}
}
[Test]
[ExpectedException (typeof (ObjectDisposedException))]
public void SetLength_Disposed ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "temp";
DeleteFile (path);
FileStream stream = new FileStream (path, FileMode.OpenOrCreate, FileAccess.Write);
stream.Close ();
stream.SetLength (16);
}
[Test]
[ExpectedException (typeof (ObjectDisposedException))]
public void Position_Disposed ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "temp";
DeleteFile (path);
FileStream stream = new FileStream (path, FileMode.OpenOrCreate, FileAccess.Read);
stream.Close ();
stream.Position = 0;
}
[Test]
[ExpectedException (typeof (ObjectDisposedException))]
public void BeginRead_Disposed ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "temp";
DeleteFile (path);
FileStream stream = new FileStream (path, FileMode.OpenOrCreate, FileAccess.Read);
stream.Close ();
stream.EndRead (stream.BeginRead (new byte[8], 0, 8, null, null));
}
[Test]
[ExpectedException (typeof (ObjectDisposedException))]
public void BeginWrite_Disposed ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "temp";
DeleteFile (path);
FileStream stream = new FileStream (path, FileMode.OpenOrCreate, FileAccess.Write);
stream.Close ();
stream.EndWrite (stream.BeginWrite (new byte[8], 0, 8, null, null));
}
[Test]
[ExpectedException (typeof (ObjectDisposedException))]
public void Lock_Disposed ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "temp";
DeleteFile (path);
FileStream stream = new FileStream (path, FileMode.OpenOrCreate, FileAccess.Write);
stream.Close ();
stream.Lock (0,1);
}
[Test]
[ExpectedException (typeof (ObjectDisposedException))]
public void Unlock_Disposed ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "temp";
DeleteFile (path);
FileStream stream = new FileStream (path, FileMode.OpenOrCreate, FileAccess.Write);
stream.Close ();
stream.Unlock (0,1);
}
[Test]
public void ReadBytePastEndOfStream ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "temp";
DeleteFile (path);
using (FileStream stream = new FileStream (path, FileMode.OpenOrCreate, FileAccess.Read)) {
stream.Seek (0, SeekOrigin.End);
AssertEquals ("ReadByte", -1, stream.ReadByte ());
stream.Close ();
}
}
}
}
@@ -419,6 +419,15 @@ namespace MonoTests.System.IO
AssertEquals ("#08", 769, ms.Position);
}
[Test]
[ExpectedException (typeof (ObjectDisposedException))]
public void Seek_Disposed ()
{
MemoryStream ms = new MemoryStream ();
ms.Close ();
ms.Seek (0, SeekOrigin.Begin);
}
[Test]
public void SetLength ()
{
+7 -1
View File
@@ -1,7 +1,13 @@
2004-05-30 David Sheldon <[email protected]>
* DecimalTest.cs: Moved the rounding test that fails due to
bug 37744 into its own test, and annotated it as ignored until
the bug is fixed.
2004-05-29 Sebastien Pouliot <[email protected]>
* ConvertTest.cs: Added new parsing tests including special case for
Convert.ToSByte.
Convert.ToSByte. Added test to ChangeType to Empty.
* Int64Test.cs: Added new test cases for overflows.
2004-05-28 Sebastien Pouliot <[email protected]>
@@ -3468,5 +3468,12 @@ namespace MonoTests.System {
AssertEquals ("ToUInt32", 0, Convert.ToUInt32 (s, fp));
AssertEquals ("ToUInt64", 0, Convert.ToUInt64 (s, fp));
}
[Test]
[ExpectedException (typeof (InvalidCastException))]
public void ChangeTypeToTypeCodeEmpty ()
{
Convert.ChangeType (true, TypeCode.Empty);
}
}
}
+22 -2
View File
@@ -859,12 +859,12 @@ namespace MonoTests.System {
}
}
public void TestRound()
public void TestRound()
{
decimal[,] dtab = {
{1m, 0, 1m}, {1.234567890m, 1, 1.2m},
{1.234567890m, 2, 1.23m}, {1.23450000001m, 3, 1.235m},
{1.2345m, 3, 1.234m}, {1.2355m, 3, 1.236m},
{1.2355m, 3, 1.236m},
{1.234567890m, 4, 1.2346m}, {1.23567890m, 2, 1.24m},
{47893764694.4578563236436621m, 7, 47893764694.4578563m},
{-47893764694.4578563236436621m, 9, -47893764694.457856324m},
@@ -882,6 +882,26 @@ namespace MonoTests.System {
}
}
}
[Ignore ("Bug 37744 - Bankers rounding not implemented")]
// When this bug is fixed, this case can be reinserted into the above test.
public void TestRoundFailures()
{
decimal[,] dtab = {
{1.2345m, 3, 1.234m}
};
decimal d;
for (int i = 0; i < dtab.GetLength(0); i++)
{
d = Decimal.Round(dtab[i,0], (int)dtab[i,1]);
if (d != dtab[i,2])
{
Fail("FailRound: Round(" + dtab[i,0] + "," + (int)dtab[i,1] + ") != " + d);
}
}
}
[Test]
public void ParseInt64 ()
+4
View File
@@ -1,3 +1,7 @@
2004-05-30 Marek Safar <[email protected]>
* cs1017.cs: New test.
2004-05-19 Marek Safar <[email protected]>
* cs0579-6.cs: New test for bug #58688.
+14
View File
@@ -0,0 +1,14 @@
// CS0176: cant access static field via instance reference. qualify w/ type name -- #59324
// Line: 12
using System;
class A {
public static int X;
}
class T {
static void Main () {
A T = new A ();
System.Console.WriteLine (T.X);
}
}
+19 -6
View File
@@ -1,9 +1,22 @@
// cs0202.cs: GetEnumerator cant return a pointer, only an instance.
// Line: 6
// cs0202.cs: The call to GetEnumerator must return a class or a struct, not 'Foo.P*'
// Line: 18
// Compiler options: -unsafe
public class Foo
public unsafe class Foo
{
int P* GetEnumerator ()
{
}
public class P
{
public P* GetEnumerator ()
{
return null;
}
}
public static void Main ()
{
P o = new P ();
foreach (P p in o)
{
}
}
}
+10
View File
@@ -0,0 +1,10 @@
// cs1017.cs: Try statement already has an empty catch block
// Line: 8
class ClassMain {
public static void Main() {
try { }
catch {}
catch (System.Exception) { }
}
}
+43
View File
@@ -1,3 +1,46 @@
2004-05-30 Ben Maurer <[email protected]>
* decl.cs: If possible, use lookuptypedirect here. We can only do
this if there is no `.' after the namespace. Avoids using
LookupType, which does lots of slow processing.
(FindNestedType) New method, does what it says :-).
* namespace.cs: use LookupTypeDirect.
* rootcontext.cs: use membercache, if possible.
* typemanager.cs (LookupTypeDirect): Cache negative hits too.
2004-05-30 Ben Maurer <[email protected]>
* expression.cs:
According to the spec,
In a member access of the form E.I, if E is a single identifier,
and if the meaning of E as a simple-name (§7.5.2) is a constant,
field, property, localvariable, or parameter with the same type as
the meaning of E as a type-name (§3.8), then both possible
meanings of E are permitted.
We did not check that E as a simple-name had the same type as E as
a type name.
This trivial check gives us 5-7% on bootstrap time.
2004-05-30 Ben Maurer <[email protected]>
* expression.cs (Invocation.OverloadResolve): Avoid the
use of hashtables and boxing here by allocating on demand.
2004-05-30 Martin Baulig <[email protected]>
* rootcontext.cs (RootContext.LookupType): Don't cache things if
we're doing a silent lookup. Don't try to lookup nested types in
TypeManager.object_type (thanks to Ben Maurer).
2004-05-30 Martin Baulig <[email protected]>
Committing a patch from Ben Maurer.
* rootcontext.cs (RootContext.LookupType): Cache negative results.
2004-05-20 Martin Baulig <[email protected]>
* delegate.cs: Convert this file to Unix mode - like the original
+30 -5
View File
@@ -1091,18 +1091,27 @@ namespace Mono.CSharp {
object r;
error = false;
int p = name.LastIndexOf ('.');
if (dh.Lookup (ns, name, out r))
return (Type) r;
else {
//
// If the type is not a nested type, we do not need `LookupType's processing.
// If the @name does not have a `.' in it, this cant be a nested type.
//
if (ns != ""){
if (Namespace.IsNamespace (ns)){
string fullname = (ns != "") ? ns + "." + name : name;
t = TypeManager.LookupType (fullname);
if (Namespace.IsNamespace (ns)) {
if (p != -1)
t = TypeManager.LookupType (ns + "." + name);
else
t = TypeManager.LookupTypeDirect (ns + "." + name);
} else
t = null;
} else
} else if (p != -1)
t = TypeManager.LookupType (name);
else
t = TypeManager.LookupTypeDirect (name);
}
if (t != null) {
@@ -1113,7 +1122,7 @@ namespace Mono.CSharp {
//
// In case we are fed a composite name, normalize it.
//
int p = name.LastIndexOf ('.');
if (p != -1){
ns = MakeFQN (ns, name.Substring (0, p));
name = name.Substring (p+1);
@@ -2255,6 +2264,22 @@ namespace Mono.CSharp {
return copy;
}
// find the nested type @name in @this.
public Type FindNestedType (string name)
{
ArrayList applicable = (ArrayList) member_hash [name];
if (applicable == null)
return null;
for (int i = applicable.Count-1; i >= 0; i--) {
CacheEntry entry = (CacheEntry) applicable [i];
if ((entry.EntryType & EntryType.NestedType & EntryType.MaskType) != 0)
return (Type) entry.Member;
}
return null;
}
//
// This finds the method or property for us to override. invocationType is the type where
// the override is going to be declared, name is the name of the method/property, and
+21 -27
View File
@@ -4754,7 +4754,7 @@ namespace Mono.CSharp {
//
// false is normal form, true is expanded form
//
Hashtable candidate_to_form = new PtrHashtable ();
Hashtable candidate_to_form = null;
//
@@ -4794,14 +4794,16 @@ namespace Mono.CSharp {
candidates.Add (candidate);
applicable_type = candidate.DeclaringType;
found_applicable = true;
candidate_to_form [candidate] = false;
} else if (IsParamsMethodApplicable (ec, me, Arguments, ref methods [i])) {
if (candidate_to_form == null)
candidate_to_form = new PtrHashtable ();
// Candidate is applicable in expanded form
MethodBase candidate = methods [i];
MethodBase candidate = methods [i];
candidates.Add (candidate);
applicable_type = candidate.DeclaringType;
found_applicable = true;
candidate_to_form [candidate] = true;
candidate_to_form [candidate] = candidate;
}
}
@@ -4817,11 +4819,11 @@ namespace Mono.CSharp {
for (int ix = 0; ix < candidate_top; ix++){
MethodBase candidate = (MethodBase) candidates [ix];
bool cand_params = (bool) candidate_to_form [candidate];
bool cand_params = candidate_to_form != null && candidate_to_form.Contains (candidate);
bool method_params = false;
if (method != null)
method_params = (bool) candidate_to_form [method];
method_params = candidate_to_form != null && candidate_to_form.Contains (method);
int x = BetterFunction (ec, Arguments,
candidate, cand_params,
@@ -4896,7 +4898,7 @@ namespace Mono.CSharp {
// Now check that there are no ambiguities i.e the selected method
// should be better than all the others
//
bool best_params = (bool) candidate_to_form [method];
bool best_params = candidate_to_form != null && candidate_to_form.Contains (method);
for (int ix = 0; ix < candidate_top; ix++){
MethodBase candidate = (MethodBase) candidates [ix];
@@ -4916,7 +4918,7 @@ namespace Mono.CSharp {
// IsApplicable (ec, Arguments, method)))
// continue;
bool cand_params = (bool) candidate_to_form [candidate];
bool cand_params = candidate_to_form != null && candidate_to_form.Contains (candidate);
int x = BetterFunction (ec, Arguments,
method, best_params,
candidate, cand_params,
@@ -7117,23 +7119,15 @@ namespace Mono.CSharp {
"type name instead");
}
static bool IdenticalNameAndTypeName (EmitContext ec, Expression left_original, Location loc)
static bool IdenticalNameAndTypeName (EmitContext ec, Expression left_original, Expression left, Location loc)
{
if (left_original == null)
SimpleName sn = left_original as SimpleName;
if (sn == null || left == null || left.Type.Name != sn.Name)
return false;
if (!(left_original is SimpleName))
return false;
SimpleName sn = (SimpleName) left_original;
TypeExpr t = RootContext.LookupType (ec.DeclSpace, sn.Name, true, loc);
if (t != null)
return true;
return false;
return RootContext.LookupType (ec.DeclSpace, sn.Name, true, loc) != null;
}
public static Expression ResolveMemberAccess (EmitContext ec, Expression member_lookup,
Expression left, Location loc,
Expression left_original)
@@ -7185,7 +7179,7 @@ namespace Mono.CSharp {
if (decl_type.IsSubclassOf (TypeManager.enum_type)) {
if (left_is_explicit && !left_is_type &&
!IdenticalNameAndTypeName (ec, left_original, loc)) {
!IdenticalNameAndTypeName (ec, left_original, member_lookup, loc)) {
error176 (loc, fe.FieldInfo.Name);
return null;
}
@@ -7266,23 +7260,23 @@ namespace Mono.CSharp {
if (!me.IsStatic){
if ((ec.IsFieldInitializer || ec.IsStatic) &&
IdenticalNameAndTypeName (ec, left_original, loc))
IdenticalNameAndTypeName (ec, left_original, member_lookup, loc))
return member_lookup;
SimpleName.Error_ObjectRefRequired (ec, loc, me.Name);
return null;
}
} else {
if (!me.IsInstance){
if (IdenticalNameAndTypeName (ec, left_original, loc))
if (!me.IsInstance) {
if (IdenticalNameAndTypeName (ec, left_original, left, loc))
return member_lookup;
if (left_is_explicit) {
error176 (loc, me.Name);
return null;
}
}
}
//
// Since we can not check for instance objects in SimpleName,
+4 -1
View File
@@ -105,7 +105,10 @@ namespace Mono.CSharp {
if (ns != null)
return ns;
t = TypeManager.LookupType (DeclSpace.MakeFQN (fullname, name));
//
// The type is not a nested type here
//
t = TypeManager.LookupTypeDirect (DeclSpace.MakeFQN (fullname, name));
if ((t == null) || ((ds != null) && !ds.CheckAccessLevel (t)))
return null;
+23 -10
View File
@@ -487,7 +487,7 @@ namespace Mono.CSharp {
}
static TypeExpr NamespaceLookup (DeclSpace ds, string name,
int num_type_args, Location loc)
int num_type_args, bool silent, Location loc)
{
//
// Try in the current namespace and all its implicit parents
@@ -528,8 +528,6 @@ namespace Mono.CSharp {
if (ds.Cache.Contains (name)){
t = (TypeExpr) ds.Cache [name];
if (t != null)
return t;
} else {
//
// For the case the type we are looking for is nested within this one
@@ -537,9 +535,26 @@ namespace Mono.CSharp {
//
DeclSpace containing_ds = ds;
while (containing_ds != null){
// if the member cache has been created, lets use it.
// the member cache is MUCH faster.
if (containing_ds.MemberCache != null) {
Type type = containing_ds.MemberCache.FindNestedType (name);
if (type == null) {
containing_ds = containing_ds.Parent;
continue;
}
t = new TypeExpression (type, loc);
ds.Cache [name] = t;
return t;
}
// no member cache. Do it the hard way -- reflection
Type current_type = containing_ds.TypeBuilder;
while (current_type != null) {
while (current_type != null &&
current_type != TypeManager.object_type) {
//
// nested class
//
@@ -556,17 +571,15 @@ namespace Mono.CSharp {
containing_ds = containing_ds.Parent;
}
t = NamespaceLookup (ds, name, num_type_params, loc);
if (t != null){
t = NamespaceLookup (ds, name, num_type_params, silent, loc);
if (!silent)
ds.Cache [name] = t;
return t;
}
}
if (!silent)
if (t == null && !silent)
Report.Error (246, loc, "Cannot find type `"+name+"'");
return null;
return t;
}
// <summary>
+10 -5
View File
@@ -690,12 +690,17 @@ public class TypeManager {
Type t = (Type) types [name];
if (t != null)
return t;
t = LookupTypeReflection (name);
if (t == null)
if (negative_hits.Contains (name))
return null;
types [name] = t;
t = LookupTypeReflection (name);
if (t == null)
negative_hits [name] = null;
else
types [name] = t;
return t;
}
+1
View File
@@ -28,6 +28,7 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: Mono.Author("Anirban Bhattacharjee")]
[assembly: Mono.Author("Martin Baulig")]
[assembly: Mono.Author("Marco Ridoni")]
[assembly: Mono.Author("Rafael Teixeira")]
+3
View File
@@ -1,3 +1,6 @@
2004/05/31 Rafael Teixeira <[email protected]>
* AssemblyInfo.cs : Anirban is and author too
2004-05-27 Anirban Bhattacharjee <[email protected]>
* delegate.cs:
* expression.cs:
+2 -2
View File
@@ -26,8 +26,8 @@ mb-parser.cs: mb-parser.jay
verbose: mbas.exe
$(TEST_RUNTIME) ./mbas.exe --verbosegetoptions --verbose --stacktrace /libpath:../class/lib/$(PROFILE) /r:Mono.GetOptions /r:System.Data,System.Windows.Forms --main WriteOK testmbas/WriteOK.vb testmbas/WriteOK2.mbs
testmbas/WriteOK.exe: mbas.exe testmbas/*.vb testmbas/*.mbs
$(TEST_RUNTIME) ./mbas.exe --stacktrace --verbosegetoptions /libpath:../class/lib/$(PROFILE) /r:Mono.GetOptions /r:System.Data,System.Windows.Forms --main WriteOK testmbas/WriteOK.vb testmbas/WriteOK2.mbs
testmbas/WriteOK.exe: Makefile mbas.exe testmbas/*.vb testmbas/*.mbs
$(TEST_RUNTIME) ./mbas.exe --verbosegetoptions --stacktrace /libpath:../class/lib/$(PROFILE) --reference=Mono.GetOptions -r:System.Data,System.Messaging --main WriteOK testmbas/WriteOK.vb testmbas/WriteOK2.mbs
test-aspx: mbas.exe testmbas/aspx_temp.vb
$(TEST_RUNTIME) --debug ./mbas.exe --stacktrace --verbosegetoptions /libpath:../class/lib/$(PROFILE) /target:library /r:"System.dll" /r:"System.Xml.dll" /r:"System.Data.dll" /r:"System.Web.dll" /r:"System.Web.Services.dll" /r:"System.Drawing.dll" -- testmbas/aspx_temp.vb
+3 -1
View File
@@ -867,7 +867,9 @@ namespace Mono.Languages
/// </summary>
int MainDriver(string [] args)
{
Console.WriteLine ("THIS IS ALPHA AND UNSUPPORTED SOFTWARE, USE AT YOUR OWN RISK.");
Console.WriteLine ("--------");
Console.WriteLine ("MonoBASIC: THIS IS STILL ALPHA AND UNSUPPORTED SOFTWARE, USE AT YOUR OWN RISK.");
Console.WriteLine ("--------");
SetupDefaultDefines();
SetupDefaultImports();
+81
View File
@@ -1,3 +1,84 @@
2004-05-31 Miguel de Icaza <[email protected]>
* Reverted patch to namespace.cs (Use lookuptypedirect). This
caused a regression: #59343. Referencing nested classes from an
assembly stopped working.
2004-05-31 Martin Baulig <[email protected]>
MCS is now frozen for beta 2.
2004-05-30 Ben Maurer <[email protected]>
* convert.cs: add a trivial cache for overload operator resolution.
2004-05-30 Ben Maurer <[email protected]>
* decl.cs: If possible, use lookuptypedirect here. We can only do
this if there is no `.' after the namespace. Avoids using
LookupType, which does lots of slow processing.
(FindNestedType) New method, does what it says :-).
* namespace.cs: use LookupTypeDirect.
* rootcontext.cs: use membercache, if possible.
* typemanager.cs (LookupTypeDirect): Cache negative hits too.
2004-05-30 Ben Maurer <[email protected]>
* expression.cs:
According to the spec,
In a member access of the form E.I, if E is a single identifier,
and if the meaning of E as a simple-name (§7.5.2) is a constant,
field, property, localvariable, or parameter with the same type as
the meaning of E as a type-name (§3.8), then both possible
meanings of E are permitted.
We did not check that E as a simple-name had the same type as E as
a type name.
This trivial check gives us 5-7% on bootstrap time.
2004-05-30 Ben Maurer <[email protected]>
* expression.cs (Invocation.OverloadResolve): Avoid the
use of hashtables and boxing here by allocating on demand.
2004-05-30 Martin Baulig <[email protected]>
* rootcontext.cs (RootContext.LookupType): Don't cache things if
we're doing a silent lookup. Don't try to lookup nested types in
TypeManager.object_type (thanks to Ben Maurer).
2004-05-30 Martin Baulig <[email protected]>
Committing a patch from Ben Maurer.
* rootcontext.cs (RootContext.LookupType): Cache negative results.
2004-05-29 Martin Baulig <[email protected]>
* class.cs (IMethodData.ShouldIgnore): New method.
* typemanager.cs (TypeManager.MethodFlags): Don't take a
`Location' argument, we don't need it anywhere. Use
`IMethodData.ShouldIgnore ()' instead of
`MethodData.GetMethodFlags ()'.
(TypeManager.AddMethod): Removed.
(TypeManager.AddMethod2): Renamed to AddMethod.
2004-05-29 Martin Baulig <[email protected]>
Committing a patch from Benjamin Jemlich <[email protected]>.
* convert.cs (Convert.ImplicitReferenceConversion): If we're
converting from a class type S to an interface type and we already
have an object on the stack, don't box it again. Fixes #52578.
2004-05-29 Martin Baulig <[email protected]>
* class.cs (ConstructorInitializer.GetOverloadedConstructor):
Added support for `params' parameters. Fixes #59267.
2004-05-29 Martin Baulig <[email protected]>
* literal.cs (NullPointer): Provide a private .ctor which sets
+43 -23
View File
@@ -2672,6 +2672,7 @@ namespace Mono.CSharp {
public MethodBuilder MethodBuilder;
public MethodData MethodData;
ReturnParameter return_attributes;
bool should_ignore;
/// <summary>
/// Modifiers allowed in a class declaration
@@ -2886,6 +2887,8 @@ namespace Mono.CSharp {
if (!MethodData.Define (container))
return false;
should_ignore = MethodData.ShouldIgnore ();
//
// Setup iterator if we are one
//
@@ -2989,6 +2992,11 @@ namespace Mono.CSharp {
{
return GetObsoleteAttribute (ds);
}
public bool ShouldIgnore ()
{
return should_ignore;
}
#endregion
}
@@ -3106,13 +3114,30 @@ namespace Mono.CSharp {
continue;
}
if (c.ParameterTypes.Length != Arguments.Count)
continue;
bool ok = true;
for (int i = 0; i < Arguments.Count; ++i)
if (c.ParameterTypes [i] != ((Argument)Arguments [i]).Type)
int count = c.ParameterInfo.Count;
if ((count > 0) &&
c.ParameterInfo.ParameterModifier (count - 1) == Parameter.Modifier.PARAMS) {
for (int i = 0; i < count-1; i++)
if (c.ParameterTypes [i] != ((Argument)Arguments [i]).Type) {
ok = false;
break;
}
} else {
if (c.ParameterTypes.Length != Arguments.Count)
continue;
for (int i = 0; i < Arguments.Count; ++i)
if (c.ParameterTypes [i] != ((Argument)Arguments [i]).Type) {
ok = false;
break;
}
}
if (!ok)
continue;
return c;
}
@@ -3495,6 +3520,7 @@ namespace Mono.CSharp {
EmitContext CreateEmitContext (TypeContainer tc, ILGenerator ig);
ObsoleteAttribute GetObsoleteAttribute ();
bool ShouldIgnore ();
}
//
@@ -3655,13 +3681,13 @@ namespace Mono.CSharp {
//
// Checks whether this method should be ignored due to its Conditional attributes.
//
bool ShouldIgnore (Location loc)
public bool ShouldIgnore ()
{
// When we're overriding a virtual method, we implicitly inherit the
// Conditional attributes from our parent.
if (member.ParentMethod != null) {
TypeManager.MethodFlags flags = TypeManager.GetMethodFlags (
member.ParentMethod, loc);
member.ParentMethod);
if ((flags & TypeManager.MethodFlags.ShouldIgnore) != 0)
return true;
@@ -3680,21 +3706,6 @@ namespace Mono.CSharp {
return false;
}
//
// Returns the TypeManager.MethodFlags for this method.
// This emits an error 619 / warning 618 if the method is obsolete.
// In the former case, TypeManager.MethodFlags.IsObsoleteError is returned.
//
public virtual TypeManager.MethodFlags GetMethodFlags (Location loc)
{
TypeManager.MethodFlags flags = 0;
if (ShouldIgnore (loc))
flags |= TypeManager.MethodFlags.ShouldIgnore;
return flags;
}
public bool Define (TypeContainer container)
{
MethodInfo implementing = null;
@@ -3855,8 +3866,7 @@ namespace Mono.CSharp {
return false;
}
TypeManager.AddMethod (builder, this);
TypeManager.AddMethod2 (builder, method);
TypeManager.AddMethod (builder, method);
return true;
}
@@ -4867,6 +4877,11 @@ namespace Mono.CSharp {
{
return method.GetObsoleteAttribute (method.ds);
}
bool IMethodData.ShouldIgnore ()
{
return method_data.ShouldIgnore ();
}
#endregion
}
@@ -5593,6 +5608,11 @@ namespace Mono.CSharp {
return method.GetObsoleteAttribute (method.ds);
}
bool IMethodData.ShouldIgnore ()
{
return method_data.ShouldIgnore ();
}
public abstract string MethodName { get; }
#endregion
+20 -3
View File
@@ -88,10 +88,20 @@ namespace Mono.CSharp {
// from any class-type S to any interface-type T.
if (target_type.IsInterface) {
if (target_type != TypeManager.iconvertible_type &&
expr_type.IsValueType && (expr is Constant) &&
!(expr is IntLiteral || expr is BoolLiteral ||
expr is FloatLiteral || expr is DoubleLiteral ||
expr is LongLiteral || expr is CharLiteral ||
expr is StringLiteral || expr is DecimalLiteral ||
expr is UIntLiteral || expr is ULongLiteral)) {
return null;
}
if (TypeManager.ImplementsInterface (expr_type, target_type)){
if (expr_type.IsClass)
return new EmptyCast (expr, target_type);
else if (expr_type.IsValueType || expr_type == TypeManager.enum_type)
else if (expr_type.IsValueType)
return new BoxedCast (expr, target_type);
else
return new EmptyCast (expr, target_type);
@@ -846,6 +856,8 @@ namespace Mono.CSharp {
return UserDefinedConversion (ec, source, target, loc, true);
}
static DoubleHash explicit_conv = new DoubleHash (100);
static DoubleHash implicit_conv = new DoubleHash (100);
/// <summary>
/// Computes the MethodGroup for the user-defined conversion
/// operators from source_type to target_type. `look_for_explicit'
@@ -863,7 +875,10 @@ namespace Mono.CSharp {
op_name = "op_Implicit";
MethodGroupExpr union3;
object r;
if ((look_for_explicit ? explicit_conv : implicit_conv).Lookup (source_type, target_type, out r))
return (MethodGroupExpr) r;
mg1 = Expression.MethodLookup (ec, source_type, op_name, loc);
if (source_type.BaseType != null)
mg2 = Expression.MethodLookup (ec, source_type.BaseType, op_name, loc);
@@ -912,7 +927,9 @@ namespace Mono.CSharp {
union4 = Invocation.MakeUnionSet (union5, union6, loc);
}
return Invocation.MakeUnionSet (union3, union4, loc);
MethodGroupExpr ret = Invocation.MakeUnionSet (union3, union4, loc);
(look_for_explicit ? explicit_conv : implicit_conv).Insert (source_type, target_type, ret);
return ret;
}
/// <summary>
+30 -5
View File
@@ -810,18 +810,27 @@ namespace Mono.CSharp {
object r;
error = false;
int p = name.LastIndexOf ('.');
if (dh.Lookup (ns, name, out r))
return (Type) r;
else {
//
// If the type is not a nested type, we do not need `LookupType's processing.
// If the @name does not have a `.' in it, this cant be a nested type.
//
if (ns != ""){
if (Namespace.IsNamespace (ns)){
string fullname = (ns != "") ? ns + "." + name : name;
t = TypeManager.LookupType (fullname);
if (Namespace.IsNamespace (ns)) {
if (p != -1)
t = TypeManager.LookupType (ns + "." + name);
else
t = TypeManager.LookupTypeDirect (ns + "." + name);
} else
t = null;
} else
} else if (p != -1)
t = TypeManager.LookupType (name);
else
t = TypeManager.LookupTypeDirect (name);
}
if (t != null) {
@@ -832,7 +841,7 @@ namespace Mono.CSharp {
//
// In case we are fed a composite name, normalize it.
//
int p = name.LastIndexOf ('.');
if (p != -1){
ns = MakeFQN (ns, name.Substring (0, p));
name = name.Substring (p+1);
@@ -1773,6 +1782,22 @@ namespace Mono.CSharp {
return copy;
}
// find the nested type @name in @this.
public Type FindNestedType (string name)
{
ArrayList applicable = (ArrayList) member_hash [name];
if (applicable == null)
return null;
for (int i = applicable.Count-1; i >= 0; i--) {
CacheEntry entry = (CacheEntry) applicable [i];
if ((entry.EntryType & EntryType.NestedType & EntryType.MaskType) != 0)
return (Type) entry.Member;
}
return null;
}
//
// This finds the method or property for us to override. invocationType is the type where
// the override is going to be declared, name is the name of the method/property, and
+27 -33
View File
@@ -4708,7 +4708,7 @@ namespace Mono.CSharp {
//
// false is normal form, true is expanded form
//
Hashtable candidate_to_form = new PtrHashtable ();
Hashtable candidate_to_form = null;
//
@@ -4746,15 +4746,17 @@ namespace Mono.CSharp {
candidates.Add (candidate);
applicable_type = candidate.DeclaringType;
found_applicable = true;
candidate_to_form [candidate] = false;
} else if (IsParamsMethodApplicable (ec, Arguments, candidate)) {
// Candidate is applicable in expanded form
candidates.Add (candidate);
applicable_type = candidate.DeclaringType;
found_applicable = true;
candidate_to_form [candidate] = true;
}
}
if (candidate_to_form == null)
candidate_to_form = new PtrHashtable ();
// Candidate is applicable in expanded form
candidates.Add (candidate);
applicable_type = candidate.DeclaringType;
found_applicable = true;
candidate_to_form [candidate] = candidate;
}
}
//
@@ -4764,11 +4766,11 @@ namespace Mono.CSharp {
for (int ix = 0; ix < candidate_top; ix++){
MethodBase candidate = (MethodBase) candidates [ix];
bool cand_params = (bool) candidate_to_form [candidate];
bool cand_params = candidate_to_form != null && candidate_to_form.Contains (candidate);
bool method_params = false;
if (method != null)
method_params = (bool) candidate_to_form [method];
method_params = candidate_to_form != null && candidate_to_form.Contains (method);
int x = BetterFunction (ec, Arguments,
candidate, cand_params,
@@ -4820,7 +4822,7 @@ namespace Mono.CSharp {
// Now check that there are no ambiguities i.e the selected method
// should be better than all the others
//
bool best_params = (bool) candidate_to_form [method];
bool best_params = candidate_to_form != null && candidate_to_form.Contains (method);
for (int ix = 0; ix < candidate_top; ix++){
MethodBase candidate = (MethodBase) candidates [ix];
@@ -4840,7 +4842,7 @@ namespace Mono.CSharp {
// IsApplicable (ec, Arguments, method)))
// continue;
bool cand_params = (bool) candidate_to_form [candidate];
bool cand_params = candidate_to_form != null && candidate_to_form.Contains (candidate);
int x = BetterFunction (ec, Arguments,
method, best_params,
candidate, cand_params,
@@ -5228,7 +5230,7 @@ namespace Mono.CSharp {
//
// This checks the `ConditionalAttribute' on the method
//
TypeManager.MethodFlags flags = TypeManager.GetMethodFlags (method, loc);
TypeManager.MethodFlags flags = TypeManager.GetMethodFlags (method);
if ((flags & TypeManager.MethodFlags.ShouldIgnore) != 0)
return;
@@ -6761,21 +6763,13 @@ namespace Mono.CSharp {
"type name instead");
}
static bool IdenticalNameAndTypeName (EmitContext ec, Expression left_original, Location loc)
static bool IdenticalNameAndTypeName (EmitContext ec, Expression left_original, Expression left, Location loc)
{
if (left_original == null)
SimpleName sn = left_original as SimpleName;
if (sn == null || left == null || left.Type.Name != sn.Name)
return false;
if (!(left_original is SimpleName))
return false;
SimpleName sn = (SimpleName) left_original;
Type t = RootContext.LookupType (ec.DeclSpace, sn.Name, true, loc);
if (t != null)
return true;
return false;
return RootContext.LookupType (ec.DeclSpace, sn.Name, true, loc) != null;
}
public static Expression ResolveMemberAccess (EmitContext ec, Expression member_lookup,
@@ -6829,7 +6823,7 @@ namespace Mono.CSharp {
if (decl_type.IsSubclassOf (TypeManager.enum_type)) {
if (left_is_explicit && !left_is_type &&
!IdenticalNameAndTypeName (ec, left_original, loc)) {
!IdenticalNameAndTypeName (ec, left_original, member_lookup, loc)) {
error176 (loc, fe.FieldInfo.Name);
return null;
}
@@ -6913,23 +6907,23 @@ namespace Mono.CSharp {
if (!me.IsStatic){
if ((ec.IsFieldInitializer || ec.IsStatic) &&
IdenticalNameAndTypeName (ec, left_original, loc))
IdenticalNameAndTypeName (ec, left_original, member_lookup, loc))
return member_lookup;
SimpleName.Error_ObjectRefRequired (ec, loc, me.Name);
return null;
}
} else {
if (!me.IsInstance){
if (IdenticalNameAndTypeName (ec, left_original, loc))
if (!me.IsInstance) {
if (IdenticalNameAndTypeName (ec, left_original, left, loc))
return member_lookup;
if (left_is_explicit) {
error176 (loc, me.Name);
return null;
}
}
}
//
// Since we can not check for instance objects in SimpleName,
@@ -6952,7 +6946,7 @@ namespace Mono.CSharp {
}
}
if ((mg != null) && IdenticalNameAndTypeName (ec, left_original, loc))
if ((mg != null) && IdenticalNameAndTypeName (ec, left_original, left, loc))
mg.IdenticalTypeName = true;
me.InstanceExpression = left;
+21 -9
View File
@@ -516,10 +516,8 @@ namespace Mono.CSharp {
{
Type t;
if (ds.Cache.Contains (name)){
if (ds.Cache.Contains (name)) {
t = (Type) ds.Cache [name];
if (t != null)
return t;
} else {
//
// For the case the type we are looking for is nested within this one
@@ -527,9 +525,25 @@ namespace Mono.CSharp {
//
DeclSpace containing_ds = ds;
while (containing_ds != null){
// if the member cache has been created, lets use it.
// the member cache is MUCH faster.
if (containing_ds.MemberCache != null) {
t = containing_ds.MemberCache.FindNestedType (name);
if (t == null) {
containing_ds = containing_ds.Parent;
continue;
}
ds.Cache [name] = t;
return t;
}
// no member cache. Do it the hard way -- reflection
Type current_type = containing_ds.TypeBuilder;
while (current_type != null) {
while (current_type != null &&
current_type != TypeManager.object_type) {
//
// nested class
//
@@ -546,16 +560,14 @@ namespace Mono.CSharp {
}
t = NamespaceLookup (ds, name, silent, loc);
if (t != null){
if (!silent)
ds.Cache [name] = t;
return t;
}
}
if (!silent)
if (t == null && !silent)
Report.Error (246, loc, "Cannot find type `"+name+"'");
return null;
return t;
}
// <summary>
+20 -18
View File
@@ -63,6 +63,7 @@ public class TypeManager {
static public Type ienumerator_type;
static public Type ienumerable_type;
static public Type idisposable_type;
static public Type iconvertible_type;
static public Type default_member_type;
static public Type iasyncresult_type;
static public Type asynccallback_type;
@@ -238,7 +239,6 @@ public class TypeManager {
// </remarks>
static Hashtable builder_to_method;
static Hashtable builder_to_method_2;
// <remarks>
// Contains all public types from referenced assemblies.
@@ -359,7 +359,6 @@ public class TypeManager {
builder_to_declspace = new PtrHashtable ();
builder_to_method = new PtrHashtable ();
builder_to_method_2 = new PtrHashtable ();
method_arguments = new PtrHashtable ();
method_internal_params = new PtrHashtable ();
indexer_arguments = new PtrHashtable ();
@@ -458,20 +457,14 @@ public class TypeManager {
}
[Obsolete("Will be removed very soon")]
public static void AddMethod (MethodBuilder builder, MethodData method)
public static void AddMethod (MethodBase builder, IMethodData method)
{
builder_to_method.Add (builder, method);
}
public static void AddMethod2 (MethodBase builder, IMethodData method)
{
builder_to_method_2.Add (builder, method);
}
public static IMethodData GetMethod (MethodBase builder)
{
return (IMethodData) builder_to_method_2 [builder];
return (IMethodData) builder_to_method [builder];
}
/// <summary>
@@ -671,12 +664,17 @@ public class TypeManager {
Type t = (Type) types [name];
if (t != null)
return t;
t = LookupTypeReflection (name);
if (t == null)
if (negative_hits.Contains (name))
return null;
types [name] = t;
t = LookupTypeReflection (name);
if (t == null)
negative_hits [name] = null;
else
types [name] = t;
return t;
}
@@ -1036,6 +1034,7 @@ public class TypeManager {
ienumerable_type = CoreLookupType ("System.Collections.IEnumerable");
idisposable_type = CoreLookupType ("System.IDisposable");
icloneable_type = CoreLookupType ("System.ICloneable");
iconvertible_type = CoreLookupType ("System.IConvertible");
monitor_type = CoreLookupType ("System.Threading.Monitor");
intptr_type = CoreLookupType ("System.IntPtr");
@@ -2349,19 +2348,22 @@ public class TypeManager {
// This emits an error 619 / warning 618 if the method is obsolete.
// In the former case, TypeManager.MethodFlags.IsObsoleteError is returned.
//
static public MethodFlags GetMethodFlags (MethodBase mb, Location loc)
static public MethodFlags GetMethodFlags (MethodBase mb)
{
MethodFlags flags = 0;
if (mb.DeclaringType is TypeBuilder){
MethodData method = (MethodData) builder_to_method [mb];
IMethodData method = (IMethodData) builder_to_method [mb];
if (method == null) {
// FIXME: implement Obsolete attribute on Property,
// Indexer and Event.
return 0;
}
return method.GetMethodFlags (loc);
if (method.ShouldIgnore ())
flags |= MethodFlags.ShouldIgnore;
return flags;
}
object [] attrs = mb.GetCustomAttributes (true);
+2 -1
View File
@@ -1,3 +1,4 @@
boot-casts.out
mcs-casts.out
*.dll
*.dll
*.log
+12
View File
@@ -1,3 +1,15 @@
2004-05-30 Marek Safar <[email protected]>
* test-240.cs: Enable test.
2004-05-29 Martin Baulig <[email protected]>
* test-266.cs: New test for #52578.
2004-05-29 Martin Baulig <[email protected]>
* test-265.cs: New test for #59267.
2004-05-29 Martin Baulig <[email protected]>
* test-264.cs: New test for #59188.
+20 -16
View File
@@ -39,10 +39,10 @@ TEST_SOURCES = \
test-201 test-202 test-203 test-204 test-205 test-206 test-207 test-208 test-209 test-210 \
test-211 test-212 test-213 test-214 test-215 test-216 test-217 test-218 test-219 test-220 \
test-221 test-222 test-223 test-224 test-225 test-226 test-227 test-229 test-230 \
test-231 test-232 test-233 test-234 test-235 test-236 test-237 test-238 test-239 \
test-231 test-232 test-233 test-234 test-235 test-236 test-237 test-238 test-239 \
test-241 test-242 test-243 test-244 test-245 test-246 test-247 test-248 test-249 test-250 \
test-251 test-252 test-253 test-254 test-255 test-256 test-257 test-258 test-259 test-260 \
test-260 test-261 test-262 test-263 test-264 \
test-260 test-261 test-262 test-263 test-264 test-265 test-266 \
cls-test-0 cls-test-1 cls-test-2 cls-test-3 cls-test-5 cls-test-6 cls-test-7 cls-test-10 \
cls-test-11 cls-test-14 cls-test-15 cls-test-16
@@ -69,16 +69,16 @@ all-local install-local uninstall-local:
# casts
bootstrap-cast.exe: gen-cast-test.cs
$(BOOT_COMPILE) /target:exe /out:$@ $<
$(BOOT_COMPILE) -target:exe /out:$@ $<
casts.cs: bootstrap-cast.exe
$(RUNTIME) $< >$@
casts-mcs.exe: casts.cs
$(CSCOMPILE) /target:exe /out:$@ $<
$(CSCOMPILE) -target:exe /out:$@ $<
casts-boot.exe: casts.cs
$(BOOT_COMPILE) /target:exe /out:$@ $<
$(BOOT_COMPILE) -target:exe /out:$@ $<
boot-casts.out: casts-boot.exe
$(RUNTIME) $< >$@
@@ -157,12 +157,12 @@ test-unsafe-compiler-jit:
#
# Tests that require separate compilation
#
multi: multi-1 multi-2 multi-3 multi-5 ilasm
multi: multi-1 multi-2 multi-3 multi-5 multi-6 ilasm
echo Multi-assembly test passes
multi-1:
$(INTERNAL_MCS) /target:library dll-1.cs
$(INTERNAL_MCS) /r:dll-1.dll prog-1.cs /out:prog-1.exe
$(INTERNAL_MCS) -target:library dll-1.cs
$(INTERNAL_MCS) -r:dll-1.dll prog-1.cs /out:prog-1.exe
$(TEST_RUNTIME) prog-1.exe
#
@@ -172,27 +172,31 @@ multi-1:
# in a library. (eg, that it is not confused by two Main methods)
#
multi-2:
$(INTERNAL_MCS) /target:library pi.cs
$(INTERNAL_MCS) /target:library pp.cs
$(INTERNAL_MCS) -target:library pi.cs
$(INTERNAL_MCS) -target:library pp.cs
$(INTERNAL_MCS) pu.cs -r:pi.dll -r:pp.dll
$(INTERNAL_MCS) pu.cs -r:pp.dll -r:pi.dll
multi-3:
$(INTERNAL_MCS) /target:library conv-lib.cs
$(INTERNAL_MCS) /r:conv-lib.dll conv-main.cs
$(INTERNAL_MCS) -target:library conv-lib.cs
$(INTERNAL_MCS) -r:conv-lib.dll conv-main.cs
$(TEST_RUNTIME) conv-main.exe
multi-4:
$(INTERNAL_MCS) /target:module module-1.cs
$(INTERNAL_MCS) /target:module module-2.cs
$(INTERNAL_MCS) -target:module module-1.cs
$(INTERNAL_MCS) -target:module module-2.cs
$(INTERNAL_MCS) /addmodule:module-1.netmodule /addmodule:module-2.netmodule module-3.cs
$(TEST_RUNTIME) module-3.exe
multi-5:
$(INTERNAL_MCS) /target:library dll-2.cs
$(INTERNAL_MCS) /r:dll-2.dll prog-2.cs /out:prog-2.exe
$(INTERNAL_MCS) -target:library dll-2.cs
$(INTERNAL_MCS) -r:dll-2.dll prog-2.cs /out:prog-2.exe
$(TEST_RUNTIME) prog-2.exe
multi-6:
$(INTERNAL_MCS) -target:library ns0.cs
$(INTERNAL_MCS) ns.cs -r:ns0.dll
ilasm:
$(INTERNAL_ILASM) /dll property-il.il
$(INTERNAL_MCS) /r:property-il.dll property-main.cs /out:property-main.exe
+6
View File
@@ -0,0 +1,6 @@
using Inner = Foo.Bar.Baz.Inner;
public class Driver {
public static void Main () {
Inner.Frob();
}
}
Loaded 100 of 118 files, more files were not shown because too many files have changed in this diff. Show more