| 1 |
(************************************************************************) |
| 2 |
(* * The Rocq Prover / The Rocq Development Team *) |
| 3 |
(* v * Copyright INRIA, CNRS and contributors *) |
| 4 |
(* <O___,, * (see version control and CREDITS file for authors & dates) *) |
| 5 |
(* \VV/ **************************************************************) |
| 6 |
(* // * This file is distributed under the terms of the *) |
| 7 |
(* * GNU Lesser General Public License Version 2.1 *) |
| 8 |
(* * (see LICENSE file for the text of the license) *) |
| 9 |
(************************************************************************) |
| 10 |
|
| 11 |
DECLARE PLUGIN "rocq-runtime.plugins.ltac2_ltac1" |
| 12 |
|
| 13 |
{ |
| 14 |
|
| 15 |
open Procq.Prim |
| 16 |
open Ltac2_plugin |
| 17 |
open Tac2expr |
| 18 |
open Ltac_plugin |
| 19 |
open Ltac2_plugin.G_ltac2 |
| 20 |
|
| 21 |
let ltac_expr = Pltac.ltac_expr |
| 22 |
|
| 23 |
let inj_wit wit loc x = CAst.make ~loc @@ CTacExt (wit, x) |
| 24 |
|
| 25 |
let inj_ltac1 loc e = inj_wit Tac2quote_ltac1.wit_ltac1 loc e |
| 26 |
let inj_ltac1val loc e = inj_wit Tac2quote_ltac1.wit_ltac1val loc e |
| 27 |
|
| 28 |
} |
| 29 |
|
| 30 |
GRAMMAR EXTEND Gram |
| 31 |
GLOBAL: ltac2_atom; |
| 32 |
ltac2_atom: TOP |
| 33 |
[ [ IDENT "ltac1"; ":"; "("; qid = ltac1_expr_in_env; ")" -> { inj_ltac1 loc qid } |
| 34 |
| IDENT "ltac1val"; ":"; "("; qid = ltac1_expr_in_env; ")" -> { inj_ltac1val loc qid } ] ] |
| 35 |
; |
| 36 |
ltac1_expr_in_env: |
| 37 |
[ [ test_ltac1_env; ids = LIST0 identref; "|-"; e = ltac_expr -> { ids, e } |
| 38 |
| e = ltac_expr -> { [], e } |
| 39 |
] ] |
| 40 |
; |
| 41 |
END |