Add multi-line comment support to parser
Copied this straight from Pest itself so must be right 😅 https://github.com/pest-parser/pest/pull/332/files Tested against ``` /* 1-line multiline comment */ /* N-line multiline comment */ /* // Line comment inside multiline /* (Multiline inside) multiline */ */ ``` Testing steps - * `cargo build` * `make run` * `scripts/local-run` with above inputs Fixes #57
This commit is contained in:
parent
9011cc0c30
commit
86b7f7d6f4
|
@ -44,4 +44,5 @@ STRV = @{ "''" | (!"'" ~ ANY)* }
|
|||
COMMA = @{ "," }
|
||||
|
||||
WHITESPACE = _{ (" " | NEWLINE) }
|
||||
COMMENT = _{ "//" ~ (!NEWLINE ~ ANY)* }
|
||||
BLOCK_COMMENT = _{ "/*" ~ (BLOCK_COMMENT | !"*/" ~ ANY)* ~ "*/" }
|
||||
COMMENT = _{ BLOCK_COMMENT | ("//" ~ (!NEWLINE ~ ANY)*) }
|
||||
|
|
Loading…
Reference in New Issue