-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
65 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
type t = [ `Main_message | `Extra_remark of int ] * Text.t | ||
let priority = | ||
function | ||
| `Main_message, _ -> -1 | ||
| `Extra_remark i, _ -> i | ||
let compare t1 t2 = | ||
Utils.compare_pair Int.compare Stdlib.compare | ||
(priority t1, t1) (priority t2, t2) | ||
let dump fmt = | ||
function | ||
| `Main_message, _ -> Format.pp_print_string fmt "`Main_message" | ||
| `Extra_remark i, _ -> Format.fprintf fmt "`Extra_remark %d" i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module Tag_map = Map.Make(Tty_tag) | ||
type t = int Tag_map.t | ||
let empty : t = Tag_map.empty | ||
let is_empty : t -> bool = Tag_map.is_empty | ||
let add t = | ||
Tag_map.update t @@ function | ||
| None -> Some 1 | ||
| Some n -> Some (n+1) | ||
let remove t = | ||
Tag_map.update t @@ function | ||
| None -> failwith "Asai.Tty.S.display: removing a non-existing tag from a tag set" | ||
| Some 1 -> None | ||
| Some n -> Some (n-1) | ||
let prioritized s = Option.map fst @@ Tag_map.min_binding_opt s |