]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/content_pres/termContentPres.ml
hbox => hvbox in constructor arguments in match patterns.
[helm.git] / helm / software / components / content_pres / termContentPres.ml
index a1f9268e4edae7cd0253e70439370ee7a6412abd..29845af1ded26666ec2467cd0e1bf22d17862364 100644 (file)
@@ -144,7 +144,7 @@ let pp_ast0 t k =
         let mk_case_pattern =
          function
             Ast.Pattern (head, href, vars) ->
-             hbox true false (ident_w_href href head :: List.map aux_var vars)
+             hvbox true false (ident_w_href href head :: List.map aux_var vars)
           | Ast.Wildcard -> builtin_symbol "_"
         in
         let patterns' =
@@ -196,7 +196,7 @@ let pp_ast0 t k =
               hvbox false true [
                 aux_var var; space;
                 builtin_symbol "\\def"; break; top_pos (k s) ];
-              break; space; keyword "in" ];
+              break; space; keyword "in"; space ];
             break;
             k t ])
     | Ast.LetRec (rec_kind, funs, where) ->
@@ -319,7 +319,11 @@ let instantiate21 idrefs env l1 =
         assert (CicNotationEnv.well_typed ty value); (* INVARIANT *)
         (* following assertion should be a conditional that makes this
          * instantiation fail *)
-        assert (CicNotationEnv.well_typed expected_ty value);
+        if not (CicNotationEnv.well_typed expected_ty value) then
+         begin
+          prerr_endline ("The variable " ^ name ^ " is used with the wrong type in the notation declaration");
+          assert false
+         end;
         let value = CicNotationEnv.term_of_value value in
         let value = 
           match expected_ty with
@@ -346,7 +350,7 @@ let instantiate21 idrefs env l1 =
         let sep =
           match sep_opt with
             | None -> []
-            | Some l -> [ Ast.Literal l ]
+            | Some l -> [ Ast.Literal l; break; space ]
        in
         let rec instantiate_list acc = function
           | [] -> List.rev acc
@@ -359,7 +363,8 @@ let instantiate21 idrefs env l1 =
               let terms = subst pos env p in
               instantiate_list (CicNotationUtil.group (terms @ sep) :: acc) tl
         in
-        instantiate_list [] values
+        if values = [] then []
+        else [hovbox false false (instantiate_list [] values)]
     | Ast.Opt p ->
         let opt_decls = CicNotationEnv.declarations_of_term p in
         let env =