summaryrefslogtreecommitdiffstats
path: root/toplevel
diff options
context:
space:
mode:
authorAlain Frisch <alain@frisch.fr>2014-09-23 14:54:01 +0000
committerAlain Frisch <alain@frisch.fr>2014-09-23 14:54:01 +0000
commit44c2066055b120b35a6c745692f7a9e2d3a55fd8 (patch)
tree1ffe6e17dca49269e147b956a748d0d1c9f2480d /toplevel
parent830a4fba2acc6c1d8641e30033fa9bab8fd7638c (diff)
#5904: improve support for ppx in the toplevel by allowing ppx processors to keep information across calls (through the use of persistent cookies). Also change Ast_mapper.register so that the function that creates the mapper from arguments is executed once the context has been restored.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15314 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'toplevel')
-rw-r--r--toplevel/toploop.ml5
1 files changed, 4 insertions, 1 deletions
diff --git a/toplevel/toploop.ml b/toplevel/toploop.ml
index cf62137c2..220d75967 100644
--- a/toplevel/toploop.ml
+++ b/toplevel/toploop.ml
@@ -327,7 +327,10 @@ let phrase ppf phr =
let phr =
match phr with
| Ptop_def str ->
- Ptop_def (Pparse.apply_rewriters ~tool_name:"ocaml" ast_impl_magic_number str)
+ let str =
+ Pparse.apply_rewriters_str ~restore:true ~tool_name:"ocaml" str
+ in
+ Ptop_def str
| phr -> phr
in
if !Clflags.dump_parsetree then Printast.top_phrase ppf phr;