From: Kevin Brown Date: Fri, 15 May 2020 22:03:35 +0000 (-0400) Subject: Fix grammar parsing for block separators X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9bb793c19011c4ca898fac7e82d81dba5e30e117;p=thirdparty%2Fjinja.git Fix grammar parsing for block separators Previously this allows blocks to be separated by commas and have one trailing off. Now this only allows blocks to be properly separated by commas and trailing comms are no longer allowed. This also now enforces that when parameters are not separated by commas, they are spearated by at least one space. --- diff --git a/grammar.ebnf b/grammar.ebnf index 127f5675..b1e2295d 100644 --- a/grammar.ebnf +++ b/grammar.ebnf @@ -126,14 +126,18 @@ implicit_identifier_tuple block_parameters = @+:block_parameter - [ {SP}* "," ] { - {SP}* + block_parameter_separator @+:block_parameter - [ {SP}* "," ] }* ; +block_parameter_separator + = + | ( {SP}* "," {SP}* ) + | ( {SP}+ ) + ; + block_parameter = | block_parameter_key_value