X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fcic%2FcicParser.ml;h=150fe4ad983f6dab3bad1d117877e6093531b755;hb=7bbe9c8a9fcc471920c18a12fb5745828f2fd188;hp=f9d6d880ed122be497f803d4841ecd3fca478cb5;hpb=6e5d56aeaba8db09debf2cb4bfa5afb5b76cdcdc;p=helm.git diff --git a/helm/software/components/cic/cicParser.ml b/helm/software/components/cic/cicParser.ml index f9d6d880e..150fe4ad9 100644 --- a/helm/software/components/cic/cicParser.ml +++ b/helm/software/components/cic/cicParser.ml @@ -672,12 +672,19 @@ let end_element ctxt tag = | [ "value", "remark"] -> Obj_flavour `Remark | [ "value", "theorem"] -> Obj_flavour `Theorem | [ "value", "variant"] -> Obj_flavour `Variant + | [ "value", "axiom"] -> Obj_flavour `Axiom | _ -> attribute_error ()) | "class" -> let class_modifiers = pop_class_modifiers ctxt in push ctxt (match pop_tag_attrs ctxt with - | ["value", "coercion"] -> Obj_class `Coercion + | ["value", "coercion"] -> Obj_class (`Coercion 0) + | ("value", "coercion")::["arity",n] + | ("arity",n)::["value", "coercion"] -> + let arity = try int_of_string n with Failure _ -> + parse_error "\"arity\" must be an integer" + in + Obj_class (`Coercion arity) | ["value", "elim"] -> (match class_modifiers with | [Cic_term (Cic.ASort (_, sort))] -> Obj_class (`Elim sort) @@ -690,8 +697,15 @@ let end_element ctxt tag = (function | Obj_field name -> (match Str.split (Str.regexp " ") name with - | [name] -> name, false - | [name;"coercion"] -> name,true + | [name] -> name, false, 0 + | [name;"coercion"] -> name,true,0 + | [name;"coercion"; n] -> + let n = + try int_of_string n + with Failure _ -> + parse_error "int expected after \"coercion\"" + in + name,true,n | _ -> parse_error "wrong \"field\"'s name attribute")