aboutsummaryrefslogtreecommitdiff
path: root/ide/document.ml
diff options
context:
space:
mode:
authorEmilio Jesus Gallego Arias2019-11-21 15:38:39 +0100
committerEmilio Jesus Gallego Arias2019-11-21 15:38:39 +0100
commitd016f69818b30b75d186fb14f440b93b0518fc66 (patch)
tree32cd948273f79a2c01ad27b4ed0244ea60d7e2f9 /ide/document.ml
parentb680b06b31c27751a7d551d95839aea38f7fbea1 (diff)
[coq] Untabify the whole ML codebase.
We also remove trailing whitespace. Script used: ```bash for i in `find . -name '*.ml' -or -name '*.mli' -or -name '*.mlg'`; do expand -i "$i" | sponge "$i"; sed -e's/[[:space:]]*$//' -i.bak "$i"; done ```
Diffstat (limited to 'ide/document.ml')
-rw-r--r--ide/document.ml18
1 files changed, 9 insertions, 9 deletions
diff --git a/ide/document.ml b/ide/document.ml
index cee490861d..b8e8182ab2 100644
--- a/ide/document.ml
+++ b/ide/document.ml
@@ -64,7 +64,7 @@ let tip = function
| { stack = [] } -> raise Empty
| { stack = { state_id = Some id }::_ } -> id
| { stack = { state_id = None }::_ } -> invalid_arg "tip"
-
+
let tip_data = function
| { stack = [] } -> raise Empty
| { stack = { data }::_ } -> data
@@ -89,19 +89,19 @@ let focus d ~cond_top:c_start ~cond_bot:c_stop =
else aux (x::a,s,b) grab xs
| { state_id = Some id; data } as x :: xs ->
if c_stop id data then List.rev a, List.rev (x::s), xs
- else aux (a,x::s,b) grab xs
+ else aux (a,x::s,b) grab xs
| _ -> assert false in
let a, s, b = aux ([],[],[]) false d.stack in
d.stack <- s;
d.context <- Some (a, b)
-
+
let unfocus = function
| { context = None } -> invalid_arg "unfocus"
| { context = Some (a,b); stack } as d ->
assert(invariant stack);
d.context <- None;
d.stack <- a @ stack @ b
-
+
let focused { context } = context <> None
let to_lists = function
@@ -117,17 +117,17 @@ let find d f =
try List.find (flat f true) s with Not_found ->
List.find (flat f false) b
).data
-
+
let find_map d f =
let a, s, b = to_lists d in
- try CList.find_map (flat f false) a with Not_found ->
- try CList.find_map (flat f true) s with Not_found ->
+ try CList.find_map (flat f false) a with Not_found ->
+ try CList.find_map (flat f true) s with Not_found ->
CList.find_map (flat f false) b
-
+
let is_empty = function
| { stack = []; context = None } -> true
| _ -> false
-
+
let context d =
let top, _, bot = to_lists d in
let pair _ x y = try Option.get x, y with Option.IsNone -> assert false in