X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=matita%2Fcomponents%2Fcontent_pres%2FcicNotationParser.ml;h=53c60820c78632bd58f3b8527d697897537c92ff;hb=894d518aa760c9f816ddb0dc2b3fa88e1fe20a94;hp=a9b558968829d8692683a63c09b9f4910545bd3a;hpb=fb6fee82bb9172e15b1a7bc7e20641627f593fcc;p=helm.git diff --git a/matita/components/content_pres/cicNotationParser.ml b/matita/components/content_pres/cicNotationParser.ml index a9b558968..53c60820c 100644 --- a/matita/components/content_pres/cicNotationParser.ml +++ b/matita/components/content_pres/cicNotationParser.ml @@ -157,7 +157,7 @@ let extract_term_production status pattern = | Ast.Magic m -> aux_magic m | Ast.Variable v -> aux_variable v | t -> - prerr_endline (NotationPp.pp_term t); + prerr_endline (NotationPp.pp_term status t); assert false and aux_literal = function @@ -375,10 +375,6 @@ let parse_level2_meta grammars lexbuf = exc_located_wrapper (fun () -> Grammar.Entry.parse grammars.level2_meta (Obj.magic lexbuf)) -let parse_term grammars lexbuf = - exc_located_wrapper - (fun () -> (Grammar.Entry.parse grammars.term (Obj.magic lexbuf))) - (* create empty precedence level for "term" *) let initialize_grammars grammars = let dummy_action = @@ -667,8 +663,10 @@ EXTEND in let rec find_arg name n = function | [] -> + (* CSC: new NCicPp.status is the best I can do here + without changing the return type *) Ast.fail loc (sprintf "Argument %s not found" - (NotationPp.pp_term name)) + (NotationPp.pp_term (new NCicPp.status) name)) | (l,_) :: tl -> (match position_of name 0 l with | None, len -> find_arg name (n + len) tl @@ -818,7 +816,7 @@ class type g_status = method notation_parser_db: db end -class status ~keywords:kwds = +class status0 ~keywords:kwds = object val db = { grammars = initial_grammars kwds; keywords = kwds; items = [] } method notation_parser_db = db @@ -828,6 +826,12 @@ class status ~keywords:kwds = = fun o -> {< db = o#notation_parser_db >} end +class virtual status ~keywords:kwds = + object + inherit NCic.status + inherit status0 kwds + end + let extend (status : #status) (CL1P (level1_pattern,precedence)) action = (* move inside constructor XXX *) let add1item status (level, level1_pattern, action) = @@ -852,7 +856,7 @@ let extend (status : #status) (CL1P (level1_pattern,precedence)) action = let keywords = NotationUtil.keywords_of_term level1_pattern @ status#notation_parser_db.keywords in let items = current_item :: status#notation_parser_db.items in - let status = status#set_notation_parser_status (new status ~keywords) in + let status = status#set_notation_parser_status (new status0 ~keywords) in let status = status#set_notation_parser_db {status#notation_parser_db with items = items} in List.fold_left add1item status items @@ -865,8 +869,6 @@ let parse_level2_ast status = parse_level2_ast status#notation_parser_db.grammars let parse_level2_meta status = parse_level2_meta status#notation_parser_db.grammars -let parse_term status = - parse_term status#notation_parser_db.grammars let level2_ast_grammar status = status#notation_parser_db.grammars.level2_ast_grammar