From 1604a0c87b138529d2d2f31af5bb233e5edc952b Mon Sep 17 00:00:00 2001 From: Kevin Brown Date: Fri, 8 May 2020 05:43:51 -0400 Subject: [PATCH] Use variable names in content definition This should make it easier later to override these variables without needing to make additional changes. --- tatsu_grammar.txt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tatsu_grammar.txt b/tatsu_grammar.txt index e0e4912a..c3b9a0f3 100644 --- a/tatsu_grammar.txt +++ b/tatsu_grammar.txt @@ -16,14 +16,19 @@ expression raw_block_expression = - "{% raw %}" + raw_block_start { !raw_block_end CHAR }* raw_block_end ; +raw_block_start + = + block_open "raw" block_close + ; + raw_block_end = - "{% endraw %}" + block_open "endraw" block_close ; block_expression @@ -82,12 +87,12 @@ filter = @+:IDENTIFIER [@+:filter_parameters]; filter_parameters = "(" [@+:filter_parameter {"," {SP}* @+:filter_parameter}*] ")"; filter_parameter = {!"," !")" CHAR}* ; -comment_expression = comment_open comment comment_close ; +comment_expression = comment_open comment_content comment_close ; comment_open = "{#" ; comment_close = "#}" ; -comment = {!comment_close CHAR}* ; +comment_content = {!comment_close CHAR}* ; -content = !("{%" | "{{" | "{#") CHAR ; +content = !(block_open | variable_open | comment_open) CHAR ; IDENTIFIER = -- 2.47.3