diff options
| author | Enrico Tassi | 2019-08-02 16:46:51 +0200 |
|---|---|---|
| committer | Enrico Tassi | 2019-08-02 16:47:07 +0200 |
| commit | cb1557bd32ad84b0af278ed040aa207547e0df5d (patch) | |
| tree | b3e0a31b76548329577ece99a1b0104b446a387e | |
| parent | 2802a98273bd1478113130a235bf406d2f7f73f5 (diff) | |
[lexer]: improve error message on loct_func misuse
| -rw-r--r-- | parsing/cLexer.ml | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/parsing/cLexer.ml b/parsing/cLexer.ml index a27d6450b7..de23f05a9e 100644 --- a/parsing/cLexer.ml +++ b/parsing/cLexer.ml @@ -785,12 +785,14 @@ let next_token ~diff_mode loc s = (* Location table system for creating tables associating a token count to its location in a char stream (the source) *) -let locerr () = invalid_arg "Lexer: location function" +let locerr i = + let m = "Lexer: location function called on token "^string_of_int i in + invalid_arg m let loct_create () = Hashtbl.create 207 let loct_func loct i = - try Hashtbl.find loct i with Not_found -> locerr () + try Hashtbl.find loct i with Not_found -> locerr i let loct_add loct i loc = Hashtbl.add loct i loc |
