summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabriel Kerneis2014-05-12 16:42:25 +0100
committerGabriel Kerneis2014-05-12 16:45:54 +0100
commit3a1b6cd41bcfeea475c7a24693b98633dda03b75 (patch)
treeb80443d94a38a9dcc93548ed8e4bc44c706d2337 /src
parentea256f57cf0f0907b5dbf73cefcb33c6cf84db63 (diff)
Avoid pattern-matching warnings in pretty-printer
Diffstat (limited to 'src')
-rw-r--r--src/parser.mly1
-rw-r--r--src/pretty_print.ml7
2 files changed, 8 insertions, 0 deletions
diff --git a/src/parser.mly b/src/parser.mly
index 3c3cf8e0..52c8141f 100644
--- a/src/parser.mly
+++ b/src/parser.mly
@@ -386,6 +386,7 @@ exp_typ:
| TwoStarStar nexp_typ
{ tloc (ATyp_exp($2)) }
+/* this is wrong - for instance, 2** 3 + 5 is parsed as 2** (3+5) */
nexp_typ:
| exp_typ
{ $1 }
diff --git a/src/pretty_print.ml b/src/pretty_print.ml
index ecafc5f2..03b2ba34 100644
--- a/src/pretty_print.ml
+++ b/src/pretty_print.ml
@@ -255,6 +255,9 @@ and pp_exp ppf (E_aux(e,(_,annot))) =
| E_case(exp,pexps) -> fprintf ppf "@[<0>%a %a %a %a %a@]" kwd "switch " pp_exp exp kwd "{" (list_pp pp_case pp_case) pexps kwd "}"
| E_let(leb,exp) -> fprintf ppf "@[<0>%a@ %a@ %a@]" pp_let leb kwd "in" pp_exp exp
| E_assign(lexp,exp) -> fprintf ppf "@[<0>%a%a%a@]" pp_lexp lexp kwd " := " pp_exp exp
+ (* XXX missing cases *)
+ | E_internal_cast ((_, Overload (_, _)), _) | E_internal_exp _ -> assert false
+
and pp_semi_exp ppf e = fprintf ppf "@[<1>%a%a@]" pp_exp e kwd ";"
@@ -603,6 +606,8 @@ let pp_format_annot = function
| NoTyp -> "Nothing"
| Base((_,t),tag,nes,efct) ->
"(Just (" ^ pp_format_t t ^ ", " ^ pp_format_tag tag ^ ", " ^ pp_format_nes nes ^ ", " ^ pp_format_e efct ^ "))"
+ (* XXX missing case *)
+ | Overload _ -> assert false
let pp_annot ppf ant = base ppf (pp_format_annot ant)
@@ -689,6 +694,8 @@ and pp_lem_exp ppf (E_aux(e,(l,annot))) =
fprintf ppf "@[<0>(E_aux (%a %a [%a]) (%a, %a))@]" kwd "E_case" pp_lem_exp exp (list_pp pp_semi_lem_case pp_lem_case) pexps pp_lem_l l pp_annot annot
| E_let(leb,exp) -> fprintf ppf "@[<0>(E_aux (%a %a %a) (%a, %a))@]" kwd "E_let" pp_lem_let leb pp_lem_exp exp pp_lem_l l pp_annot annot
| E_assign(lexp,exp) -> fprintf ppf "@[<0>(E_aux (%a %a %a) (%a, %a))@]" kwd "E_assign" pp_lem_lexp lexp pp_lem_exp exp pp_lem_l l pp_annot annot
+ (* XXX missing cases *)
+ | E_internal_cast ((_, Overload (_, _)), _) | E_internal_exp _ -> assert false
in
print_e ppf e