diff --git a/ICSharpCode.Decompiler/Ast/AstBuilder.cs b/ICSharpCode.Decompiler/Ast/AstBuilder.cs index 736a76d1c..0fbeb0604 100644 --- a/ICSharpCode.Decompiler/Ast/AstBuilder.cs +++ b/ICSharpCode.Decompiler/Ast/AstBuilder.cs @@ -3,18 +3,21 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading; -using Decompiler.Transforms; + using ICSharpCode.Decompiler; +using ICSharpCode.Decompiler.Ast.Transforms; +using ICSharpCode.Decompiler.ILAst; using ICSharpCode.NRefactory.CSharp; using ICSharpCode.NRefactory.Utils; using Mono.Cecil; using Mono.Cecil.Cil; -using Ast = ICSharpCode.NRefactory.CSharp; -using ClassType = ICSharpCode.NRefactory.TypeSystem.ClassType; -using VarianceModifier = ICSharpCode.NRefactory.TypeSystem.VarianceModifier; -namespace Decompiler +namespace ICSharpCode.Decompiler.Ast { + using Ast = ICSharpCode.NRefactory.CSharp; + using ClassType = ICSharpCode.NRefactory.TypeSystem.ClassType; + using VarianceModifier = ICSharpCode.NRefactory.TypeSystem.VarianceModifier; + public class AstBuilder { DecompilerContext context = new DecompilerContext(); diff --git a/ICSharpCode.Decompiler/Ast/AstMethodBodyBuilder.cs b/ICSharpCode.Decompiler/Ast/AstMethodBodyBuilder.cs index 8551a46de..65b2b9d27 100644 --- a/ICSharpCode.Decompiler/Ast/AstMethodBodyBuilder.cs +++ b/ICSharpCode.Decompiler/Ast/AstMethodBodyBuilder.cs @@ -4,16 +4,18 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Threading; -using ICSharpCode.NRefactory.Utils; -using Ast = ICSharpCode.NRefactory.CSharp; + +using ICSharpCode.Decompiler.ILAst; using ICSharpCode.NRefactory.CSharp; -using Cecil = Mono.Cecil; +using ICSharpCode.NRefactory.Utils; using Mono.Cecil; using Mono.Cecil.Cil; -using Decompiler.ControlFlow; -namespace Decompiler +namespace ICSharpCode.Decompiler.Ast { + using Ast = ICSharpCode.NRefactory.CSharp; + using Cecil = Mono.Cecil; + public class AstMethodBodyBuilder { MethodDefinition methodDef; diff --git a/ICSharpCode.Decompiler/Ast/CommentStatement.cs b/ICSharpCode.Decompiler/Ast/CommentStatement.cs index 6f0135c72..bca46c4a3 100644 --- a/ICSharpCode.Decompiler/Ast/CommentStatement.cs +++ b/ICSharpCode.Decompiler/Ast/CommentStatement.cs @@ -6,7 +6,7 @@ using System.Linq; using ICSharpCode.NRefactory.CSharp; using ICSharpCode.NRefactory.CSharp.PatternMatching; -namespace Decompiler +namespace ICSharpCode.Decompiler.Ast { /// /// Allows storing comments inside IEnumerable{Statement}. Used in the AstMethodBuilder. diff --git a/ICSharpCode.Decompiler/Ast/DeclareVariableInSmallestScope.cs b/ICSharpCode.Decompiler/Ast/DeclareVariableInSmallestScope.cs index fe6a15d51..1bc37a624 100644 --- a/ICSharpCode.Decompiler/Ast/DeclareVariableInSmallestScope.cs +++ b/ICSharpCode.Decompiler/Ast/DeclareVariableInSmallestScope.cs @@ -6,7 +6,7 @@ using System.Linq; using ICSharpCode.NRefactory.CSharp; using ICSharpCode.NRefactory.CSharp.PatternMatching; -namespace Decompiler +namespace ICSharpCode.Decompiler.Ast { /// /// Helper class for declaring variables. diff --git a/ICSharpCode.Decompiler/Ast/DecompilerContext.cs b/ICSharpCode.Decompiler/Ast/DecompilerContext.cs index 108032e40..7ea5c0b02 100644 --- a/ICSharpCode.Decompiler/Ast/DecompilerContext.cs +++ b/ICSharpCode.Decompiler/Ast/DecompilerContext.cs @@ -5,7 +5,7 @@ using System; using System.Threading; using Mono.Cecil; -namespace Decompiler +namespace ICSharpCode.Decompiler { public class DecompilerContext { diff --git a/ICSharpCode.Decompiler/Ast/NRefactoryExtensions.cs b/ICSharpCode.Decompiler/Ast/NRefactoryExtensions.cs index 8657037ad..0dd733fbe 100644 --- a/ICSharpCode.Decompiler/Ast/NRefactoryExtensions.cs +++ b/ICSharpCode.Decompiler/Ast/NRefactoryExtensions.cs @@ -4,7 +4,7 @@ using System; using ICSharpCode.NRefactory.CSharp; -namespace Decompiler +namespace ICSharpCode.Decompiler.Ast { static class NRefactoryExtensions { diff --git a/ICSharpCode.Decompiler/Ast/NameVariables.cs b/ICSharpCode.Decompiler/Ast/NameVariables.cs index bea32a6a2..465be539a 100644 --- a/ICSharpCode.Decompiler/Ast/NameVariables.cs +++ b/ICSharpCode.Decompiler/Ast/NameVariables.cs @@ -4,9 +4,11 @@ using System; using System.Collections.Generic; using System.Linq; + +using ICSharpCode.Decompiler.ILAst; using Mono.Cecil; -namespace Decompiler +namespace ICSharpCode.Decompiler.Ast { public class NameVariables { diff --git a/ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs b/ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs index f489d57eb..101371535 100644 --- a/ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs +++ b/ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs @@ -8,7 +8,7 @@ using ICSharpCode.Decompiler; using ICSharpCode.NRefactory.CSharp; using Mono.Cecil; -namespace Decompiler +namespace ICSharpCode.Decompiler.Ast { public class TextOutputFormatter : IOutputFormatter { diff --git a/ICSharpCode.Decompiler/Ast/Transforms/ContextTrackingVisitor.cs b/ICSharpCode.Decompiler/Ast/Transforms/ContextTrackingVisitor.cs index 276c44d79..a9b3f3fc6 100644 --- a/ICSharpCode.Decompiler/Ast/Transforms/ContextTrackingVisitor.cs +++ b/ICSharpCode.Decompiler/Ast/Transforms/ContextTrackingVisitor.cs @@ -6,7 +6,7 @@ using System.Diagnostics; using ICSharpCode.NRefactory.CSharp; using Mono.Cecil; -namespace Decompiler.Transforms +namespace ICSharpCode.Decompiler.Ast.Transforms { /// /// Base class for AST visitors that need the current type/method context info. diff --git a/ICSharpCode.Decompiler/Ast/Transforms/ConvertConstructorCallIntoInitializer.cs b/ICSharpCode.Decompiler/Ast/Transforms/ConvertConstructorCallIntoInitializer.cs index ee2225073..7acab4d21 100644 --- a/ICSharpCode.Decompiler/Ast/Transforms/ConvertConstructorCallIntoInitializer.cs +++ b/ICSharpCode.Decompiler/Ast/Transforms/ConvertConstructorCallIntoInitializer.cs @@ -6,7 +6,7 @@ using System.Linq; using ICSharpCode.NRefactory.CSharp; using Mono.Cecil; -namespace Decompiler.Transforms +namespace ICSharpCode.Decompiler.Ast.Transforms { /// /// If the first element of a constructor is a chained constructor call, convert it into a constructor initializer. diff --git a/ICSharpCode.Decompiler/Ast/Transforms/DelegateConstruction.cs b/ICSharpCode.Decompiler/Ast/Transforms/DelegateConstruction.cs index 87df7aca8..39c7f6783 100644 --- a/ICSharpCode.Decompiler/Ast/Transforms/DelegateConstruction.cs +++ b/ICSharpCode.Decompiler/Ast/Transforms/DelegateConstruction.cs @@ -10,7 +10,7 @@ using ICSharpCode.NRefactory.CSharp; using ICSharpCode.NRefactory.CSharp.PatternMatching; using Mono.Cecil; -namespace Decompiler.Transforms +namespace ICSharpCode.Decompiler.Ast.Transforms { /// /// Converts "new Action(obj, ldftn(func))" into "new Action(obj.func)". diff --git a/ICSharpCode.Decompiler/Ast/Transforms/PatternStatementTransform.cs b/ICSharpCode.Decompiler/Ast/Transforms/PatternStatementTransform.cs index bdc4b1d37..f41fe43ec 100644 --- a/ICSharpCode.Decompiler/Ast/Transforms/PatternStatementTransform.cs +++ b/ICSharpCode.Decompiler/Ast/Transforms/PatternStatementTransform.cs @@ -3,12 +3,11 @@ using System; using System.Linq; -using Decompiler.Transforms; using ICSharpCode.NRefactory.CSharp; using ICSharpCode.NRefactory.CSharp.PatternMatching; using Mono.Cecil; -namespace Decompiler.Transforms +namespace ICSharpCode.Decompiler.Ast.Transforms { /// /// Finds the expanded form of using statements using pattern matching and replaces it with a UsingStatement. diff --git a/ICSharpCode.Decompiler/Ast/Transforms/PushNegation.cs b/ICSharpCode.Decompiler/Ast/Transforms/PushNegation.cs index 1d04bd941..409784cba 100644 --- a/ICSharpCode.Decompiler/Ast/Transforms/PushNegation.cs +++ b/ICSharpCode.Decompiler/Ast/Transforms/PushNegation.cs @@ -4,7 +4,7 @@ using System.Linq; using ICSharpCode.NRefactory.CSharp; using ICSharpCode.NRefactory.CSharp.PatternMatching; -namespace Decompiler.Transforms +namespace ICSharpCode.Decompiler.Ast.Transforms { public class PushNegation: DepthFirstAstVisitor, IAstTransform { diff --git a/ICSharpCode.Decompiler/Ast/Transforms/ReplaceMethodCallsWithOperators.cs b/ICSharpCode.Decompiler/Ast/Transforms/ReplaceMethodCallsWithOperators.cs index 0a7cb2655..21d5efb55 100644 --- a/ICSharpCode.Decompiler/Ast/Transforms/ReplaceMethodCallsWithOperators.cs +++ b/ICSharpCode.Decompiler/Ast/Transforms/ReplaceMethodCallsWithOperators.cs @@ -6,7 +6,7 @@ using Mono.Cecil; using Ast = ICSharpCode.NRefactory.CSharp; using ICSharpCode.NRefactory.CSharp; -namespace Decompiler.Transforms +namespace ICSharpCode.Decompiler.Ast.Transforms { /// /// Replaces method calls with the appropriate operator expressions. diff --git a/ICSharpCode.Decompiler/Ast/Transforms/TransformationPipeline.cs b/ICSharpCode.Decompiler/Ast/Transforms/TransformationPipeline.cs index a559930cb..d240c7583 100644 --- a/ICSharpCode.Decompiler/Ast/Transforms/TransformationPipeline.cs +++ b/ICSharpCode.Decompiler/Ast/Transforms/TransformationPipeline.cs @@ -5,7 +5,7 @@ using System; using System.Threading; using ICSharpCode.NRefactory.CSharp; -namespace Decompiler.Transforms +namespace ICSharpCode.Decompiler.Ast.Transforms { public interface IAstTransform { diff --git a/ICSharpCode.Decompiler/FlowAnalysis/ControlFlowEdge.cs b/ICSharpCode.Decompiler/FlowAnalysis/ControlFlowEdge.cs index 600c7230e..bfab810cf 100644 --- a/ICSharpCode.Decompiler/FlowAnalysis/ControlFlowEdge.cs +++ b/ICSharpCode.Decompiler/FlowAnalysis/ControlFlowEdge.cs @@ -21,7 +21,7 @@ using System; namespace ICSharpCode.Decompiler.FlowAnalysis { /// - /// + /// Describes the type of a control flow egde. /// public enum JumpType { diff --git a/ICSharpCode.Decompiler/ILAst/ArrayInitializers.cs b/ICSharpCode.Decompiler/ILAst/ArrayInitializers.cs index 4c80e21d6..08c2aaca9 100644 --- a/ICSharpCode.Decompiler/ILAst/ArrayInitializers.cs +++ b/ICSharpCode.Decompiler/ILAst/ArrayInitializers.cs @@ -7,7 +7,7 @@ using System.Linq; using Mono.Cecil; -namespace Decompiler +namespace ICSharpCode.Decompiler.ILAst { /// /// IL AST transformation that introduces array initializers. diff --git a/ICSharpCode.Decompiler/ILAst/GotoRemoval.cs b/ICSharpCode.Decompiler/ILAst/GotoRemoval.cs index cd30046e4..c5ea44ab6 100644 --- a/ICSharpCode.Decompiler/ILAst/GotoRemoval.cs +++ b/ICSharpCode.Decompiler/ILAst/GotoRemoval.cs @@ -3,9 +3,8 @@ using System.Diagnostics; using System.IO; using System.Collections.Generic; using System.Linq; -using Decompiler.ControlFlow; -namespace Decompiler +namespace ICSharpCode.Decompiler.ILAst { public class GotoRemoval { diff --git a/ICSharpCode.Decompiler/ILAst/ILAstBuilder.cs b/ICSharpCode.Decompiler/ILAst/ILAstBuilder.cs index 51656fc1a..c766cb15a 100644 --- a/ICSharpCode.Decompiler/ILAst/ILAstBuilder.cs +++ b/ICSharpCode.Decompiler/ILAst/ILAstBuilder.cs @@ -6,7 +6,7 @@ using Mono.Cecil; using Mono.Cecil.Cil; using Cecil = Mono.Cecil; -namespace Decompiler +namespace ICSharpCode.Decompiler.ILAst { public class ILAstBuilder { diff --git a/ICSharpCode.Decompiler/ILAst/ILAstOptimizer.cs b/ICSharpCode.Decompiler/ILAst/ILAstOptimizer.cs index 58f54d05f..ef2c1a4b9 100644 --- a/ICSharpCode.Decompiler/ILAst/ILAstOptimizer.cs +++ b/ICSharpCode.Decompiler/ILAst/ILAstOptimizer.cs @@ -7,7 +7,7 @@ using Mono.Cecil; using Mono.Cecil.Cil; using Mono.CSharp; -namespace Decompiler.ControlFlow +namespace ICSharpCode.Decompiler.ILAst { public enum ILAstOptimizationStep { diff --git a/ICSharpCode.Decompiler/ILAst/ILAstTypes.cs b/ICSharpCode.Decompiler/ILAst/ILAstTypes.cs index ec5aeb2b1..be7b7b763 100644 --- a/ICSharpCode.Decompiler/ILAst/ILAstTypes.cs +++ b/ICSharpCode.Decompiler/ILAst/ILAstTypes.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; -using Decompiler.ControlFlow; using ICSharpCode.Decompiler; using ICSharpCode.Decompiler.Disassembler; using ICSharpCode.NRefactory.Utils; @@ -12,7 +11,7 @@ using Mono.Cecil.Cil; using Mono.CSharp; using Cecil = Mono.Cecil; -namespace Decompiler +namespace ICSharpCode.Decompiler.ILAst { public abstract class ILNode { diff --git a/ICSharpCode.Decompiler/ILAst/ILCodes.cs b/ICSharpCode.Decompiler/ILAst/ILCodes.cs index 076fa0627..0304c3555 100644 --- a/ICSharpCode.Decompiler/ILAst/ILCodes.cs +++ b/ICSharpCode.Decompiler/ILAst/ILCodes.cs @@ -27,7 +27,7 @@ using System; using Mono.Cecil; using Mono.Cecil.Cil; -namespace Decompiler +namespace ICSharpCode.Decompiler.ILAst { public enum ILCode { diff --git a/ICSharpCode.Decompiler/ILAst/ILInlining.cs b/ICSharpCode.Decompiler/ILAst/ILInlining.cs index 6ca8d90db..7ec19e7a2 100644 --- a/ICSharpCode.Decompiler/ILAst/ILInlining.cs +++ b/ICSharpCode.Decompiler/ILAst/ILInlining.cs @@ -5,7 +5,7 @@ using System; using System.Diagnostics; using System.Linq; -namespace Decompiler +namespace ICSharpCode.Decompiler.ILAst { /// /// Performs inlining transformations. diff --git a/ICSharpCode.Decompiler/ILAst/Pattern.cs b/ICSharpCode.Decompiler/ILAst/Pattern.cs index 075300766..72774823f 100644 --- a/ICSharpCode.Decompiler/ILAst/Pattern.cs +++ b/ICSharpCode.Decompiler/ILAst/Pattern.cs @@ -4,7 +4,7 @@ using System; using Mono.Cecil; -namespace Decompiler +namespace ICSharpCode.Decompiler.ILAst { public interface IVariablePattern { diff --git a/ICSharpCode.Decompiler/ILAst/PeepholeTransform.cs b/ICSharpCode.Decompiler/ILAst/PeepholeTransform.cs index 50d8ae898..c2ee9a99e 100644 --- a/ICSharpCode.Decompiler/ILAst/PeepholeTransform.cs +++ b/ICSharpCode.Decompiler/ILAst/PeepholeTransform.cs @@ -6,7 +6,7 @@ using System.Linq; using ICSharpCode.NRefactory.Utils; using Mono.Cecil; -namespace Decompiler +namespace ICSharpCode.Decompiler.ILAst { public delegate void PeepholeTransform(ILBlock block, ref int i); diff --git a/ICSharpCode.Decompiler/ILAst/TypeAnalysis.cs b/ICSharpCode.Decompiler/ILAst/TypeAnalysis.cs index 8f234ba7b..2a1adf314 100644 --- a/ICSharpCode.Decompiler/ILAst/TypeAnalysis.cs +++ b/ICSharpCode.Decompiler/ILAst/TypeAnalysis.cs @@ -5,11 +5,10 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; -using Decompiler; using Mono.Cecil; using Mono.Cecil.Cil; -namespace Decompiler +namespace ICSharpCode.Decompiler.ILAst { /// /// Assigns C# types to IL expressions. diff --git a/ICSharpCode.Decompiler/Tests/DecompilerTestBase.cs b/ICSharpCode.Decompiler/Tests/DecompilerTestBase.cs index c1a13b925..792088222 100644 --- a/ICSharpCode.Decompiler/Tests/DecompilerTestBase.cs +++ b/ICSharpCode.Decompiler/Tests/DecompilerTestBase.cs @@ -1,12 +1,13 @@ using System; +using System.CodeDom.Compiler; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; -using Mono.Cecil; -using System.IO; -using Decompiler; + +using ICSharpCode.Decompiler.Ast; using Microsoft.CSharp; -using System.CodeDom.Compiler; +using Mono.Cecil; using NUnit.Framework; namespace ICSharpCode.Decompiler.Tests diff --git a/ICSharpCode.Decompiler/Tests/DelegateConstruction.cs b/ICSharpCode.Decompiler/Tests/DelegateConstruction.cs index 3267ac149..223247bf5 100644 --- a/ICSharpCode.Decompiler/Tests/DelegateConstruction.cs +++ b/ICSharpCode.Decompiler/Tests/DelegateConstruction.cs @@ -59,4 +59,9 @@ public static class DelegateConstruction } return list; } + + public static Action StaticAnonymousMethodNoClosure() + { + return delegate { Console.WriteLine(); }; + } } diff --git a/ICSharpCode.Decompiler/Tests/Helpers/RemoveCompilerAttribute.cs b/ICSharpCode.Decompiler/Tests/Helpers/RemoveCompilerAttribute.cs index 00b5b4dba..1cec73efc 100644 --- a/ICSharpCode.Decompiler/Tests/Helpers/RemoveCompilerAttribute.cs +++ b/ICSharpCode.Decompiler/Tests/Helpers/RemoveCompilerAttribute.cs @@ -2,8 +2,9 @@ using System.Collections.Generic; using System.Linq; using System.Text; + +using ICSharpCode.Decompiler.Ast.Transforms; using ICSharpCode.NRefactory.CSharp; -using Decompiler.Transforms; namespace ICSharpCode.Decompiler.Tests.Helpers { diff --git a/ICSharpCode.Decompiler/Tests/TestRunner.cs b/ICSharpCode.Decompiler/Tests/TestRunner.cs index 98e3daad7..f61a6f558 100644 --- a/ICSharpCode.Decompiler/Tests/TestRunner.cs +++ b/ICSharpCode.Decompiler/Tests/TestRunner.cs @@ -6,7 +6,8 @@ using System.CodeDom.Compiler; using System.Collections.Generic; using System.IO; using System.Text; -using Decompiler; + +using ICSharpCode.Decompiler.Ast; using Microsoft.CSharp; using Mono.Cecil; diff --git a/ILSpy/CSharpLanguage.cs b/ILSpy/CSharpLanguage.cs index 4c6adbd2f..9966b9b12 100644 --- a/ILSpy/CSharpLanguage.cs +++ b/ILSpy/CSharpLanguage.cs @@ -26,9 +26,9 @@ using System.Threading.Tasks; using System.Xaml; using System.Xml; -using Decompiler; -using Decompiler.Transforms; using ICSharpCode.Decompiler; +using ICSharpCode.Decompiler.Ast; +using ICSharpCode.Decompiler.Ast.Transforms; using ICSharpCode.NRefactory.CSharp; using Mono.Cecil; diff --git a/ILSpy/ILAstLanguage.cs b/ILSpy/ILAstLanguage.cs index 8a7ae6f8e..1db27d100 100644 --- a/ILSpy/ILAstLanguage.cs +++ b/ILSpy/ILAstLanguage.cs @@ -20,11 +20,10 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; -using Decompiler; -using Decompiler.ControlFlow; -using Decompiler.Transforms; + using ICSharpCode.Decompiler; using ICSharpCode.Decompiler.Disassembler; +using ICSharpCode.Decompiler.ILAst; using ICSharpCode.NRefactory.CSharp; using Mono.Cecil;