- G.Notation (_, l1, associativity, precedence, l2))) ->
- prerr_endline "Extending parser ..."; flush stdout;
- prerr_endline (CicNotationPp.pp_term l1) ;
- prerr_endline (CicNotationPp.pp_term l2) ;
- prerr_endline (sprintf "Found keywords: %s"
- (String.concat " " (CicNotationUtil.keywords_of_term l1)));
- let time1 = Unix.gettimeofday () in
- ignore (CicNotationParser.extend l1 ?precedence ?associativity
- (fun env loc -> CicNotationFwd.instantiate_level2 env l2));
- let time2 = Unix.gettimeofday () in
- prerr_endline "Extending pretty printer ..."; flush stdout;
- let time3 = Unix.gettimeofday () in
- ignore (CicNotationRew.add_pretty_printer
- ?precedence ?associativity l2 l1);
- let time4 = Unix.gettimeofday () in
- printf ("done (extending parser took %f, " ^^
- "extending pretty printer took %f)\n")
- (time2 -. time1) (time4 -. time3);
- flush stdout
+ G.Notation (_, dir, l1, associativity, precedence, l2))) ->
+ prerr_endline "notation";
+ prerr_endline (sprintf "l1: %s" (CicNotationPp.pp_term l1));
+ prerr_endline (sprintf "l2: %s" (CicNotationPp.pp_term l2));
+ prerr_endline (sprintf "prec: %s" (pp_precedence precedence));
+ prerr_endline (sprintf "assoc: %s" (pp_associativity associativity));
+ let keywords = CicNotationUtil.keywords_of_term l1 in
+ if keywords <> [] then
+ prerr_endline (sprintf "keywords: %s"
+ (String.concat " " keywords));
+ if dir <> Some `RightToLeft then
+ ignore
+ (CicNotationParser.extend l1 ?precedence ?associativity
+ (fun env loc -> CicNotationFwd.instantiate_level2 env l2));
+(* last_rule_id := Some rule_id; *)
+ if dir <> Some `LeftToRight then
+ ignore (CicNotationRew.add_pretty_printer
+ ?precedence ?associativity l2 l1)