add child_count to scope

This commit is contained in:
2025-12-03 01:57:47 +09:00
parent 4e2fdf88f9
commit 90b7d8fcbe
2 changed files with 3 additions and 1 deletions

View File

@@ -73,7 +73,7 @@ void push_scope(Scope scope) {
} }
scope->parent = before; scope->parent = before;
scope->depth = before->depth + 1; scope->depth = before->depth + 1;
before->child_count++;
scope_stack_top++; scope_stack_top++;
scope_stack[scope_stack_top] = scope; scope_stack[scope_stack_top] = scope;
} }

View File

@@ -57,6 +57,8 @@ struct Scope {
struct Scope *child_last; struct Scope *child_last;
struct Scope *next_sibling; struct Scope *next_sibling;
int child_count;
int location; int location;
BucketList hashTable[SYMTAB_SIZE]; BucketList hashTable[SYMTAB_SIZE];
}; };