-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
olofk/edalize
#134Description
Look at the following template code:
set_property verilog_define {
{%- for k, v in vlogdefine.items() %}{{ k }}={{ v|param_value_str }} {% endfor -%}
} [get_filesets sources_1]
Up to Jinja2 2.10.3 this would result in something like
set_property verilog_define {vlogdefine_bool=1 vlogdefine_int=42 vlogdefine_str=hello } [get_filesets sources_1]
The code has lstrip_blocks = True
.
Now with 2.11.0 the code is rendered like this:
set_property verilog_define {vlogdefine_bool=1vlogdefine_int=42vlogdefine_str=hello} [get_filesets sources_1]
@towoe bisected the behavior change down to 7d00a40 (by @petee-d in #857)
According to the documentation
lstrip_blocks
If this is set to True leading spaces and tabs are stripped from the start of a line to a block. Defaults to False.
I don't think the whitespace should be removed before the endfor
, since that's not whitespace "from the beginning of the line". Am I misunderstanding that, or does the new version introduce an unexpected change in behavior?
Python 3.7.3 (but also happens on 3.5 in CI)
kenyon