Skip to content

Commit

Permalink
refactor: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
furesoft committed Dec 25, 2024
1 parent 4bd52dd commit 6b00fa9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions NewSource/SocordiaC/Compilation/CollectClassesListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ protected override void ListenToNode(Driver context, ClassDeclaration node)
var ns = context.GetNamespaceOf(node);
var type = context.Compilation.Module.CreateType(ns, node.Name,
GetModifiers(node), GetBaseType(node, context.Compilation));

}

private TypeDefOrSpec? GetBaseType(ClassDeclaration node, DistIL.Compilation compilation)
Expand Down
5 changes: 1 addition & 4 deletions NewSource/SocordiaC/Compilation/CollectFunctionsListener.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System.Reflection;
using DistIL.AsmIO;
using DistIL.CodeGen.Cil;
using DistIL.IR;
using DistIL.IR.Utils;
using MrKWatkins.Ast.Listening;
using Socordia.CodeAnalysis.AST;
using Socordia.CodeAnalysis.AST.Declarations;
Expand All @@ -26,7 +23,7 @@ protected override void ListenToNode(Driver context, FunctionDefinition node)
method.Body = new MethodBody(method);
}

if (type.Name == "Functions" && method.IsStatic && method.Name == "main")
if (type.Name == "Functions" && method is { IsStatic: true, Name: "main" })
{
context.Compilation.Module.EntryPoint = method;
}
Expand Down
2 changes: 1 addition & 1 deletion NewSource/SocordiaC/compilation.sc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class MyClass

}

internal class Hello : System.Text.StringBuilder
internal class Hello : System.Text.StringBuilder, ILixou
{

}
Expand Down

0 comments on commit 6b00fa9

Please sign in to comment.