diff options
author | Daniil Baturin <daniil@baturin.org> | 2015-02-24 22:48:50 +0600 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2015-02-24 22:48:50 +0600 |
commit | 30a6ac8bb9faf96f79574fb16fc8765ea855a9e4 (patch) | |
tree | b31a5e6cc9c3e589c2168e1e3de8cc415a86b25e /src | |
parent | c9fdf3113313fb1cf7bac3fd9df6d1011f43a01e (diff) | |
download | vyconf-30a6ac8bb9faf96f79574fb16fc8765ea855a9e4.tar.gz vyconf-30a6ac8bb9faf96f79574fb16fc8765ea855a9e4.zip |
Add make_full to Vytree for constructing nodes from scratch.
Diffstat (limited to 'src')
-rw-r--r-- | src/vytree.ml | 2 | ||||
-rw-r--r-- | src/vytree.mli | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/src/vytree.ml b/src/vytree.ml index 44a2a62..22b4a6d 100644 --- a/src/vytree.ml +++ b/src/vytree.ml @@ -12,6 +12,8 @@ exception Nonexistent_path let make name data = { name = name; data = data; children = [] } +let make_full name data children = { name = name; data = data; children = children } + let name_of_node node = node.name let data_of_node node = node.data let children_of_node node = node.children diff --git a/src/vytree.mli b/src/vytree.mli index 6a991c0..dc14b1c 100644 --- a/src/vytree.mli +++ b/src/vytree.mli @@ -5,6 +5,7 @@ exception Duplicate_child exception Nonexistent_path val make : string -> 'a -> 'a t +val make_full : string -> 'a -> ('a t) list -> 'a t val name_of_node : 'a t -> string val data_of_node : 'a t -> 'a |