From 169c3e02c4668055e1f92bf2ff5b18db1a281f0e Mon Sep 17 00:00:00 2001 From: AraHaan Date: Mon, 15 Jul 2024 11:26:03 -0400 Subject: [PATCH] Fixed .editorconfig breaking changes. The change to the default on a setting broke compile yet again... Signed-off-by: AraHaan --- src/Common/.editorconfig | 1 + src/GenericPluginLoader/.editorconfig | 1 + src/MessageManager/.editorconfig | 1 + src/MiniDump/.editorconfig | 1 + src/PluginFramework/.editorconfig | 1 + src/PluginUpdateCheck/.editorconfig | 1 + src/ReleasePackaging/.editorconfig | 1 + src/SettingsFile/.editorconfig | 1 + src/UnluacNET/.editorconfig | 1 + .../Decompile/Block/IfThenEndBlock.cs | 27 ++++++++----------- src/UnluacNET/Decompile/Decompiler.cs | 8 ++---- src/UnluacNET/Parse/LObject.cs | 2 +- src/ZipAssembly/.editorconfig | 1 + 13 files changed, 24 insertions(+), 23 deletions(-) diff --git a/src/Common/.editorconfig b/src/Common/.editorconfig index d208a80..c3bf5ec 100644 --- a/src/Common/.editorconfig +++ b/src/Common/.editorconfig @@ -89,6 +89,7 @@ csharp_preferred_modifier_order = public,private,protected,internal,static,exter # Code-block preferences csharp_prefer_braces = true:warning csharp_style_namespace_declarations = file_scoped +dotnet_style_namespace_match_folder = false # Expression-level preferences csharp_prefer_simple_default_expression = true:warning diff --git a/src/GenericPluginLoader/.editorconfig b/src/GenericPluginLoader/.editorconfig index 1fe5703..903ebbe 100644 --- a/src/GenericPluginLoader/.editorconfig +++ b/src/GenericPluginLoader/.editorconfig @@ -89,6 +89,7 @@ csharp_preferred_modifier_order = public,private,protected,internal,static,exter # Code-block preferences csharp_prefer_braces = true:warning csharp_style_namespace_declarations = file_scoped +dotnet_style_namespace_match_folder = false # Expression-level preferences csharp_prefer_simple_default_expression = true:warning diff --git a/src/MessageManager/.editorconfig b/src/MessageManager/.editorconfig index 02f67c9..2cc6563 100644 --- a/src/MessageManager/.editorconfig +++ b/src/MessageManager/.editorconfig @@ -89,6 +89,7 @@ csharp_preferred_modifier_order = public,private,protected,internal,static,exter # Code-block preferences csharp_prefer_braces = true:warning csharp_style_namespace_declarations = file_scoped +dotnet_style_namespace_match_folder = false # Expression-level preferences csharp_prefer_simple_default_expression = true:warning diff --git a/src/MiniDump/.editorconfig b/src/MiniDump/.editorconfig index cfcce3b..b62e42a 100644 --- a/src/MiniDump/.editorconfig +++ b/src/MiniDump/.editorconfig @@ -89,6 +89,7 @@ csharp_preferred_modifier_order = public,private,protected,internal,static,exter # Code-block preferences csharp_prefer_braces = true:warning csharp_style_namespace_declarations = file_scoped +dotnet_style_namespace_match_folder = false # Expression-level preferences csharp_prefer_simple_default_expression = true:warning diff --git a/src/PluginFramework/.editorconfig b/src/PluginFramework/.editorconfig index 40a8058..eeaa000 100644 --- a/src/PluginFramework/.editorconfig +++ b/src/PluginFramework/.editorconfig @@ -89,6 +89,7 @@ csharp_preferred_modifier_order = public,private,protected,internal,static,exter # Code-block preferences csharp_prefer_braces = true:warning csharp_style_namespace_declarations = file_scoped +dotnet_style_namespace_match_folder = false # Expression-level preferences csharp_prefer_simple_default_expression = true:warning diff --git a/src/PluginUpdateCheck/.editorconfig b/src/PluginUpdateCheck/.editorconfig index f081cb1..2171ee7 100644 --- a/src/PluginUpdateCheck/.editorconfig +++ b/src/PluginUpdateCheck/.editorconfig @@ -89,6 +89,7 @@ csharp_preferred_modifier_order = public,private,protected,internal,static,exter # Code-block preferences csharp_prefer_braces = true:warning csharp_style_namespace_declarations = file_scoped +dotnet_style_namespace_match_folder = false # Expression-level preferences csharp_prefer_simple_default_expression = true:warning diff --git a/src/ReleasePackaging/.editorconfig b/src/ReleasePackaging/.editorconfig index 6242e46..ce896a6 100644 --- a/src/ReleasePackaging/.editorconfig +++ b/src/ReleasePackaging/.editorconfig @@ -89,6 +89,7 @@ csharp_preferred_modifier_order = public,private,protected,internal,static,exter # Code-block preferences csharp_prefer_braces = true:warning csharp_style_namespace_declarations = file_scoped +dotnet_style_namespace_match_folder = false # Expression-level preferences csharp_prefer_simple_default_expression = true:warning diff --git a/src/SettingsFile/.editorconfig b/src/SettingsFile/.editorconfig index 6242e46..ce896a6 100644 --- a/src/SettingsFile/.editorconfig +++ b/src/SettingsFile/.editorconfig @@ -89,6 +89,7 @@ csharp_preferred_modifier_order = public,private,protected,internal,static,exter # Code-block preferences csharp_prefer_braces = true:warning csharp_style_namespace_declarations = file_scoped +dotnet_style_namespace_match_folder = false # Expression-level preferences csharp_prefer_simple_default_expression = true:warning diff --git a/src/UnluacNET/.editorconfig b/src/UnluacNET/.editorconfig index f2f37ae..9f81885 100644 --- a/src/UnluacNET/.editorconfig +++ b/src/UnluacNET/.editorconfig @@ -89,6 +89,7 @@ csharp_preferred_modifier_order = public,private,protected,internal,static,exter # Code-block preferences csharp_prefer_braces = true:warning csharp_style_namespace_declarations = file_scoped +dotnet_style_namespace_match_folder = false # Expression-level preferences csharp_prefer_simple_default_expression = true:warning diff --git a/src/UnluacNET/Decompile/Block/IfThenEndBlock.cs b/src/UnluacNET/Decompile/Block/IfThenEndBlock.cs index e469cfa..35d24fb 100644 --- a/src/UnluacNET/Decompile/Block/IfThenEndBlock.cs +++ b/src/UnluacNET/Decompile/Block/IfThenEndBlock.cs @@ -46,25 +46,20 @@ public override Operation Process(Decompiler d) if (this.m_statements.Count == 1) { var statement = this.m_statements[0]; - if (statement is Assignment) + if (statement is Assignment assignment && assignment.GetArity() == 1 && this.m_branch is TestNode node) { - var assignment = statement as Assignment; - if (assignment.GetArity() == 1 && this.m_branch is TestNode) + var decl = this.m_r.GetDeclaration(node.Test, node.Line); + if (assignment.GetFirstTarget().IsDeclaration(decl)) { - var node = this.m_branch as TestNode; - var decl = this.m_r.GetDeclaration(node.Test, node.Line); - if (assignment.GetFirstTarget().IsDeclaration(decl)) + LocalVariable left = new(decl); + var right = assignment.GetFirstValue(); + var expr = node.Inverted + ? Expression.MakeOR(left, right) + : Expression.MakeAND(left, right); + return new LambdaOperation(this.End - 1, (_, _) => { - LocalVariable left = new(decl); - var right = assignment.GetFirstValue(); - var expr = node.Inverted - ? Expression.MakeOR(left, right) - : Expression.MakeAND(left, right); - return new LambdaOperation(this.End - 1, (_, _) => - { - return new Assignment(assignment.GetFirstTarget(), expr); - }); - } + return new Assignment(assignment.GetFirstTarget(), expr); + }); } } } diff --git a/src/UnluacNET/Decompile/Decompiler.cs b/src/UnluacNET/Decompile/Decompiler.cs index 3c321e3..2698906 100644 --- a/src/UnluacNET/Decompile/Decompiler.cs +++ b/src/UnluacNET/Decompile/Decompiler.cs @@ -547,13 +547,9 @@ from block2 in this.blocks this.Code.Op(assignEnd - 3) == Op.JMP && this.Code.SBx(assignEnd - 3) == 2) { - if (peekNode is TestNode) + if (peekNode is TestNode node && node.Test == this.Code.A(assignEnd - 2)) { - var node = peekNode as TestNode; - if (node.Test == this.Code.A(assignEnd - 2)) - { - isAssignNode = true; - } + isAssignNode = true; } } else if (assignEnd - 2 >= 1 && diff --git a/src/UnluacNET/Parse/LObject.cs b/src/UnluacNET/Parse/LObject.cs index 99f0288..936d0bd 100644 --- a/src/UnluacNET/Parse/LObject.cs +++ b/src/UnluacNET/Parse/LObject.cs @@ -7,7 +7,7 @@ namespace Elskom.Generic.Libs.UnluacNET; internal abstract class LObject : IBObject, IEqualityComparer { - public abstract new bool Equals(object obj); + public new abstract bool Equals(object obj); public virtual string DeRef() => throw new NotImplementedException(); diff --git a/src/ZipAssembly/.editorconfig b/src/ZipAssembly/.editorconfig index da37149..142a912 100644 --- a/src/ZipAssembly/.editorconfig +++ b/src/ZipAssembly/.editorconfig @@ -89,6 +89,7 @@ csharp_preferred_modifier_order = public,private,protected,internal,static,exter # Code-block preferences csharp_prefer_braces = true:warning csharp_style_namespace_declarations = file_scoped +dotnet_style_namespace_match_folder = false # Expression-level preferences csharp_prefer_simple_default_expression = true:warning