Add comment processing, add a comment to factorial.sy to test it out

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2022-02-11 18:31:12 -08:00
parent 899ceda248
commit b4ae936832
2 changed files with 5 additions and 2 deletions

View File

@@ -1,10 +1,11 @@
WHITESPACE = _{ " " | "\r" | "\t" | "\n" }
newline = _{ "\n" | "\r\n" }
WHITESPACE = _{ newline | " " | "\r" | "\t"}
COMMENT = _{ "#" ~ (!newline ~ ANY)* }
int = @{ ASCII_DIGIT+ }
float = @{ ASCII_DIGIT+ ~ "." ~ ASCII_DIGIT+ ~ ("e" ~ ("+" | "-")? ~ ASCII_DIGIT+)? }
word_char = @{ ASCII_ALPHA | "_" | "?" | "-" | "+" | "*" | "/" | "=" | "@" | "$" | "%" | "^" | "&" | "|" | "~" }
word = @{ word_char+ }
// meta = ${ "%" ~ word }
str = @{
"\"" ~
(