scope_analysis: changed convert to return the global symbol table as well as the program
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user