X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matitaB%2Fcomponents%2Fgrafite_parser%2FgrafiteParser.ml;h=30a97a3e3e130a28aee11926b17ce043b80dc48e;hb=34b7023a76f83ffbd489e4a59bb068ef0f5e7c36;hp=492274f97ec50ff49196c271d24efdd949976bfd;hpb=cacbe3c6493ddce76c4c13379ade271d8dd172e8;p=helm.git diff --git a/matitaB/components/grafite_parser/grafiteParser.ml b/matitaB/components/grafite_parser/grafiteParser.ml index 492274f97..30a97a3e3 100644 --- a/matitaB/components/grafite_parser/grafiteParser.ml +++ b/matitaB/components/grafite_parser/grafiteParser.ml @@ -59,7 +59,7 @@ let default_associativity = Gramext.NonA let mk_rec_corec ind_kind defs loc = let name,ty = match defs with - | (params,(N.Ident (name, None), ty),_,_) :: _ -> + | (params,(N.Ident (name, `Ambiguous), ty),_,_) :: _ -> let ty = match ty with Some ty -> ty | None -> N.Implicit `JustOne in let ty = List.fold_right @@ -69,7 +69,7 @@ let mk_rec_corec ind_kind defs loc = name,ty | _ -> assert false in - let body = N.Ident (name,None) in + let body = N.Ident (name,`Ambiguous) in (loc, N.Theorem(`Definition, name, ty, Some (N.LetRec (ind_kind, defs, body)), `Regular)) let nmk_rec_corec ind_kind defs loc = @@ -169,7 +169,8 @@ EXTEND | _ -> (*CSC: new NCicPp.status is the best I can do here without changing the result type *) - raise (Invalid_argument ("malformed target parameter list 2\n" ^ NotationPp.pp_term (new NCicPp.status) params)) ] + raise (Invalid_argument ("malformed target parameter list 2\n" ^ + NotationPp.pp_term (new NCicPp.status None ) params)) ] ]; direction: [ [ SYMBOL ">" -> `LeftToRight @@ -430,6 +431,7 @@ EXTEND (params,name,typ,fields) ] ]; + (* XXX: alias spec must be revised (no more instance nums) *) alias_spec: [ [ IDENT "id"; id = QSTRING; SYMBOL "="; uri = QSTRING -> let alpha = "[a-zA-Z]" in @@ -455,14 +457,14 @@ EXTEND let instance = match instance with Some i -> i | None -> 0 in - G.Symbol_alias (symbol, instance, dsc) + G.Symbol_alias (symbol, None, dsc) | IDENT "num"; instance = OPT [ LPAREN; IDENT "instance"; n = int; RPAREN -> n ]; SYMBOL "="; dsc = QSTRING -> let instance = match instance with Some i -> i | None -> 0 in - G.Number_alias (instance, dsc) + G.Number_alias (None,dsc) ] ]; argument: [ @@ -639,9 +641,9 @@ class type g_status = method parser_db: db end -class virtual status = +class virtual status uid = object(self) - inherit CicNotationParser.status ~keywords:[] + inherit CicNotationParser.status uid ~keywords:[] val mutable db = None (* mutable only to initialize it :-( *) method parser_db = match db with None -> assert false | Some x -> x method set_parser_db v = {< db = Some v >} @@ -661,7 +663,8 @@ let extend status l1 action = ;; -let parse_statement status = +let parse_statement status = + status#reset_loctable (); parse_statement status#parser_db (* vim:set foldmethod=marker: *)