This is an automated email from the ASF dual-hosted git repository.
ddekany pushed a change to branch 2.3-gae
in repository https://gitbox.apache.org/repos/asf/freemarker.git.
from 8783907 Some code cleanup, mostly around function and macro calls.
Also added generic parameters at some places.
new 7eeeea1 (SequenceIterator to be internally usable on its own)
new 7e4ab15 Added "local lambdas" to parser, which look like Java
lambda-s, but are only allowed as parameters in certain built-ins, as they
can't work outside the variable scope where they were created. To added new
built-ins, ?filter(...) and ?map(...) to try the concept. These can get a
"local lambda", or an #ftl function, or a method as parameter. These built-ins
support the lazy processing of elements when they are the child of an AST node
that explicitly enables that (for now [...]
new 0635b53 Fixed issue with local lambdas and #list: The visibility
scope of loop variables were wider than necessary, which now become visible,
because the lambda applied on the listed value is possibly evaluated lazily
after the nested content of #list was already executed for the first iteration,
and then the lambda saw the loop variables from the previous iteration. As the
lambda expression is outside the nested content of #list, it should never see
the loop variables of the sa [...]
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
src/main/java/freemarker/core/BuiltIn.java | 14 +-
.../freemarker/core/BuiltInForLoopVariable.java | 2 +-
.../core/BuiltInWithParseTimeParameters.java | 21 +-
.../java/freemarker/core/BuiltInsForSequences.java | 345 ++++++++++++++++++++-
.../freemarker/core/CollectionAndSequence.java | 19 --
src/main/java/freemarker/core/Environment.java | 71 +++++
...ression.java => ExpressionWithFixedResult.java} | 77 ++---
src/main/java/freemarker/core/Items.java | 2 +-
src/main/java/freemarker/core/IteratorBlock.java | 231 ++++++++------
.../freemarker/core/LocalLambdaExpression.java | 152 +++++++++
src/main/java/freemarker/core/MethodCall.java | 2 +-
.../java/freemarker/core/NonMethodException.java | 7 +-
src/main/java/freemarker/core/Sep.java | 2 +-
...iltInForSequence.java => SequenceIterator.java} | 31 +-
.../core/SingleIterationCollectionModel.java | 51 +++
src/main/javacc/FTL.jj | 127 +++++++-
src/test/java/freemarker/core/FilterBiTest.java | 142 +++++++++
.../core/ListWithStreamLikeBuiltinsTest.java | 104 +++++++
src/test/java/freemarker/core/MapBiTest.java | 206 ++++++++++++
19 files changed, 1404 insertions(+), 202 deletions(-)
copy src/main/java/freemarker/core/{ExistsExpression.java =>
ExpressionWithFixedResult.java} (50%)
mode change 100755 => 100644
create mode 100644 src/main/java/freemarker/core/LocalLambdaExpression.java
copy src/main/java/freemarker/core/{BuiltInForSequence.java =>
SequenceIterator.java} (64%)
create mode 100644
src/main/java/freemarker/core/SingleIterationCollectionModel.java
create mode 100644 src/test/java/freemarker/core/FilterBiTest.java
create mode 100644
src/test/java/freemarker/core/ListWithStreamLikeBuiltinsTest.java
create mode 100644 src/test/java/freemarker/core/MapBiTest.java