Add comments (to the language)

This commit is contained in:
Emi Simpson 2022-03-10 20:27:59 -05:00
parent efbe872f1e
commit 89c5a6985b
Signed by: Emi
GPG Key ID: A12F2C2FFDC3D847
2 changed files with 7 additions and 0 deletions

View File

@ -1,9 +1,14 @@
// Comment!
type SimpleType type SimpleType
= MyVariant1 = MyVariant1
| MyVariant2 Integer[u32] | MyVariant2 Integer[u32]
| MyVariant3 Integer[1..20] | MyVariant3 Integer[1..20]
| MyVariant4 Integer String | MyVariant4 Integer String
/* Multiline
Comment! */
type Option val type Option val
= Some val = Some val
| None | None

View File

@ -21,6 +21,8 @@ pub enum Token {
#[error] #[error]
#[regex(r"[ \t]+", logos::skip)] #[regex(r"[ \t]+", logos::skip)]
#[regex(r"\n[ \t]+", logos::skip)] #[regex(r"\n[ \t]+", logos::skip)]
#[regex(r"//.+", logos::skip)]
#[regex(r"/\*[.\n]+\*/", logos::skip)]
Error, Error,
/// The `type` keyword /// The `type` keyword