From 89c5a6985b2a6e451be84e24dedfe2d5760d5bf0 Mon Sep 17 00:00:00 2001 From: Emi Simpson Date: Thu, 10 Mar 2022 20:27:59 -0500 Subject: [PATCH] Add comments (to the language) --- sample.amo | 5 +++++ src/token.rs | 2 ++ 2 files changed, 7 insertions(+) diff --git a/sample.amo b/sample.amo index 7a973d4..92a8d71 100644 --- a/sample.amo +++ b/sample.amo @@ -1,9 +1,14 @@ +// Comment! + type SimpleType = MyVariant1 | MyVariant2 Integer[u32] | MyVariant3 Integer[1..20] | MyVariant4 Integer String +/* Multiline + Comment! */ + type Option val = Some val | None diff --git a/src/token.rs b/src/token.rs index f2abef8..25617e7 100644 --- a/src/token.rs +++ b/src/token.rs @@ -21,6 +21,8 @@ pub enum Token { #[error] #[regex(r"[ \t]+", logos::skip)] #[regex(r"\n[ \t]+", logos::skip)] + #[regex(r"//.+", logos::skip)] + #[regex(r"/\*[.\n]+\*/", logos::skip)] Error, /// The `type` keyword