From 90b7d8fcbe7a940271b55cd2c1b9cea8f0e0daa8 Mon Sep 17 00:00:00 2001 From: yenru0 Date: Wed, 3 Dec 2025 01:57:47 +0900 Subject: [PATCH] add child_count to scope --- src/symtab.c | 2 +- src/symtab.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/symtab.c b/src/symtab.c index 0f645de..505329c 100644 --- a/src/symtab.c +++ b/src/symtab.c @@ -73,7 +73,7 @@ void push_scope(Scope scope) { } scope->parent = before; scope->depth = before->depth + 1; - + before->child_count++; scope_stack_top++; scope_stack[scope_stack_top] = scope; } diff --git a/src/symtab.h b/src/symtab.h index 45e5fec..ebfefcb 100644 --- a/src/symtab.h +++ b/src/symtab.h @@ -57,6 +57,8 @@ struct Scope { struct Scope *child_last; struct Scope *next_sibling; + int child_count; + int location; BucketList hashTable[SYMTAB_SIZE]; };