diff options
| author | Enrico Tassi | 2019-03-25 17:31:55 +0100 |
|---|---|---|
| committer | Enrico Tassi | 2019-03-29 11:05:17 +0100 |
| commit | 7eba2dfda86238cb0941edfd7aafb09f566c36d8 (patch) | |
| tree | 9c1017c90e17d4fc98ecb144ff99d4c8553c1e51 /gramlib/grammar.ml | |
| parent | 4b9636ffd47ea5a0b99df442047ba03d18422738 (diff) | |
[parser] initialization based on Loc.t rather than Loc.source
In this way one can also set the current offsets in a file,
useful if you are parsing a Coq fragment within a file instead
of a full file starting from the first line.
Diffstat (limited to 'gramlib/grammar.ml')
| -rw-r--r-- | gramlib/grammar.ml | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gramlib/grammar.ml b/gramlib/grammar.ml index f46ddffd6e..74350c4f15 100644 --- a/gramlib/grammar.ml +++ b/gramlib/grammar.ml @@ -15,7 +15,7 @@ module type S = sig type te type parsable - val parsable : char Stream.t -> parsable + val parsable : ?loc:Loc.t -> char Stream.t -> parsable val tokens : string -> (string * int) list module Entry : sig @@ -1398,8 +1398,8 @@ let clear_entry e = Dlevels _ -> e.edesc <- Dlevels [] | Dparser _ -> () - let parsable cs = - let (ts, lf) = L.lexer.Plexing.tok_func cs in + let parsable ?loc cs = + let (ts, lf) = L.lexer.Plexing.tok_func ?loc cs in {pa_chr_strm = cs; pa_tok_strm = ts; pa_loc_func = lf} module Entry = struct |
