Allow kebab case identifiers (i.e. identifiers with `-`)

Signed-off-by: Olivier <olivier@librepush.net>
This commit is contained in:
Olivier 'reivilibre' 2024-06-19 23:51:15 +01:00
parent b7818dddc1
commit cdc34d45f7
1 changed files with 3 additions and 1 deletions

View File

@ -198,7 +198,9 @@ bracketedTerm = _{ "(" ~ Expr ~ ")" }
IntLiteral = @{ (ASCII_NONZERO_DIGIT ~ ASCII_DIGIT+ | ASCII_DIGIT) }
Identifier = { (ASCII_ALPHA | "_") ~ (ASCII_ALPHANUMERIC | "_")* }
// `-` is important in identifiers for `kebab-case` HTML element attributes
// We could consider splitting this out into its own kind of identifier but let's not bother now.
Identifier = { (ASCII_ALPHA | "_") ~ (ASCII_ALPHANUMERIC | "_" | "-")* }
commaSeparatedExprs = _{ wsnl* ~ (Expr ~ wsnl* ~ ("," ~ wsnl* ~ Expr ~ wsnl*)* ~ ("," ~ wsnl*)?)? }
FunctionCall = { Identifier ~ "(" ~ commaSeparatedExprs ~ ")" }
Variable = { "$" ~ Identifier }