From cb7e3f8622c3c040f6b11f196589dfc84409733b Mon Sep 17 00:00:00 2001 From: Emin Arslan Date: Sun, 1 Mar 2026 16:24:45 +0300 Subject: [PATCH] scope_analysis: changed convert to return the global symbol table as well as the program --- lib/compiler/scope_analysis.ml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/compiler/scope_analysis.ml b/lib/compiler/scope_analysis.ml index 06daf7c..b0407a8 100644 --- a/lib/compiler/scope_analysis.ml +++ b/lib/compiler/scope_analysis.ml @@ -132,8 +132,10 @@ let convert program = | (Core_ast.Expr e) :: rest -> (analyze tbl [] e) :: (aux tbl rest) | (Define (s, e)) :: rest -> let tbl = SymbolTable.add s (id ()) tbl in - (analyze tbl [] e) :: (aux tbl rest) - in traverse (fun x -> x) (aux SymbolTable.empty program) + (analyze tbl [] (Set (s, e))) :: (aux tbl rest) + in + let* program = traverse (fun x -> x) (aux SymbolTable.empty program) in + Ok (program, global_tbl) let of_src src = let* core = (Core_ast.of_src src) in