diff options
| author | Kathy Gray | 2015-12-14 15:55:50 +0000 |
|---|---|---|
| committer | Kathy Gray | 2015-12-14 15:56:00 +0000 |
| commit | fd1c1502ab59cd8a392af86376be99b0dc6b6b1f (patch) | |
| tree | 94316aae8826271fd7e794fd44d9fa4c205d331c /src/sail_lib.ml | |
| parent | 4fa10da0d4b6d8cfbb10455644836f7e1a802a2c (diff) | |
Adding new location constructor for location of generated terms
Diffstat (limited to 'src/sail_lib.ml')
| -rw-r--r-- | src/sail_lib.ml | 7 |
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 |
