forked from mirrors/jj
templater: move whitespace rule out of template node
For the same reason as b2825c22d7
"revset: move whitespace rule out of
expression."
This commit is contained in:
parent
a67fbb6714
commit
8749a325e9
1 changed files with 6 additions and 8 deletions
|
@ -31,15 +31,15 @@ integer_literal = {
|
|||
|
||||
identifier = @{ (ASCII_ALPHA | "_") ~ (ASCII_ALPHANUMERIC | "_")* }
|
||||
|
||||
function = { identifier ~ "(" ~ function_arguments ~ ")" }
|
||||
function = { identifier ~ "(" ~ whitespace* ~ function_arguments ~ whitespace* ~ ")" }
|
||||
function_arguments = {
|
||||
template ~ ("," ~ template)* ~ ("," ~ whitespace*)?
|
||||
| whitespace*
|
||||
template ~ (whitespace* ~ "," ~ whitespace* ~ template)* ~ (whitespace* ~ ",")?
|
||||
| ""
|
||||
}
|
||||
|
||||
// Note that "x(y)" is a function call but "x (y)" concatenates "x" and "y"
|
||||
primary = _{
|
||||
("(" ~ template ~ ")")
|
||||
("(" ~ whitespace* ~ template ~ whitespace* ~ ")")
|
||||
| function
|
||||
| identifier
|
||||
| literal
|
||||
|
@ -54,8 +54,6 @@ list = _{
|
|||
term ~ (whitespace+ ~ term)+
|
||||
}
|
||||
|
||||
template = {
|
||||
whitespace* ~ (list | term) ~ whitespace*
|
||||
}
|
||||
template = { list | term }
|
||||
|
||||
program = _{ SOI ~ (template | whitespace*) ~ EOI }
|
||||
program = _{ SOI ~ whitespace* ~ template? ~ whitespace* ~ EOI }
|
||||
|
|
Loading…
Reference in a new issue