feat: add scope-based memory management with push/pop and variable isolation

Introduce a new scope system that replaces manual stack frame management with structured scope_push/scope_pop calls. The implementation includes a Scope struct with dedicated memory and local symbol arrays, along with helper functions for variable lookup, memory access, and state synchronization. This change touches context.c, main.c, oop.c, parser.c, and async_stdlib.c to integrate scope initialization, cleanup, and frame transitions during function calls and destructor execution.
This commit is contained in:
2025-11-25 01:27:25 +00:00
parent 09e3339855
commit e7fe6d2e56
8 changed files with 466 additions and 94 deletions
+1
View File
@@ -23,6 +23,7 @@ SOURCES = $(SRC_DIR)/main.c \
$(SRC_DIR)/context.c \
$(SRC_DIR)/debug.c \
$(SRC_DIR)/memory.c \
$(SRC_DIR)/scope.c \
$(SRC_DIR)/stdlib/stdlib.c \
$(SRC_DIR)/stdlib/string/string_stdlib.c \
$(SRC_DIR)/stdlib/math/math_stdlib.c \