From: Kevin Brown Date: Fri, 8 May 2020 23:18:38 +0000 (-0400) Subject: Add support for optional ":" at end of line statement X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9174140c79fd73356500f60dc5e33e0c5b996416;p=thirdparty%2Fjinja.git Add support for optional ":" at end of line statement This does not fully work for the example file because the grammar for a test expression can span multiple lines which causes the HTML in the line following the block expression to be detected as a test expression instead of being detected as content. --- diff --git a/tatsu_grammar.txt b/tatsu_grammar.txt index ba9122d4..3aa9e05a 100644 --- a/tatsu_grammar.txt +++ b/tatsu_grammar.txt @@ -70,7 +70,7 @@ line_block_expression line_block_start = - line_block_open type:`blockstart` !("end") name:IDENTIFIER {SP}* parameters:[ block_parameters ] { !"\n" SP }* ":\n" + line_block_open type:`blockstart` !("end") name:IDENTIFIER {SP}* parameters:[ line_block_parameters ] { !"\n" SP }* [ ":" { !"\n" SP }* ] "\n" ; line_block_end @@ -83,6 +83,11 @@ line_block_open "\n" {SP}* @:"# " {SP}* ; +line_block_parameters + = + @+:block_parameter { { !"\n" SP }* @+:block_parameter }* + ; + implicit_identifier_tuple = tuple+:IDENTIFIER { {SP}* "," {SP}* tuple+:IDENTIFIER }+