aboutsummaryrefslogtreecommitdiff
path: root/toplevel
diff options
context:
space:
mode:
authorHugo Herbelin2021-04-05 16:40:10 +0200
committerHugo Herbelin2021-04-23 15:34:29 +0200
commite07efb3798c7c6ec54aac9093ab50fddfc6c6a5b (patch)
tree3459872faa79c263577f55ddbd1a8d30d497f8a7 /toplevel
parent52a71bf2b1260ce8f8622878c82caec54d298808 (diff)
Relying on the abstract notion of streams with location for parsing.
We also get rid of ploc.ml, now useless, relying a priori on more robust code in lStream.ml for location reporting (see e.g. parse_parsable in grammar.ml).
Diffstat (limited to 'toplevel')
-rw-r--r--toplevel/coqloop.ml6
-rw-r--r--toplevel/vernac.ml2
2 files changed, 4 insertions, 4 deletions
diff --git a/toplevel/coqloop.ml b/toplevel/coqloop.ml
index 4faecd2e62..0265c0063c 100644
--- a/toplevel/coqloop.ml
+++ b/toplevel/coqloop.ml
@@ -242,12 +242,12 @@ let set_prompt prompt =
(* Read the input stream until a dot is encountered *)
let parse_to_dot =
- let rec dot tok st = match Stream.next st with
+ let rec dot st = match LStream.next st with
| Tok.KEYWORD ("."|"...") -> ()
| Tok.EOI -> ()
- | _ -> dot tok st
+ | _ -> dot st
in
- Pcoq.Entry.of_parser "Coqtoplevel.dot" dot
+ Pcoq.Entry.(of_parser "Coqtoplevel.dot" { parser_fun = dot })
(* If an error occurred while parsing, we try to read the input until a dot
token is encountered.
diff --git a/toplevel/vernac.ml b/toplevel/vernac.ml
index 92e664d56b..917acfad51 100644
--- a/toplevel/vernac.ml
+++ b/toplevel/vernac.ml
@@ -88,7 +88,7 @@ let load_vernac_core ~echo ~check ~interactive ~state file =
let input_cleanup () = close_in in_chan; Option.iter close_in in_echo in
let in_pa =
- Pcoq.Parsable.make ~loc:(Loc.initial (Loc.InFile file))
+ Pcoq.Parsable.make ~source:(Loc.InFile file)
(Stream.of_channel in_chan) in
let open State in