summaryrefslogtreecommitdiffstats
path: root/parsing/syntaxerr.ml
diff options
context:
space:
mode:
authorDamien Doligez <damien.doligez-inria.fr>2011-08-04 14:59:13 +0000
committerDamien Doligez <damien.doligez-inria.fr>2011-08-04 14:59:13 +0000
commitd9eb848d869e656988d6159a3594e4c0fa4def21 (patch)
treecadec2615dd2c128fd2f5d5228c4cb27fc3e7a86 /parsing/syntaxerr.ml
parent9058296d2f647257aadeb59d7eb859546cf207c9 (diff)
PR#5238, PR#5277: Sys_error when getting error location
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11166 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'parsing/syntaxerr.ml')
-rw-r--r--parsing/syntaxerr.ml4
1 files changed, 2 insertions, 2 deletions
diff --git a/parsing/syntaxerr.ml b/parsing/syntaxerr.ml
index 00e06bba0..b0fda3695 100644
--- a/parsing/syntaxerr.ml
+++ b/parsing/syntaxerr.ml
@@ -26,8 +26,8 @@ exception Escape_error
let report_error ppf = function
| Unclosed(opening_loc, opening, closing_loc, closing) ->
- if String.length !Location.input_name = 0
- && Location.highlight_locations ppf opening_loc closing_loc
+ if !Location.input_name = "//toplevel//"
+ && Location.highlight_locations ppf opening_loc closing_loc
then fprintf ppf "Syntax error: '%s' expected, \
the highlighted '%s' might be unmatched" closing opening
else begin