1 (* Provides a dictionary of possible annotations on tokens, indexed by keys.
3 * The purpose of these annotations is to direct the pretty printing of
4 * tokens. The annotations can be set by AST transformations.
6 * Assumptions: only a few tokens have annotations, and those have only
17 (* A linked list should offer a good tradeoff between space usage
18 * and lookup overhead given our assumptions.
20 type annots
= (annot_key
* annot_val
) list
24 let get_annot anns key
=
25 if List.mem_assoc key anns
26 then Some
(List.assoc key anns
)
29 let put_annot key
value anns
=