diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/reference_tree.ml | 11 | ||||
| -rw-r--r-- | src/reference_tree.mli | 4 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/reference_tree.ml b/src/reference_tree.ml index c78529e..4532135 100644 --- a/src/reference_tree.ml +++ b/src/reference_tree.ml @@ -605,6 +605,17 @@ let get_completion_data reftree path = in List.map aux (Vytree.children_of_node @@ (Vytree.get[@alert "-exn"]) reftree path) +let get_default_value reftree path = + (* raises: + [Vytree.Empty_path] + [Vytree.Nonexistent_path] + alert exn Vytree.get_data: + [Vytree.Empty_path] allow raise + [Vytree.Nonexistent_path] allow raise + *) + let data = (Vytree.get_data[@alert "-exn"]) reftree path in + data.default_value + (* Convert from config path to reference tree path *) let refpath reftree path = let check_existence p = diff --git a/src/reference_tree.mli b/src/reference_tree.mli index dd8230d..5bb74bc 100644 --- a/src/reference_tree.mli +++ b/src/reference_tree.mli @@ -107,6 +107,10 @@ val get_completion_data : t -> string list -> (node_type * bool * string) list [@@alert exn "Vytree.Empty_path"] [@@alert exn "Vytree.Nonexistent_path"] +val get_default_value : t -> string list -> string option +[@@alert exn "Vytree.Empty_path"] +[@@alert exn "Vytree.Nonexistent_path"] + val refpath : t -> string list -> string list val set_tag_data : t -> Config_tree.t -> string list -> Config_tree.t |
