| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
module API = Elpi.API |
| 6 |
open Rocq_elpi_utils |
| 7 |
open Rocq_elpi_HOAS |
| 8 |
open Names |
| 9 |
|
| 10 |
let to_name ~loc src = |
| 11 |
if src = "_" then in_elpiast_name ~loc (EConstr.anonR) |
| 12 |
else in_elpiast_name ~loc (EConstr.nameR (Id.of_string src)) |
| 13 |
|
| 14 |
|
| 15 |
let () = |
| 16 |
let f ~language state loc src = to_name ~loc src in |
| 17 |
let _ = API.Quotation.register_named_quotation ~descriptor:interp_quotations ~name:"name" f in |
| 18 |
let _ = API.Quotation.register_named_quotation ~descriptor:synterp_quotations ~name:"name" f in |
| 19 |
() |
| 20 |
|
| 21 |
let () = |
| 22 |
let f ~language state loc s = |
| 23 |
let src = String.sub s 1 (String.length s - 2) in |
| 24 |
to_name ~loc src in |
| 25 |
let _ = API.Quotation.declare_backtick ~descriptor:interp_quotations ~name:"Name.t" f in |
| 26 |
let _ = API.Quotation.declare_backtick ~descriptor:synterp_quotations ~name:"Name.t" f in |
| 27 |
() |