summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sail_lib.ml7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/sail_lib.ml b/src/sail_lib.ml
index d1a5b891..4cfc1331 100644
--- a/src/sail_lib.ml
+++ b/src/sail_lib.ml
@@ -19,11 +19,12 @@ let parse_exps s =
let msg = Printf.sprintf "syntax error on character %d" pos.Lexing.pos_cnum in
failwith msg
| Parse_ast.Parse_error_locn(l,m) ->
- let loc = match l with
+ let rec format l = match l with
| Parse_ast.Unknown -> "???"
| Parse_ast.Range(p1,p2) -> Printf.sprintf "%d:%d" p1.Lexing.pos_cnum p2.Lexing.pos_cnum
- | Parse_ast.Int(s,_) -> Printf.sprintf "code generated by: %s" s in
- let msg = Printf.sprintf "syntax error: %s %s" loc m in
+ | Parse_ast.Generated l -> Printf.sprintf "code generated near: %s" (format l)
+ | Parse_ast.Int(s,_) -> Printf.sprintf "code for by: %s" s in
+ let msg = Printf.sprintf "syntax error: %s %s" (format l) m in
failwith msg
| Lexer.LexError(s,p) ->
let msg = Printf.sprintf "lexing error: %s %d" s p.Lexing.pos_cnum in