summaryrefslogtreecommitdiff
path: root/src/ast_util.ml
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast_util.ml')
-rw-r--r--src/ast_util.ml16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/ast_util.ml b/src/ast_util.ml
index d839b5a4..b0f4c052 100644
--- a/src/ast_util.ml
+++ b/src/ast_util.ml
@@ -306,6 +306,22 @@ let id_loc = function
let kid_loc = function
| Kid_aux (_, l) -> l
+let def_loc = function
+ | DEF_kind (KD_aux (_, (l, _)))
+ | DEF_type (TD_aux (_, (l, _)))
+ | DEF_fundef (FD_aux (_, (l, _)))
+ | DEF_val (LB_aux (_, (l, _)))
+ | DEF_spec (VS_aux (_, (l, _)))
+ | DEF_default (DT_aux (_, l))
+ | DEF_scattered (SD_aux (_, (l, _)))
+ | DEF_reg_dec (DEC_aux (_, (l, _))) ->
+ l
+ | DEF_internal_mutrec _
+ | DEF_comm _
+ | DEF_overload _
+ | DEF_fixity _ ->
+ Parse_ast.Unknown
+
let string_of_id = function
| Id_aux (Id v, _) -> v
| Id_aux (DeIid v, _) -> "(deinfix " ^ v ^ ")"