google / escapevelocity

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

Add support for list and range literals. #19

Closed copybara-service[bot] closed 3 years ago

copybara-service[bot] commented 3 years ago

Add support for list and range literals.

Consistently with Apache Velocity, you can now write a list [1, 2, 3] or ["a", "b", "c"], and you can also write a range [1..100]. These are useful in #foreach, like #foreach ($i in [1..100]), but can also be used in #set, like #set ($list = ["a", "b", "c"]) #foreach ($x in $list).

RELNOTES=Added support for list and range literals, [1, 2, 3] and [1..100].