Attention une mise à jour du service Gitlab va être effectuée le mardi 18 janvier (et non lundi 17 comme annoncé précédemment) entre 18h00 et 18h30. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes.

Commit e9b2538d authored by Bruno Guillaume's avatar Bruno Guillaume
Browse files

remove constructors "No_domain" from label type

parent 5b5fdf0c
......@@ -103,46 +103,42 @@ module Massoc_pid = Massoc_make (Pid)
(* ================================================================================ *)
module Label = struct
(** describe the display style of a label *)
type line = Solid | Dot | Dash
type style = {
text: string;
bottom: bool;
color: string option;
bgcolor: string option;
line: line;
}
(** Global names and display styles are recorded in two aligned arrays *)
let full = ref None
let styles = ref ([||] : style array)
(** Internal representation of labels *)
type t =
| Global of int (* globally defined labels: their names are in the [full] array *)
| Local of int (* locally defined labels: names array should be provided! UNTESTED *)
| No_domain of string (* out of domain label: name in not constrained *)
(** [to_string t] returns a string for the label *)
let to_string ?(locals=[||]) t =
match (!full, t) with
| (_, No_domain s) -> s
| (Some table, Global i) -> table.(i)
| (Some _, Local i) -> fst locals.(i)
| _ -> Error.bug "[Label.to_string] inconsistent data"
| _ -> Error.bug "[Label.to_string] labels were not properly initialized"
let to_int = function
| Global i -> Some i
| _ -> None
(** describe the display style of a label *)
type line = Solid | Dot | Dash
type style = {
text: string;
bottom: bool;
color: string option;
bgcolor: string option;
line: line;
}
(** The [default] style value *)
let default = { text="UNSET"; bottom=false; color=None; bgcolor=None; line=Solid }
let styles = ref ([||] : style array)
let get_style = function
| Global i -> !styles.(i)
| Local i -> Log.warning "Style of locally defined labels is not implemented"; default
| No_domain s -> { default with text=s }
(** Computes the style of a label from its options and maybe its shape (like I:...). *)
let parse_option string_label options =
......@@ -199,7 +195,7 @@ module Label = struct
let from_string ?loc ?(locals=[||]) string =
match !full with
| None -> No_domain string
| None -> Error.bug "[Label.from_string] labels were not properly initialized"
| Some table ->
try Global (Id.build ?loc string table)
with Not_found ->
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment