fixing quite a few bugs

This commit is contained in:
SpookyDervish
2025-09-13 07:08:11 +10:00
parent 170272353c
commit 86d59a8177
7 changed files with 70 additions and 19 deletions

View File

@@ -128,6 +128,9 @@ def generate_ast(tokens: list[Token], code: str) -> RootNode:
elif token.type == TokenType.LABEL_DECLERATION:
if current_node:
scope.statements.append(current_node)
if current_node_type == "func":
scope = current_node
current_node_type = None
current_node = None
scope.statements.append(LabelDecNode(token.value))