Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
gares authored and FissoreD committed Nov 26, 2024
1 parent 25a0072 commit 331eeb7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/compiler/compiler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2190,6 +2190,22 @@ let symtab : (constant * D.term) F.Map.t D.State.component = D.State.declare
()


let global_name_to_constant state s =
let map = State.get symtab state in
fst @@ F.Map.find (F.from_string s) map

let symtab : (constant * D.term) F.Map.t D.State.component = D.State.declare
~descriptor:D.elpi_state_descriptor
~name:"elpi:symbol_table"
~pp:(fun fmt _ -> Format.fprintf fmt "<symbol_table>")
~clause_compilation_is_over:(fun x -> x)
~goal_compilation_begins:(fun x -> x)
~goal_compilation_is_over:(fun ~args:_ x -> Some x)
~compilation_is_over:(fun x -> Some x)
~execution_is_over:(fun _ -> None)
~init:(fun () -> F.Map.empty)


let global_name_to_constant state s =
let map = State.get symtab state in
fst @@ F.Map.find (F.from_string s) map
Expand Down

0 comments on commit 331eeb7

Please sign in to comment.