aboutsummaryrefslogtreecommitdiff
path: root/vernac/vernacexpr.ml
diff options
context:
space:
mode:
authorEmilio Jesus Gallego Arias2019-06-30 19:47:04 +0200
committerEmilio Jesus Gallego Arias2019-08-14 17:55:19 +0200
commitc4f800a1c92c7f558cdcb1915649e2666b1a897e (patch)
tree006ffcdd606d698b42a35dffb54d9be17014b8aa /vernac/vernacexpr.ml
parent09002e0c20cf4da9cbb1e27146ae1fdd205b304a (diff)
[vernac] Refactor Vernacular Control Attributes into a list
We place control attributes on their own, datatype, similarly to regular attributes. This is a step towards fixing #10452 , as we can now decouple control attributes from the vernac AST itself, allowing to pass them independently.
Diffstat (limited to 'vernac/vernacexpr.ml')
-rw-r--r--vernac/vernacexpr.ml17
1 files changed, 11 insertions, 6 deletions
diff --git a/vernac/vernacexpr.ml b/vernac/vernacexpr.ml
index 0968632c2d..84f437f640 100644
--- a/vernac/vernacexpr.ml
+++ b/vernac/vernacexpr.ml
@@ -414,12 +414,17 @@ type nonrec vernac_expr =
(* For extension *)
| VernacExtend of extend_name * Genarg.raw_generic_argument list
-type vernac_control_r =
- | VernacExpr of Attributes.vernac_flags * vernac_expr
+type control_flag =
+ | ControlTime of bool
(* boolean is true when the `-time` batch-mode command line flag was set.
the flag is used to print differently in `-time` vs `Time foo` *)
- | VernacTime of bool * vernac_control
- | VernacRedirect of string * vernac_control
- | VernacTimeout of int * vernac_control
- | VernacFail of vernac_control
+ | ControlRedirect of string
+ | ControlTimeout of int
+ | ControlFail
+
+type vernac_control_r =
+ { control : control_flag list
+ ; attrs : Attributes.vernac_flags
+ ; expr : vernac_expr
+ }
and vernac_control = vernac_control_r CAst.t