Browse thread
Camlp4 3.10 - antiquotations in keyword position?
- Aleksey Nogin
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Aleksey Nogin <nogin@m...> |
| Subject: | Camlp4 3.10 - antiquotations in keyword position? |
In 3.09 we used to allow defining "infix" keywords by using
antiquotations in inside the "EXTEND" and "DELETE_RULE" directives as
follows:
--------------------------------------------------------------
(*
* The prefix version of the infix expression
*)
let prefix_name op =
"prefix_" ^ op
(*
* Add an infix keyword.
*)
let add_infix (keyword : string) =
EXTEND
GLOBAL: expr;
expr: LEVEL "expr1"
["expr1" LEFTA
[ e1 = expr; op = $keyword$; e2 = expr ->
<:expr< $lid:prefix_name op$ $e1$ $e2$ >>
]];
END
(*
* Remove the infix keyword.
*)
let remove_infix (keyword : string) =
DELETE_RULE
expr:
expr; $keyword$; expr
END
--------------------------------------------------------------
This does not seem to be supported in 3.10. Is there some other way to
achieve a similar effect in 3.10? Thanks!
Aleksey