summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2009-01-15 22:44:53 +0100
committerGuillaume Seguin <guillaume@segu.in>2009-01-15 22:44:53 +0100
commit46186090a9dc422369863e8c742800d15eea85c1 (patch)
treed7f164954d8cd6bbddabde147b6bb112f37d72bc
parent656cff28c55590648b17ba36553e748cda445e2b (diff)
downloadpetitcaml-46186090a9dc422369863e8c742800d15eea85c1.tar.gz
petitcaml-46186090a9dc422369863e8c742800d15eea85c1.tar.bz2
[petitcaml] Improve a few (should-be unreachable) errors
-rw-r--r--mips.ml4
-rw-r--r--utils.ml6
2 files changed, 5 insertions, 5 deletions
diff --git a/mips.ml b/mips.ml
index 496009c..abc0d0a 100644
--- a/mips.ml
+++ b/mips.ml
@@ -185,7 +185,7 @@ let print_instruction fmt = function
| Comment s ->
fprintf fmt "\t# %s\n" s
| Asciiz _
- | Word _ -> failwith "Unreachable matching"
+ | Word _ -> failwith "print_instruction : Unreachable matching"
let rec output_byte = function
| "" -> "0"
@@ -199,7 +199,7 @@ let print_data fmt = function
fprintf fmt "%s:\t.byte %s\n" l (output_byte s)
| Word (l, n) ->
fprintf fmt "%s:\t.word %d\n" l n
- | _ -> failwith "Unreachable matching"
+ | _ -> failwith "print_data : Unreachable matching"
type program =
{ text : instruction list ;
diff --git a/utils.ml b/utils.ml
index 3808f53..3e05579 100644
--- a/utils.ml
+++ b/utils.ml
@@ -116,7 +116,7 @@ let rec format_expr level expr =
(format_motif m1)
(format_motif m2)
(format_expr_i (level + 8) m_expr)
- | Eclos _ -> failwith "Unreachable matching"
+ | Eclos _ -> failwith "format_expr : Unreachable matching"
and format_expr_i level expr =
Printf.sprintf "%s%s" (make_indent level) (format_expr level expr)
and format_expr_list sep level = function
@@ -173,7 +173,7 @@ let locd_motif m loc =
puis en appliquant un fold right afin d'utiliser la curyfication
(f a b c est gérée comme f = function a -> function b -> function c) *)
let make_func id recur fbody = function
- | [] -> failwith "Unreachable matching"
+ | [] -> failwith "make_func : Unreachable matching"
| arg::args ->
let body = List.fold_right (fun arg base ->
raw_expr (Efunc {
@@ -209,5 +209,5 @@ let rec identifiers expr =
Sset.union (Sset.union (identifiers e1) (identifiers e2))
(identifiers e3)
| Efunc f -> identifiers f.body
- | Eclos _ -> failwith "Unreachable matching"
+ | Eclos _ -> failwith "identifiers : Unreachable matching"