Skip to content

Commit

Permalink
refactor: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
furesoft committed Feb 1, 2025
1 parent 89230d9 commit 32fe13f
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 49 deletions.
106 changes: 60 additions & 46 deletions NewSource/.idea/.idea.Socordia/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public record BodyCompilation(Driver Driver, MethodDef Method, IRBuilder Builder
{
public object? Tag { get; set; }

public static CompositeListener<BodyCompilation, AstNode> Listener =
public static readonly CompositeListener<BodyCompilation, AstNode> Listener =
CompositeListener<BodyCompilation, AstNode>.Build()
.With(new VariableDeclarationListener())
.With(new CallExpressionListener(true))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@ protected override void ListenToNode(BodyCompilation context, ContinueStatement

node.AddError("Continue is only in loops allowed");
}

protected override bool ShouldListenToChildren(BodyCompilation context, ContinueStatement node)
{
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,9 @@ protected override void ListenToNode(BodyCompilation context, ThrowStatement nod

context.Builder.Emit(new ThrowInst(value));
}

protected override bool ShouldListenToChildren(BodyCompilation context, ThrowStatement node)
{
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,9 @@ protected override void ListenToNode(BodyCompilation context, WhileStatement nod
context.Builder.SetPosition(after);
context.Tag = null;
}

protected override bool ShouldListenToChildren(BodyCompilation context, WhileStatement node)
{
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ namespace SocordiaC.Compilation.Scoping.Items;

public class VariableScopeItem : ScopeItem
{
public bool IsMutable { get; init; }

public LocalSlot Slot { get; set; }

public override TypeDesc Type => Slot.Type;
Expand Down

0 comments on commit 32fe13f

Please sign in to comment.