Skip to content

Commit

Permalink
tests/should_succeed/enum.jou valgrinding worky worky
Browse files Browse the repository at this point in the history
  • Loading branch information
Akuli committed Jan 12, 2025
1 parent 4596a4d commit d2d3cb1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions compiler/ast.jou
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,11 @@ class AstStatement:
self->while_loop.free()
if self->kind == AstStatementKind.ForLoop:
self->for_loop.free()
if self->kind == AstStatementKind.DeclareLocalVar:
if (
self->kind == AstStatementKind.DeclareLocalVar
or self->kind == AstStatementKind.GlobalVariableDeclaration
or self->kind == AstStatementKind.GlobalVariableDefinition
):
self->var_declaration.free()
if (
self->kind == AstStatementKind.Assign
Expand All @@ -616,8 +620,6 @@ class AstStatement:
self->classdef.free()
if self->kind == AstStatementKind.Enum:
self->enumdef.free()
# TODO: GlobalVariableDeclaration
# TODO: GlobalVariableDefinition


# Useful for e.g. "while condition: body", "if condition: body"
Expand Down

0 comments on commit d2d3cb1

Please sign in to comment.