| 1 |
From Ltac2 Require Import Ltac2. |
| 2 |
|
| 3 |
(* true and false are valid constructors even though they are lowercase *) |
| 4 |
Ltac2 Eval true. |
| 5 |
Ltac2 Eval false. |
| 6 |
|
| 7 |
(* Otherwise constructors have to be Uppercase *) |
| 8 |
Ltac2 Type good_constructor := [Uppercased]. |
| 9 |
Ltac2 Type good_constructors := [Uppercased1 | Uppercased2]. |
| 10 |
|
| 11 |
Ltac2 Eval Uppercased2. |
| 12 |
|
| 13 |
Fail Ltac2 Type bad_constructor := [ notUppercased ]. |
| 14 |
Fail Ltac2 Type bad_constructors := [ | notUppercased1 | notUppercased2 ]. |
| 15 |
|
| 16 |
Fail Ltac2 Eval notUppercased2. |
| 17 |
|
| 18 |
(* And the same for open types*) |
| 19 |
Ltac2 Type open_type := [ .. ]. |
| 20 |
Fail Ltac2 Type open_type ::= [ notUppercased3 ]. |
| 21 |
Ltac2 Type open_type ::= [ Uppercased3 ]. |
| 22 |
|
| 23 |
Fail Ltac2 Eval notUppercased3. |
| 24 |
Ltac2 Eval Uppercased3. |
| 25 |
|
| 26 |
Fail Ltac2 Type foo ::= [ | bar1 | bar2 ]. |