diff options
| author | Thomas Bauereiss | 2017-07-03 19:00:35 +0100 |
|---|---|---|
| committer | Thomas Bauereiss | 2017-07-03 19:00:35 +0100 |
| commit | 9cb879efde58abfd5cc4ae8b2d0344902c983cde (patch) | |
| tree | b6bd2a76bc437a8913fd31ee7d4d9d63496fcb60 /src/util.ml | |
| parent | 3ffbf81915d51115a586306d977a3845df3ea12a (diff) | |
Cleanup, and add support for variable bindings in bitvector patterns
Diffstat (limited to 'src/util.ml')
| -rw-r--r-- | src/util.ml | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/util.ml b/src/util.ml index 2b6f81f8..bb277016 100644 --- a/src/util.ml +++ b/src/util.ml @@ -240,6 +240,12 @@ let split_after n l = | _ -> raise (Failure "index too large") in aux [] n l +let rec split3 = function + | (x, y, z) :: xs -> + let (xs, ys, zs) = split3 xs in + (x :: xs, y :: ys, z :: zs) + | [] -> ([], [], []) + let list_mapi (f : int -> 'a -> 'b) (l : 'a list) : 'b list = let rec aux f i l = match l with @@ -324,4 +330,3 @@ let rec string_of_list sep string_of = function | [] -> "" | [x] -> string_of x | x::ls -> (string_of x) ^ sep ^ (string_of_list sep string_of ls) - |
