X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fcomponents%2Fcontent_pres%2FcicNotationParser.ml;h=53c60820c78632bd58f3b8527d697897537c92ff;hb=894d518aa760c9f816ddb0dc2b3fa88e1fe20a94;hp=f3953eb08f3e5a24302c142d38c93b15ac8e98a1;hpb=a4a2345e2efaf4cc64aa4daf40e2bce05a400f12;p=helm.git diff --git a/matita/components/content_pres/cicNotationParser.ml b/matita/components/content_pres/cicNotationParser.ml index f3953eb08..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 @@ -663,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 @@ -814,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 @@ -824,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) = @@ -848,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