aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorJason Gross2018-11-27 21:03:57 -0500
committerJason Gross2018-11-28 15:01:17 -0500
commitf7992de2dc4ce0091197b9476779fc120a2fd9ec (patch)
tree236d3a9e0b2e357b893653d97b41303cb8d5529c /plugins
parent26ef08ab681661c03c8bffa88d7bec949d692f58 (diff)
Factor out common code in numeral/string notations
As per https://github.com/coq/coq/pull/8965#issuecomment-441440779
Diffstat (limited to 'plugins')
-rw-r--r--plugins/syntax/numeral.ml2
-rw-r--r--plugins/syntax/string_notation.ml11
2 files changed, 7 insertions, 6 deletions
diff --git a/plugins/syntax/numeral.ml b/plugins/syntax/numeral.ml
index 10a0af0b8f..470deb4a60 100644
--- a/plugins/syntax/numeral.ml
+++ b/plugins/syntax/numeral.ml
@@ -125,7 +125,7 @@ let vernac_numeral_notation local ty f g scope opts =
| None -> type_error_of g ty true
in
let o = { to_kind; to_ty; of_kind; of_ty;
- num_ty = ty;
+ ty_name = ty;
warning = opts }
in
(match opts, to_kind with
diff --git a/plugins/syntax/string_notation.ml b/plugins/syntax/string_notation.ml
index fff8e928c3..12ee4c6eda 100644
--- a/plugins/syntax/string_notation.ml
+++ b/plugins/syntax/string_notation.ml
@@ -80,11 +80,12 @@ let vernac_string_notation local ty f g scope =
else if has_type g (arrow cty (opt cbyte)) then Byte, Option
else type_error_of g ty
in
- let o = { sto_kind = to_kind;
- sto_ty = to_ty;
- sof_kind = of_kind;
- sof_ty = of_ty;
- string_ty = ty }
+ let o = { to_kind = to_kind;
+ to_ty = to_ty;
+ of_kind = of_kind;
+ of_ty = of_ty;
+ ty_name = ty;
+ warning = () }
in
let i =
{ pt_local = local;