Allow block comments with /* */ (#421)

This commit is contained in:
Andrew Twyman 2025-09-11 12:17:32 -07:00 committed by GitHub
parent 03db60d94c
commit f95a27b412
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 4 deletions

View file

@ -1,13 +1,15 @@
// Grammar for the "Podlang" language. Used for describing POD2 Custom
// Predicates and Proof Requests.
// Silent rules (`_`) are automatically handled by Pest between other rules.
// Note: Silent rules (`_`) generate no tokens. WHITESPACE and COMMENT are
// special names known to Pest. If defined they are implicitly allowed between
// any others rules.
// WHITESPACE matches one or more spaces, tabs, or newlines.
WHITESPACE = _{ (" " | "\t" | NEWLINE)+ }
// COMMENT matches '//' followed by any characters until the end of the line.
// Also silent.
COMMENT = _{ "//" ~ (!NEWLINE ~ ANY)* }
// COMMENT matches a line comment (//...\n) or block comment (/*...*/).
COMMENT = _{ ("//" ~ (!NEWLINE ~ ANY)* | "/*" ~ (!"*/" ~ ANY)* ~ "*/" ) }
// Define rules for identifiers (predicate names, variable names without '?')
// Must start with alpha or _, followed by alpha, numeric, or _