These are block expresions but the start/end tags take up an entire
line and are marked by a leading symbol.
\r
expression\r
=\r
- content | raw_block_expression | block_expression | variable_expression | comment_expression\r
+ content | raw_block_expression | block_expression | line_block_expression | variable_expression | comment_expression\r
;\r
\r
raw_block_expression\r
{SP}* @:"%}"\r
;\r
\r
+line_block_expression\r
+ =\r
+ line_block_start\r
+ expressions\r
+ line_block_end\r
+ ;\r
+\r
+line_block_start\r
+ =\r
+ line_block_open type:`blockstart` name:IDENTIFIER parameters:[ { block_parameter }* ] ":\n"\r
+ ;\r
+\r
+line_block_end\r
+ =\r
+ line_block_open type:`blockend` name:IDENTIFIER "\n"\r
+ ;\r
+\r
+line_block_open\r
+ =\r
+ "\n" @:"# " {SP}*\r
+ ;\r
+\r
implicit_identifier_tuple\r
=\r
{SP}* tuple+:IDENTIFIER {SP}* { "," {SP}* tuple+:IDENTIFIER {SP}* }+\r
comment_close = "#}" ;\r
comment_content = {!comment_close CHAR}* ;\r
\r
-content = !(block_open | variable_open | comment_open) CHAR ;\r
+content = !(line_block_open | block_open | variable_open | comment_open) CHAR ;\r
\r
LITERAL\r
=\r
{% macro textarea(name, value='', rows=10, cols=40) %}\r
<textarea name="{{ name }}" rows="{{ rows }}" cols="{{ cols\r
}}">{{ value|e }}</textarea>\r
-{% endmacro %}
\ No newline at end of file
+{% endmacro %}\r
+<ul>\r
+# for href, caption in [('index.html', 'Index'),\r
+ ('about.html', 'About')]:\r
+ <li><a href="{{ href }}">{{ caption }}</a></li>\r
+# endfor\r
+</ul>
\ No newline at end of file