Commit Graph
78 Commits
Author SHA1 Message Date
Marek Safar 81e3a33c79 Write only import section from global namespaces before global attribute sections. Fixes #13523 2013-07-30 20:18:48 +02:00
Jb Evain 53e77d3628 Prevent multiple threads to populate the keyword table 2013-06-07 23:51:47 +02:00
Ilker Cetinkaya d331ccd21f Fixed space indents to tabs to adhere to Mono coding guidelines. 2012-01-14 17:07:00 +01:00
Ilker Cetinkaya ce2de2d1f2 CSharpCodeGenerator now obeys CS1529 when rendering global namespace imports alongside with assembly attribute with GenerateFromCompileUnit. 2012-01-14 12:28:18 +01:00
Lluis Sanchez 296246af84 [CSharpCodeGenerator] Revert change for not ignoring Final attr on fields
MS.NET does ignore the Final attribute for fields, so we
have to ignore it to be compatible. Also, CodeMemberField
objects are created with the Final flag set, so with this
change all fields were now generated as readonly, which
is a severe regression.
2011-09-28 18:20:42 +02:00
Jeffrey Stedfast d81c5ca45e [CSharpCodeGenerator] Output global:: if GlobalReference option set 2011-06-15 12:26:17 -04:00
Jeffrey Stedfast 236b6fab6e [CSharpCodeGenerator] Don't ignore MemberAttributes.New for types 2011-06-15 12:26:17 -04:00
Jeffrey Stedfast 41a9e93682 [CSharpCodeGenerator] don't ignore Final attr on Fields 2011-06-15 12:26:16 -04:00
Miguel de Icaza 48292550e8 More NET_2_0 define removal 2011-03-16 21:46:02 -04:00
Jonathan Pryor 637442adea * Test/Microsoft.CSharp/CodeGeneratorFromExpressionTest.cs: Test
CodeDefaultValueExpression generation.
	* Microsoft.CSharp/CCSharpCodeGenerator.cs: Support generating 
	  default(T) expressions.

svn path=/trunk/mcs/; revision=155265
2010-04-12 20:34:54 +00:00
Michael Hutchinson ce8e1f867a 2009-10-19 Michael Hutchinson <[email protected]>
* CSharpCodeGenerator.cs: Remove #if NET_2_0 as they're unneeded 
	  now, and this makes it easier to sync with MD's branched copy.


svn path=/trunk/mcs/; revision=144388
2009-10-19 17:04:51 +00:00
Atsushi Eno 36909a4877 2008-10-28 Atsushi Enomoto <[email protected]>
* CSharpCodeGenerator.cs : escape #pragma checksum argument literal
	  which could contain '\' (must be escaped).


svn path=/trunk/mcs/; revision=117246
2008-10-28 10:16:55 +00:00
Atsushi Eno d9f703d5b8 2008-08-07 Atsushi Enomoto <[email protected]>
* CSharpCodeGenerator.cs : fixed bug #387878, patch by Ted Unangst.
	  The number of generic type arguments must not be assumed as less 
	  than 10.


svn path=/trunk/mcs/; revision=109837
2008-08-07 08:30:02 +00:00
Jb Evain c1407c9775 2008-07-22 Jb Evain <[email protected]>
* CSharpCodeProvider.cs: fix the constructor to take an IDictionary
	instead of a plain Dictionary for provider options.
	* CSharpCodeGenerator.cs, CSharpCodeCompiler.cs: update accordingly.
	Fixes #411105.



svn path=/trunk/mcs/; revision=108446
2008-07-22 06:02:13 +00:00
Martin Baulig f4d7aa417b 2008-05-19 Martin Baulig <[email protected]>
* CSharpCodeGenerator.cs: In the 2.0 profile, emit `#line hidden'
	in addition to `#line default'.


svn path=/trunk/mcs/; revision=103471
2008-05-19 13:58:54 +00:00
Gert Driesen aff3d9ea90 * CSharpCodeGenerator.cs: On 2.0 profile, add support for params
keyword when System.ParamArrayAttribute custom attribute is added.
Fixes bug #387877.
* CodeGeneratorFromTypeTestBase.cs: Added tests for
System.ParamArrayAttribute custom attribute.
* CodeGeneratorFromTypeTest.cs: Added tests for
System.ParamArrayAttribute custom attribute.

svn path=/trunk/mcs/; revision=102885
2008-05-09 20:49:59 +00:00
Jb Evain a1870713d8 refactoring
svn path=/trunk/mcs/; revision=100239
2008-04-09 16:04:43 +00:00
Jb Evain 656c64084a 2008-04-09 Jb Evain <[email protected]>
* CSharpCodeGenerator.cs: Emit bodyless getters and setters
	for abstract properties. Based on a patch by
	Stefan Rusek <[email protected]>

svn path=/trunk/mcs/; revision=100235
2008-04-09 15:39:04 +00:00
Jb Evain e99ccabc56 revert
svn path=/trunk/mcs/; revision=100230
2008-04-09 14:58:15 +00:00
Jb Evain 11eca3e640 2008-04-08 Jb Evain <[email protected]>
* CSharpCodeGenerator.cs: Emit bodyless getters and setters
	for abstract properties. Based on a patch by
	Stefan Rusek <[email protected]>


svn path=/trunk/mcs/; revision=100131
2008-04-08 19:09:38 +00:00
Gert Driesen 04ed5e0ffa * CSharpCodeGenerator.cs: Avoid ArgumentNullException when
CodeDelegateInvokeExpression.TargetObject is null. 
* VBCodeGenerator.cs: In GenerateDelegateInvokeExpression, only emit
RaiseEvent statement on 2.0 profile if TargetObject is a
CodeEventReferenceExpression. Spaces to tabs and code formatting.
* CodeGenerator.cs: Fixed ArgumentException argument names. Indent
expression list.
* CodeGeneratorFromExpressionTest.cs: Copied some tests from VB, and
improved existing tests.
* CodeGeneratorFromExpressionTest.cs: Numbered tests. Fixed test for
DelegateInvokeExpression to pass on MS 2.0 and improved coverage.

svn path=/trunk/mcs/; revision=94055
2008-01-27 16:06:24 +00:00
Gert Driesen b8b445860f * CodeGeneratorFromCompileUnitTest.cs: Avoid using "", and use
Assert instead of Assertion.
* CodeGeneratorFromNamespaceTest.cs: Added tests for type parameters.
* CodeGeneratorFromNamespaceTest.cs: Added tests for type parameters.
* CSharpCodeGenerator.cs: Cosmetic changes to the code emitted for
type constraints. Allows our unit tests to pass on both Mono and MS.
* VBCodeGenerator.cs: Implement support for type parameters.

svn path=/trunk/mcs/; revision=93075
2008-01-16 18:15:25 +00:00
Juraj Skripsky 232d3a9a1d 2008-01-16 Juraj Skripsky <[email protected]>
* CSharpCodeGenerator.cs (GenerateGenericsConstraints): Take 
	solitary constructor constraints into account. Fixes bug #353921.


svn path=/trunk/mcs/; revision=93014
2008-01-16 07:09:16 +00:00
Marek Habersack f3e716d95e 2007-12-15 Marek Habersack <[email protected]>
* System.dll.sources: added
	System.CodeDom.Compiler/CompilerProviderOption.cs and
	System.CodeDom.Compiler/CompilerProviderOptionsCollection.cs
2007-12-15  Marek Habersack  <[email protected]>

	* CSharpCodeProvider.cs: added support for the 2.0sp1 constructor
	which takes a Dictionary <string, string> parameter with compiler
	provider options. If any options are present, the
	generator/compiler are created using appropriate constructor
	overload.

	* CSharpCodeGenerator.cs: added support for the 2.0sp1 constructor
	which takes a Dictionary <string, string> parameter with compiler
	provider options.

	* CSharpCodeCompiler.cs: added support for the 2.0sp1 constructor
	which takes a Dictionary <string, string> parameter with compiler
	provider options. The "CompilerVersion" option is supported, with
	possible values "2.0" (currently maps to -langversion:Default) and
	"3.5" (currently maps to -langversion:linq).
2007-12-15  Marek Habersack  <[email protected]>

	* Compiler.cs: added support for the default collection of
	<providerOption> child elements and corresponding public
	properties (ProviderOptions and ProviderOptionsDictionary).

	* CompilerInfo.cs: added ProviderOptions dictionary, to hold
	values from the <providerOption> collection of the
	system.codeDom/compilers/compiler/ element.
	CodeDomProviderType throws an exception if the provider type
	cannot be found, as per MSDN.
	CreateProvider uses the new provider constructor which takes
	provider options dictionary as its parameter, if found in the
	provider type.

	* CompilerCollection.cs: compiler defaults are initialized using
	the provider options dictionary, with one option present -
	"CompilerVersion" set to "2.0".
	Two dictionaries to map languages and extensions to compiler
	information objects added.

	* CompilerProviderOption.cs: added - implements the
	<providerOption> element.

	* CompilerProviderOptionsCollection.cs: added - implements
	collection for the 2.0sp1 <providerOption> child element of the
	system.codeDom/compilers/compiler element.


svn path=/trunk/mcs/; revision=91337
2007-12-15 01:46:04 +00:00
Atsushi Eno d1876f80b3 2007-10-26 Atsushi Enomoto <[email protected]>
* CSharpCodeGenerator.cs : property name was not escaped.

	* CodeGeneratorFromTypeTest.cs : added test case for escaped
	  CodeProperty output name (keyword).


svn path=/trunk/mcs/; revision=88249
2007-10-26 10:03:20 +00:00
Atsushi Eno 62a6678fad 2007-01-18 Atsushi Enomoto <[email protected]>
* CodeTypeReference.cs :
	  Support generic type definition in .ctor(Type)
	  Handle generic type in straightforward way in .ctor(Type), no need
	  to do ToString() and Parse().
	  Supply "`n" in .ctor(string,params CodeTypeReference[]).

	* CSharpCodeGenerator.cs : for GenericTypeParameter, GetTypeOutput()
	  should just print its name.
	  For generic type definition, print "<>". OutputTypeArguments() was
	  also causing IndexOutOfRangeException.

	* CodeGeneratorFromTypeTestBase.cs :
	  added GenerateGenericCodeTypeReferences() for generic type test.

	* CodeGeneratorFromTypeTest.cs :
	  Added test for generic type references output.

	* CodeTypeReferenceTest.cs :
	  Fixed generic type tests and let them involved in the actual tests.
	  Added some more generic type tests, including generic type
	  definition.


svn path=/trunk/mcs/; revision=71244
2007-01-18 10:23:33 +00:00
Marek Habersack 06538ead84 Implement actual identifier checking
svn path=/trunk/mcs/; revision=70247
2006-12-30 01:50:11 +00:00
Gonzalo Paniagua Javier d620a52c7a revert my last patch. It broke a test
svn path=/trunk/mcs/; revision=65853
2006-09-24 14:40:04 +00:00
Gonzalo Paniagua Javier 550c1d65c7 svn path=/trunk/mcs/; revision=65622 2006-09-19 05:15:06 +00:00
Gonzalo Paniagua Javier e7bdcf1683 2006-09-19 Gonzalo Paniagua Javier <[email protected]>
* CSharpCodeGenerator.cs: indent comment lines after the first one and
	speed it up a little bit.


svn path=/trunk/mcs/; revision=65620
2006-09-19 05:12:48 +00:00
Gert Driesen c3f574d8f0 * CodeGeneratorFromExpressionTest.cs: Added tests for
CodePrimitiveExpression.
* CSharpCodeGenerator.cs: Override GeneratePrimitiveExpression to
match .NET 1.x and 2.0 for float, decimal, char, ushort, uint, ulong
and sbyte.
* CodeGenerator.cs: Modified GeneratePrimitiveExpression to throw
ArgumentException for sbyte value, use GenerateSingleFloatValue for
float, GenerateDecimalValue for decimal and GenerateDoubleValue for
double. Modified exception message for non-primitive types to match
MS.NET.
* ICodeCompiler.cs: Set eol-style to native.
* CodeCompiler.cs: Set eol-style to native.
* CodeDomConfigurationHandler.cs: Set eol-style to native.
* CodeDomProvider.cs: Set eol-style to native.
* CodeGeneratorOptions.cs: Set eol-style to native.
* CodeParser.cs: Set eol-style to native.
* CompilerError.cs: Set eol-style to native.
* CompilerErrorCollection.cs: Set eol-style to native.
* CompilerInfo.cs: Set eol-style to native.
* CompilerParameters.cs: Set eol-style to native.
* CompilerResults.cs: Set eol-style to native.
* Executor.cs: Set eol-style to native.
* GeneratorSupport.cs: Set eol-style to native.
* ICodeGenerator.cs: Set eol-style to native.
* ICodeParser.cs: Set eol-style to native.
* LanguageOptions.cs: Set eol-style to native.
* TempFileCollection.cs: Set eol-style to native.
* VBCodeGenerator.cs: Modified GeneratePrimitiveExpression to match
.NET 1.x and 2.0 for char, float, ushort, uint, ulong and sbyte.

svn path=/trunk/mcs/; revision=54032
2005-12-07 13:16:31 +00:00
Gert Driesen e4e516d410 * CodeGeneratorFromStatementTest.cs: Added tests for
CodeAssignStatement, CodeAttachEventStatement,
CodeConditionStatement, CodeExpressionStatement,
CodeIterationStatement, CodeLabeledStatement,
CodeMethodReturnStatement, CodeRemoveEventStatement,
CodeSnippetStatement, CodeStatement, CodeVariableDeclarationStatement.
* CodeRemoveEventStatementTest.cs: Added tests for ctors.
* IndentedTextWriterTest.cs: Added tests for Indent property.
* CodeGeneratorFromStatementTest.cs: Added tests for
CodeAssignStatement, CodeAttachEventStatement, CodeConditionStatement,
CodeExpressionStatement, CodeIterationStatement,
CodeLabeledStatement, CodeMethodReturnStatement,
CodeRemoveEventStatement and CodeSnippetStatement.
* CSharpCodeGenerator.cs: No longer output semicolon and newline for
CodeVariableDeclarationStatement in for statement, fixes #75292.
Fixed NRE in GenerateEventReferenceExpression. Cosmetic changes to
code generated for iteration to match MS.NET. Temporary reduce
indentation for label and no longer escape label if its a keyword.
* CodeRemoveEventStatement.cs: Event returns new CodeEventReference
if underlying value is null.
* System_test.dll.sources: Added CodeRemoveEventStatementTest.cs from
System.CodeDom.
* CodeGenerator.cs: Corrected line endings. Set eol-style to native.
* IndentedTextWriter.cs: Indent can no longer become negative.
* VBCodeGenerator.cs: Fixed NRE in GenerateEventReferenceExpression,
and escape event name. Indent statements for iteration. Avoid
ArgumentNullException if expression is not set for CodeReturnStatement.
Temporary reduce indentation for label, and fixed ArgumentNullException
if no statement is set. Cosmetic changes to code generated for
condition to match MS.NET. In OutputTypeNamePair, escape name.

svn path=/trunk/mcs/; revision=53703
2005-11-30 18:54:17 +00:00
Gert Driesen fe32d6af83 * CodeGeneratorFromExpressionTest.cs: Added test for
CodeParameterDeclarationExpression.
* CodeGeneratorFromTypeTest.cs: Modified tests to check result
for zero-length event, field and parameter name.
* CodeGeneratorFromStatementTest.cs: Added CodeCommentStatement,
CodeThrowExceptionStatement, CodeGotoStatement and
CodeTryCatchFinallyStatement tests.
* CodeGeneratorFromTypeTestBase.cs: Modified GetMethodMembersType3 to
add parameter with no name.
* CodeGeneratorTestBase.cs: Removed Code property, added Generate
overload taking CodeGeneratorOptions, added NewLine property.
* CodeGeneratorCompileUnitTest.cs: Use Generate method instead of
Code property.
* CodeGeneratorFromExpressionTest.cs: Added test for
CodeParameterDeclarationExpression.
* CodeGeneratorFromTypeTest.cs: Added tests for __exception name that
is output for zero-length field, event and parameter name in 2.0
profile.
* CodeGeneratorFromStatementTest.cs: Added.
* CSharpCodeGenerator.cs: Fixed GenerateComment to also write
comment chars for carriage-return (and skip linefeed, if its the
next character). Fixed output for TryCatchFinallyStatement. Fixed
GotoStatement to end with newline.
* VBCodeGenerator.cs: Fixed NullReferenceException if no ToThrow
expression is set for CodeThrowExceptionStatement. Fixed
GenerateComment to output comment chars for carriage-returns and
linefeed characters. Modified code generated for
CodeTryCatchFinallyStatement to match MS.NET. Fixed code generated
for CodeGotoStatement to match MS.NET. On 2.0 profile, output
"__exception" if name is zero-length string in OutputTypeNamePair.

svn path=/trunk/mcs/; revision=53506
2005-11-26 16:23:45 +00:00
Gert Driesen 553a7f2083 * System_test.dll.sources: Added CodeCastExpressionTest.cs,
CodeCatchClauseTest.cs, CodeChecksumPragmaTest.cs,
CodeConstructorTest.cs, CodeDefaultValueExpressionTest.cs;
CodeDelegateCreateExpressionTest.cs, CodeEventReferenceExpressionTest.cs
CodeGotoStatementTest.cs, CodeLabeledStatementTest.cs,
CodeLinePragmaTest.cs, CodeMemberMethodTest.cs,
CodeMethodInvokeExpressionTest.cs, CodeMethodReferenceExpressionTest.cs,
CodeNamespaceImportTest.cs, CodeNamespaceTest.cs,
CodeObjectCreateExpressionTest.cs,
CodeParameterDeclarationExpressionTest.cs,
CodePropertyReferenceExpressionTest.cs, CodeRegionDirectiveTest.cs,
CodeSnippetCompileUnitTest.cs, CodeSnippetExpressionTest.cs,
CodeSnippetStatementTest.cs, CodeSnippetTypeMemberTest.cs,
CodeStatementCollectionTest.cs, CodeTypeConstructorTest.cs,
CodeTypeParameterTest.cs, CodeTypeOfExpressionTest.cs,
CodeTypeReferenceExpressionTest.cs,
CodeVariableDeclarationStatementTest.cs,
CodeVariableReferenceExpressionTest.cs
* CSharpCodeGenerator.cs: Ignore ChecksumData of CodeChecksumPragma
if null.
* CodeTypeReferenceExpressionTest.cs: Added tests.
* CodeVariableDeclarationStatementTest.cs: Added tests.
* CodePropertyReferenceExpressionTest.cs: Added tests.
* CodeNamespaceImportTest.cs: Added tests.
* CodeTypeConstructorTest.cs: Added tests.
* CodeSnippetExpressionTest.cs: Added tests.
* CodeParameterDeclarationExpressionTest.cs: Added tests.
* CodeObjectCreateExpressionTest.cs: Added tests.
* CodeTypeDelegateTest.cs: Set eol-style to native.
* CodeLabeledStatementTest.cs: Added tests.
* CodeConstructorTest.cs: Added tests.
* CodeTypeOfExpressionTest.cs: Added tests.
* CodeGotoStatementTest.cs: Added tests.
* CodeCastExpressionTest.cs: Added tests.
* CodeMemberFieldTest.cs: Set eol-style to native.
* CodeMethodInvokeExpressionTest.cs: Added tests.
* CodeEventReferenceExpressionTest.cs: Added tests.
* CodeChecksumPragmaTest.cs: Added tests.
* CodeSnippetCompileUnitTest.cs: Added tests.
* CodeNamespaceTest.cs: Added tests.
* CodeSnippetStatementTest.cs: Added tests.
* CodeMemberMethodTest.cs: Added tests.
* CodeMemberPropertyTest.cs: Set eol-style to native.
* CodeCatchClauseTest.cs: Added tests.
* CodeStatementCollectionTest.cs: Added tests.
* CodeRegionDirectiveTest.cs: Added tests.
* CodeTypeParameterTest.cs: Added tests.
* CodeVariableReferenceExpressionTest.cs: Added tests.
* CodeDefaultValueExpressionTest.cs: Added tests.
* CodeSnippetTypeMemberTest.cs: Added tests.
* CodeDelegateCreateExpressionTest.cs: Added tests.
* CodeLinePragmaTest.cs: Added tests.
* CodeMethodReferenceExpressionTest.cs: Added tests.
* CodeEventReferenceExpression.cs: EventName now returns zero-length
string if underlying value is null.
* CodeParameterDeclarationExpressionCollection.cs: Fixed AddRange to
add each item to collection using Add method to ensure validation
is performed.
* CodeChecksumPragma.cs: FileName now returns zero-length string
if underlying value is null.
* CodeSnippetCompileUnit.cs: Value now returns zero-length string if
underlying value is null.
* CodeNamespace.cs: Name now returns zero-length string if underlying
value is null.
* CodeSnippetStatement.cs: Value now returns zero-length string if
underlying value is null.
* CodeMemberMethod.cs: code formatting change.
* CodeCatchClause.cs: CatchExceptionType now returns CodeTypeReference
instance for System.Exception if underlying value is null. LocalName
now returns zero-length string if underlying value is null.
* CodeStatementCollection.cs: Fixed AddRange to add each item to
collection using Add method to ensure validation is performed. Code
formatting changes.
* CodeRegionDirective.cs: RegionText now returns zero-length string
if underlying value is null.
* CodeTypeParameter.cs: Name now returns zero-length string if
underlying value is null.
* CodeVariableReferenceExpression.cs: VariableName now returns
zero-length string if underlying value is null.
* CodeDefaultValueExpression.cs: Type now returns CodeTypeReference
for void if underlying value is null.
* CodeExpressionCollection.cs: Fixed AddRange to add each item to
collection using Add method to ensure validation is performed.
* CodeSnippetTypeMember.cs: Text now returns zero-length string if
underlying value is null.
* CodeTypeReferenceCollection.cs: Fixed AddRange to add each item
to collection using Add method to ensure validation is performed.
* CodeDelegateCreateExpression.cs: DelegateType now returns
CodeTypeReference for void if underlying value is null. MethodName
now returns zero-length string if underlying value is null.
* CodeMethodReferenceExpression.cs: MethodName now returns
zero-length string if underlying value is null.
* CodeLinePragma.cs: FileName now returns zero-length string if
underlying value is null.
* CodeTypeReferenceExpression.cs: Type now return CodeTypeReference
for void if underlying value is null.
* CodeVariableDeclarationStatement.cs: Name now return zero-length
string if underlying value is null. Type returns CodeTypeReference
for void if underlying value is null.
* CodePropertyReferenceExpression.cs: PropertyName now returns
zero-length string if underlying value is null.
* CodeNamespaceImport.cs: Namespace now returns zero-length string
if underlying value is null.
* CodeTypeConstructor.cs: Name is fixed to ".cctor" to match MS.NET.
* CodeSnippetExpression.cs: Value now returns zero-length string if
underlying value is null.
* CodeParameterDeclarationExpression.cs: Name now returns zero-length
string if underlying value is null. Type now returns CodeTypeReference
for void if underlying value is null.
* CodeObjectCreateExpression.cs: CreateType now returns
CodeTypeReference for void if underlying value is null.
* CodeLabeledStatement.cs: Label returns zero-length string if
underlying value is null.
* CodeConstructor.cs: Name is fixed to ".ctor" to match MS.NET.
* CodeTypeOfExpression.cs: Type returns CodeTypeReference for void
if underlying value is null.
* CodeGotoStatement.cs: Only throw ArgumentNullException for null or
zero-length label on 2.0 profile.
* CodeCastExpression.cs: TargetType returns CodeTypeReference for void
if underlying value is null.
* CodeMethodInvokeExpression.cs: Method returns a default
CodeMethodReferenceExpression instance if the underlying value is
null.

svn path=/trunk/mcs/; revision=52579
2005-11-04 16:09:59 +00:00
Gert Driesen 4a813ed0db * CodeGeneratorFromTypeTest.cs: Added tests for CodeEntryPointMethod
and bug #76580.
* CodeGeneratorTestBase.cs: Set eol-style to native.
* CodeGeneratorTest.cs: Set eol-style to native.
* CodeGeneratorFromTypeTestBase.cs: Added tests for
CodeEntryPointMethod and bug #76580. Set eol-style to native.
* IndentedTextWriterTest.cs: Set eol-style to native.
* CodeGeneratorFromTypeTest.cs: Added tests for CodeEntryPointMethod
and bug #76580.
* CSharpCodeGenerator.cs: Use fixed signature for entrypoint method
on 1.0 profile. On 2.0 profile output custom attributes, and return
type. On 1.0 profile, also replace + with dot (for nested types).
Fixes bug #76580. Set eol-style to native.
* CSharpCodeCompiler.cs: Set eol-style to native.
* CSharpCodeProvider.cs: Set eol-style to native.
* VBCodeGenerator.cs: Use fixed signature for entrypoint method.
Only output attributes on 2.0 profile. Replace + with dot in type
name (for nested types). Fixes bug #76580.


svn path=/trunk/mcs/; revision=52344
2005-10-28 18:05:39 +00:00
Gert Driesen ad78342af9 * CodeGeneratorTestBase.cs: Generate now returns code that was output,
and takes CodeGeneratorOptions instance in order to support testing
bracing style.
* CodeGeneratorFromCompileUnitTest.cs: Added tests for C bracing style.
* CodeGeneratorFromNamespaceTest.cs: Added tests for C bracing style.
* CodeGeneratorFromExpressionTest.cs: Clean up.
* CodeGeneratorFromTypeTest.cs: Added tests for C bracing style.
* CodeGeneratorTestBase.cs: No longer keep instance of StringWriter to
allow GenerateCodeFromType to be executed multiple times with relying
on user to reset writer. Allow CodeGeneratorOptions to be passed in,
in order to support bracing style tests.
* CodeGeneratorFromTypeTestBase.cs: Modify Generate* methods to take
CodeGeneratorOptions instance and pass it on to GenerateCodeFromType.
* CodeGeneratorFromTypeTest.cs: Reworked tests to pass
CodeGeneratorOptions to Generate* methods.
* CodeGeneratorTestBase.cs: Generate now returns code that was output,
and take CodeGeneratorOptions instance in order to support testing
bracing style.
* CodeGeneratorFromCompileUnitTest.cs: Added tests for C bracing style.
* CodeGeneratorFromNamespaceTest.cs: Added tests for C bracing style.
* CodeGeneratorFromExpressionTest.cs: Clean up.
* CodeGeneratorFromTypeTest.cs: Added tests for C bracing style.
* CSharpCodeGenerator.cs: Support C bracing style. Fixes bug #76286.

svn path=/trunk/mcs/; revision=51753
2005-10-15 16:41:32 +00:00
Gert Driesen 6f13bef75d * CodeGeneratorTypeOutputTest.cs: Added tests for CSharpCodeGenerator.GetTypeOutput.
* CodeTypeReferenceTest.cs: Added tests for multi-dimensional arrays.
* CSharpCodeGenerator.cs: Fixed supported for type arguments in
GetTypeOutput on 2.0 profile. Partial fix for bug #76286.
* CodeTypeReference.cs: Fixed Parse implementation on 1.0 profile.
Added MonoTODO's.
* System_test.dll.sources: Added CodeGeneratorTypeOutputTest.cs
from Test/Microsoft.CSharp.

svn path=/trunk/mcs/; revision=51378
2005-10-06 22:49:14 +00:00
Gert Driesen 2ae96ccc57 * CodeGeneratorFromTypeTest.cs: Added NewSlot tests.
* CSharpCodeGenerator.cs: Fixed code generated for NewSlot members.
* CodeGeneratorFromTypeTestBase.cs: Added NewSlot tests.
* CodeGenerator.cs: In OutputMemberScopeModifier, only output "new" modifier 
in 2.0 profile.
* VBCodeGenerator.cs: Fixed code generated for NewSlot members.

svn path=/trunk/mcs/; revision=47859
2005-07-30 16:27:36 +00:00
Gert Driesen cafc6003d6 * CodeGeneratorFromTypeTest.cs: Added BaseTypes and TypeConstructor
tests. Added enum, interface and delegate tests.
* CodeTypeDelegateTest.cs: Added tests for BaseTypes and ReturnType.
* CodeGeneratorTest.cs: Removed duplicate import of NUNit.Framework namespace.
* CodeGeneratorFromTypeTestBase.cs: Added BaseTypes and TypeConstructor tests.
* CodeGeneratorFromTypeTest.cs: Added BaseTypes and TypeConstructor
tests. Enabled enum, interface and delegate tests.
* CSharpCodeGenerator.cs: Fixed generated code for enums, interfaces
and delegates to match MS.NET.
* CodeTypeReference.cs: Added internal IsInterface property.
* CodeTypeDelegate.cs: System.Delegate is base type, and make sure
ReturnType is initialized.
* System_test.dll.sources: Added CodeTypeDelegateTest.cs from System.CodeDom.
* CodeGenerator.cs: Threat delegates like any other type.
* VBCodeGenerator.cs: Fixed generated code for enums, interfaces and
delegates to match MS.NET.

svn path=/trunk/mcs/; revision=47604
2005-07-24 12:19:26 +00:00
Gert Driesen a72cae2ddb * CodeGeneratorFromTypeTest.cs: Added test for ReturnTypeCustomAttributes.
* CSharpCodeGenerator.cs: Fixed output of ReturnTypeCustomAttributes.
* VBCodeGenerator.cs: Added support for ReturnTypeCustomAttributes.

svn path=/trunk/mcs/; revision=46950
2005-07-05 15:39:44 +00:00
Gert Driesen 50c1a55a78 * CodeGeneratorFromTypeTest.cs: Added event ImplementationTypes tests. Added
PrivateImplementationType and property and method overload tests. Added 
property indexer tests.
* CodeGeneratorFromTypeTest.cs: Modified test to ensure that scope modifiers 
are not output for events.
* CSharpCodeGenerator.cs: Added PrivateImplementationType support for events,
properties, methods. No longer output scope modifier for events.
* VBCodeGenerator.cs: Scope modifiers should not be output for events.

svn path=/trunk/mcs/; revision=46882
2005-07-02 19:03:58 +00:00
Gert Driesen b573a24041 * CodeGeneratorFromTypeTest.cs: Added property indexer and parameter tests.
* CSharpCodeGenerator.cs: Only consider property an indexer if name is Item 
(case-insensitive comparison) and property has parameters.
* VBCodeGenerator.cs: Mark indexer as default property.

svn path=/trunk/mcs/; revision=46782
2005-06-30 18:29:13 +00:00
Gert Driesen 9db8d8e301 * CodeGeneratorFromExpressionTest.cs: No longer inherit from
CodeGeneratorTestBase. Added tests for CodeTypeReference.
* CodeTypeReferenceTest.cs: Tests for zero-length and null type names,
and null type.
* CodeGeneratorFromExpressionTest.cs: Renumbered tests for
TypeReferenceExpressionTest. Added tests for zero-length or null
type name, and object type.
* CSharpCodeGenerator.cs: Fixed GetTypeOutput to match MS.NET 1.x and 2.0.
* CodeTypeReference.cs: Also consider null type name as void, throw
ArgumentNullException for null type on 2.0 profile.
* System_test.dll.sources: Added CodeTypeReferenceTest.cs from
System.CodeDom.

svn path=/trunk/mcs/; revision=46662
2005-06-28 18:17:53 +00:00
Gert Driesen 652f6e5b3b * CodeGeneratorFromTypeTest.cs: Added tests to verify code generated for
events, fields, properties, methods and ctors to match MS.NET.
* CSharpCodeGenerator.cs: Fixed generated code for events, fields, properties,
methods and ctors to match MS.NET.

svn path=/trunk/mcs/; revision=46518
2005-06-26 15:13:54 +00:00
Gert Driesen 3269917f25 * CodeGeneratorFromTypeTest.cs: Added tests to verify code generated for Type
(with and without custom attributes).
* CSharpCodeGenerator.cs: Modified generated code for type-level attributes
to match MS.NET.

svn path=/trunk/mcs/; revision=46498
2005-06-25 17:18:05 +00:00
Gert Driesen 1ca65db824 * CodeGeneratorFromCompileUnitTest.cs: Added tests to verify code that is
generated for assembly-level custom attributes.
* CSharpCodeGenerator.cs: Fixed generated code for assembly-level custom
attributes to match code generated by MS.NET.

svn path=/trunk/mcs/; revision=46497
2005-06-25 16:45:17 +00:00
Gert Driesen 9ab64a10b8 * CSharpCodeGenerator.cs: Win32 resources are supported. Fixes bug #75218.
* CSharpCodeCompiler.cs: Clean up temporary files after compilation. Fixes
bug #75221. Added support for Win32 resources. Fixes bug #75218.
* CSharpCodeProviderTest.cs: Added tests for bug #75218 and #75221.

svn path=/trunk/mcs/; revision=45802
2005-06-11 05:55:17 +00:00
Gonzalo Paniagua Javier 1d9c9e2441 Fix warnings
svn path=/trunk/mcs/; revision=43368
2005-04-21 00:47:25 +00:00
Jonathan Pryor bcedf68b0a * CSharpCodeGenerator.cs: Remove extra ' ' emitted after class name in
GenerateTypeStart().  This removes a regression test failure in
    MonoTests.Microsoft.CSharp.CodeGeneratorFromTypeTest.DefaultTypeTest.

svn path=/trunk/mcs/; revision=39170
2005-01-19 15:09:50 +00:00
Lluis Sanchez 0f002627e1 2005-01-12 Lluis Sanchez Gual <[email protected]>
* CSharpCodeGenerator.cs: Avoid keywords when writing enum members.
	Removed the GetSafeTypeName method. It was a wrong bug fix. Type names
	are expected to always use the full name form, never the alias.


svn path=/trunk/mcs/; revision=38747
2005-01-12 00:42:00 +00:00