diff --git a/hornbeam_grammar/src/hornbeam.pest b/hornbeam_grammar/src/hornbeam.pest index 3cd06ec..cb8ac5f 100644 --- a/hornbeam_grammar/src/hornbeam.pest +++ b/hornbeam_grammar/src/hornbeam.pest @@ -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 }