Skip to content

Commit

Permalink
Fixed .editorconfig breaking changes. (#293)
Browse files Browse the repository at this point in the history
The change to the default on a setting broke compile yet again...

Signed-off-by: AraHaan <seandhunt_7@yahoo.com>
  • Loading branch information
AraHaan authored Jul 15, 2024
1 parent f39147b commit 8ed6919
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 23 deletions.
1 change: 1 addition & 0 deletions src/Common/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/GenericPluginLoader/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/MessageManager/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/MiniDump/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/PluginFramework/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/PluginUpdateCheck/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/ReleasePackaging/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/SettingsFile/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/UnluacNET/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 11 additions & 16 deletions src/UnluacNET/Decompile/Block/IfThenEndBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
}
}
Expand Down
8 changes: 2 additions & 6 deletions src/UnluacNET/Decompile/Decompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down
2 changes: 1 addition & 1 deletion src/UnluacNET/Parse/LObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Elskom.Generic.Libs.UnluacNET;

internal abstract class LObject : IBObject, IEqualityComparer<LObject>
{
public abstract new bool Equals(object obj);
public new abstract bool Equals(object obj);

public virtual string DeRef()
=> throw new NotImplementedException();
Expand Down
1 change: 1 addition & 0 deletions src/ZipAssembly/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8ed6919

Please sign in to comment.