Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23189

Jinja2 inline comments

$
0
0

How can I put comments inside Jinja2 argument list declaration ?

Everything I have tried gives an error:jinja2.exceptions.TemplateSyntaxError: unexpected char u'#'

{{ Switch('var',    [('1', 'foo'),    #  comment 1     ('2', 'bar'),    ## comment 2     ('3', 'rum'),    {# comment 3 #}     ]) }}{% macro Switch(var, caselist) %}    {% for case, action in caselist%}        CMP  {{var}} {{case}}         JNE  {{LABEL}}        {{action}}        JMP  {{LABELF}}{{LABEL}}:  NOP    {%- endfor %}{{LABELF}}: NOP{%- endmacro -%}

In my case Jinja2 is used as macro preprocessor for assembler.


Viewing all articles
Browse latest Browse all 23189

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>