google / escapevelocity

A subset reimplementation of Apache Velocity with a much simpler API.
Apache License 2.0
33 stars 11 forks source link

Allow `#foreach (${x} in ...)`. #36

Closed copybara-service[bot] closed 1 year ago

copybara-service[bot] commented 1 year ago

Allow #foreach (${x} in ...).

Previously we only accepted #foreach ($x in ...). Although there's no strong reason to include the braces, Velocity allows it so we do too.

Velocity also accepts #set (${x} = ...) and #macro (name ${x}), but it appears that the variable doesn't actually get set in those cases.

RELNOTES=We now allow both #foreach ($x in ...) and #foreach (${x} in ...).