aboutsummaryrefslogtreecommitdiff
path: root/contrib/interface
diff options
context:
space:
mode:
authormsozeau2008-11-09 16:17:14 +0000
committermsozeau2008-11-09 16:17:14 +0000
commit3f5ce5cbf138435fcf7e50bf978192c9fdd7db05 (patch)
tree233c3444ff46fe4b5d1a26047cfd91d4305cb73b /contrib/interface
parent722ff72af621e09a1772d56613fd930b4ad7245a (diff)
More factorization of inductive/record and typeclasses: move class
declaration code to toplevel/record, including support for singleton classes as definitions. Parsing code also factorized. Arnaud: one more thing to think about when refactoring the definitions in vernacentries. Add support for specifying what to do with anonymous variables in contexts during internalisation (fixes bug #1982), current choice is to generate a name for typeclass bindings. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@11563 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'contrib/interface')
-rw-r--r--contrib/interface/name_to_ast.ml2
-rw-r--r--contrib/interface/xlate.ml6
2 files changed, 4 insertions, 4 deletions
diff --git a/contrib/interface/name_to_ast.ml b/contrib/interface/name_to_ast.ml
index 7ee38fc230..f41d88bd60 100644
--- a/contrib/interface/name_to_ast.ml
+++ b/contrib/interface/name_to_ast.ml
@@ -109,7 +109,7 @@ let convert_one_inductive sp tyi =
let sp = sp_of_global (IndRef (sp, tyi)) in
(((dummy_loc,basename sp),
convert_env(List.rev params),
- (extern_constr true envpar arity),
+ Some (extern_constr true envpar arity),
Constructors (convert_constructors envpar cstrnames cstrtypes)), None);;
(* This function converts a Mutual inductive definition to a Coqast.t.
diff --git a/contrib/interface/xlate.ml b/contrib/interface/xlate.ml
index 73acbf0f36..8ec6cfb2f4 100644
--- a/contrib/interface/xlate.ml
+++ b/contrib/interface/xlate.ml
@@ -1979,14 +1979,14 @@ let rec xlate_vernac =
((if add_coercion then CT_coercion_atm else
CT_coerce_NONE_to_COERCION_OPT(CT_none)),
xlate_ident s, xlate_binder_list binders,
- xlate_formula c1, record_constructor,
+ xlate_formula (Option.get c1), record_constructor,
build_record_field_list field_list)
| VernacInductive (isind, lmi) ->
let co_or_ind = if isind then "Inductive" else "CoInductive" in
let strip_mutind = function
(((_,s), parameters, c, Constructors constructors), notopt) ->
CT_ind_spec
- (xlate_ident s, xlate_binder_list parameters, xlate_formula c,
+ (xlate_ident s, xlate_binder_list parameters, xlate_formula (Option.get c),
build_constructors constructors,
translate_opt_notation_decl notopt)
| _ -> xlate_error "TODO: Record notation in (Co)Inductive" in
@@ -2148,7 +2148,7 @@ let rec xlate_vernac =
(* Type Classes *)
| VernacDeclareInstance _|VernacContext _|
- VernacInstance (_, _, _, _, _)|VernacClass (_, _, _, _, _) ->
+ VernacInstance (_, _, _, _, _) ->
xlate_error "TODO: Type Classes commands"
| VernacResetName id -> CT_reset (xlate_ident (snd id))