Add CLI options to execute different test suites
[tiger.ml.git] / compiler / src / lib / tiger / tiger_symbol.ml
CommitLineData
28875fec
SK
1module H = MoreLabels.Hashtbl
2
3type t =
4 { name : string
5 ; symbol : int
6 }
7
8let nextsym = ref 0
9
10let symbols = H.create 16
11
12let of_string name =
13 match H.find_opt symbols name with
14 | Some symbol ->
15 {name; symbol}
16 | None ->
17 incr nextsym;
18 let symbol = !nextsym in
19 H.replace symbols ~key:name ~data:symbol;
20 {name; symbol}
21
22let to_string {name; _} =
23 name
This page took 0.02895 seconds and 4 git commands to generate.