diff options
Diffstat (limited to 'mcs/class/System/System.CodeDom.Compiler/CodeGenerator.cs')
-rwxr-xr-x | mcs/class/System/System.CodeDom.Compiler/CodeGenerator.cs | 44 |
1 files changed, 6 insertions, 38 deletions
diff --git a/mcs/class/System/System.CodeDom.Compiler/CodeGenerator.cs b/mcs/class/System/System.CodeDom.Compiler/CodeGenerator.cs index b3f563211bb..7d42931b6d1 100755 --- a/mcs/class/System/System.CodeDom.Compiler/CodeGenerator.cs +++ b/mcs/class/System/System.CodeDom.Compiler/CodeGenerator.cs @@ -392,16 +392,9 @@ namespace System.CodeDom.Compiler { GenerateNamespaceStart (ns); - foreach (CodeNamespaceImport import in ns.Imports) { - if (import.LinePragma != null) - GenerateLinePragmaStart (import.LinePragma); - + foreach (CodeNamespaceImport import in ns.Imports) GenerateNamespaceImport (import); - if (import.LinePragma != null) - GenerateLinePragmaEnd (import.LinePragma); - } - output.WriteLine(); foreach (CodeTypeDeclaration type in ns.Types) { @@ -417,15 +410,8 @@ namespace System.CodeDom.Compiler { protected abstract void GenerateNamespaceImport (CodeNamespaceImport i); protected void GenerateNamespaceImports (CodeNamespace e) { - foreach (CodeNamespaceImport import in e.Imports) { - if (import.LinePragma != null) - GenerateLinePragmaStart (import.LinePragma); - + foreach (CodeNamespaceImport import in e.Imports) GenerateNamespaceImport (import); - - if (import.LinePragma != null) - GenerateLinePragmaEnd (import.LinePragma); - } } protected void GenerateNamespaces (CodeCompileUnit e) @@ -486,14 +472,7 @@ namespace System.CodeDom.Compiler { protected virtual void GenerateSnippetCompileUnit (CodeSnippetCompileUnit e) { - if (e.LinePragma != null) - GenerateLinePragmaStart (e.LinePragma); - output.WriteLine (e.Value); - - if (e.LinePragma != null) - GenerateLinePragmaEnd (e.LinePragma); - } protected abstract void GenerateSnippetExpression (CodeSnippetExpression e); @@ -990,17 +969,11 @@ namespace System.CodeDom.Compiler { private void GenerateType (CodeTypeDeclaration type) { - if (type.LinePragma != null) - GenerateLinePragmaStart (type.LinePragma); - CodeTypeDelegate del = type as CodeTypeDelegate; if (del != null) GenerateDelegate (del); else GenerateNonDelegateType (type); - - if (type.LinePragma != null) - GenerateLinePragmaEnd (type.LinePragma); } private void GenerateDelegate (CodeTypeDelegate type) @@ -1008,6 +981,8 @@ namespace System.CodeDom.Compiler { CodeTypeDeclaration prevType = this.currentType; this.currentType = type; + InitOutput (output, options); + foreach (CodeCommentStatement statement in type.Comments) GenerateCommentStatement (statement); @@ -1024,6 +999,8 @@ namespace System.CodeDom.Compiler { CodeTypeDeclaration prevType = this.currentType; this.currentType = type; + InitOutput (output, options); + foreach (CodeCommentStatement statement in type.Comments) GenerateCommentStatement (statement); @@ -1047,18 +1024,12 @@ namespace System.CodeDom.Compiler { CodeTypeMember prevMember = this.currentMember; this.currentMember = member; - if (prevMember != null && prevMember.LinePragma != null) - GenerateLinePragmaEnd (prevMember.LinePragma); - if (options.BlankLinesBetweenMembers) output.WriteLine (); foreach (CodeCommentStatement statement in member.Comments) GenerateCommentStatement (statement); - if (member.LinePragma != null) - GenerateLinePragmaStart (member.LinePragma); - CodeMemberEvent eventm = member as CodeMemberEvent; if (eventm != null) { @@ -1116,9 +1087,6 @@ namespace System.CodeDom.Compiler { this.currentMember = prevMember; } - - if (currentMember != null && currentMember.LinePragma != null) - GenerateLinePragmaEnd (currentMember.LinePragma); GenerateTypeEnd (type); this.currentType = prevType; |