File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -260,25 +260,6 @@ let resolve_idents tree idents =
260260 let tree, _ = tree_fold_map tree ~accumulator: idents ~f: resolve_idents_step in
261261 tree
262262
263- (* To be replaced with a proper module system later *)
264- let resolve_imports_step () node = match node with
265- | ExprNode {
266- data =
267- LambdaCall {
268- callee = UnresolvedIdent " import" ;
269- call_args =
270- {data = TupleExpr [{data = Atomic (StringVal filename); _}]; _}
271- }; location} ->
272- let in_stream = Stdio.In_channel. create filename in
273- let in_string = Stdio.In_channel. input_all in_stream in
274- let file_block, _ = Parser. parse_str (" {" ^ in_string ^ " }" ) filename in
275- ExprNode file_block, ()
276- | _ -> node, ()
277-
278- let resolve_imports tree =
279- let tree, _ = tree_fold_map tree ~accumulator: () ~f: resolve_imports_step in
280- unwrap_expr_node tree
281-
282263let find_expr_functions ss acc e = match e with
283264 | FnDef {fn_name = UnresolvedIdent fn_name ; fn_def_func} ->
284265 (fn_name |> List.Assoc. find_exn ss.static_idents ~equal: String. equal, fn_def_func)::acc
Original file line number Diff line number Diff line change @@ -44,16 +44,11 @@ let run_string in_string filename (ss, state) =
4444 List. rev (aux remaining [parsed])
4545 in
4646 let block = BlockExpr expr_ls in
47- let block = Preprocess. resolve_imports (Preprocess. ExprNode (locate block)) in
48- let expr_ls = match block with
49- | {data = BlockExpr ls ; _} -> ls
50- | _ -> assert false
51- in
5247 let static_atoms =
53- Preprocess. find_atoms (ExprNode block) ss.static_atoms
48+ Preprocess. find_atoms (ExprNode (locate block) ) ss.static_atoms
5449 in
5550 let static_idents =
56- Preprocess. find_idents (ExprNode block) ss.static_idents
51+ Preprocess. find_idents (ExprNode (locate block) ) ss.static_idents
5752 in
5853 (* List.iter static_idents ~f:(fun (k, v) -> printf "%s: %d\n" k v); *)
5954 let ss = { ss with static_atoms; static_idents } in
You can’t perform that action at this time.
0 commit comments