diff options
Diffstat (limited to 'src/ast_util.mli')
| -rw-r--r-- | src/ast_util.mli | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ast_util.mli b/src/ast_util.mli index eac0d62e..429320cf 100644 --- a/src/ast_util.mli +++ b/src/ast_util.mli @@ -350,3 +350,17 @@ val pat_ids : 'a pat -> IdSet.t val subst : id -> 'a exp -> 'a exp -> 'a exp val hex_to_bin : string -> string + + +(** locate takes an expression and recursively sets the location in + every subexpression to the provided location. Expressions build + using mk_exp and similar do not have locations, so they can then be + annotated as e.g. locate (gen_loc l) (mk_exp ...) where l is the + location from which the code is being generated. *) +val locate : l -> 'a exp -> 'a exp + +val locate_pat : l -> 'a pat -> 'a pat + +val locate_lexp : l -> 'a lexp -> 'a lexp + +val locate_typ : l -> typ -> typ |
