summaryrefslogtreecommitdiffstats
path: root/parsing/syntaxerr.ml
diff options
context:
space:
mode:
authorPierre Weis <Pierre.Weis@inria.fr>2000-03-06 22:12:09 +0000
committerPierre Weis <Pierre.Weis@inria.fr>2000-03-06 22:12:09 +0000
commitb96208b7a247cbb6d9d162fbfaf54448af33589c (patch)
treea63fb52f6e36ca47129637586cf6d0fd3d576733 /parsing/syntaxerr.ml
parenta56ae9a35f7cb4b5ccd128c2b9610b4913d71331 (diff)
Revu les impressions du compilateur
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2908 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'parsing/syntaxerr.ml')
-rw-r--r--parsing/syntaxerr.ml19
1 files changed, 9 insertions, 10 deletions
diff --git a/parsing/syntaxerr.ml b/parsing/syntaxerr.ml
index e03cd77b2..82fcc7745 100644
--- a/parsing/syntaxerr.ml
+++ b/parsing/syntaxerr.ml
@@ -14,7 +14,7 @@
(* Auxiliary type for reporting syntax errors *)
-open Formatmsg
+open Format
type error =
Unclosed of Location.t * string * Location.t * string
@@ -23,20 +23,19 @@ type error =
exception Error of error
exception Escape_error
-let report_error = function
- Unclosed(opening_loc, opening, closing_loc, closing) ->
+let report_error ppf = function
+ | Unclosed(opening_loc, opening, closing_loc, closing) ->
if String.length !Location.input_name = 0
&& Location.highlight_locations opening_loc closing_loc
- then printf "Syntax error: '%s' expected, \
+ then fprintf ppf "Syntax error: '%s' expected, \
the highlighted '%s' might be unmatched" closing opening
else begin
- Location.print closing_loc;
- printf "Syntax error: '%s' expected@?" closing;
- Location.print opening_loc;
- printf "This '%s' might be unmatched" opening
+ fprintf ppf "%aSyntax error: '%s' expected@?"
+ Location.print closing_loc closing;
+ fprintf ppf "%aThis '%s' might be unmatched"
+ Location.print opening_loc opening
end
| Other loc ->
- Location.print loc;
- print_string "Syntax error"
+ fprintf ppf "%aSyntax error" Location.print loc