|
@@ -1336,21 +1336,14 @@ for_loop_ast(IteratorList, LoopValue, IsReversed, Contents,
|
|
|
|
|
|
{ParentLoop, TreeWalker3} = resolve_reserved_variable('forloop', TreeWalker2),
|
|
|
|
|
|
- %% call for loop (wrapped in a fun to contain the variable L)
|
|
|
- {{?Q(["fun() ->",
|
|
|
- " case erlydtl_runtime:forloop(",
|
|
|
- " fun (_@Vars, _@Counters) ->",
|
|
|
- " {_@IteratorVars} = if is_tuple(_@Vars), size(_@Vars) == _@IteratorCount@ -> _@Vars;",
|
|
|
- " _@___ifclauses -> _",
|
|
|
- " end,",
|
|
|
- " {_@LoopBodyAst, erlydtl_runtime:increment_counter_stats(_@Counters)}",
|
|
|
- " end,",
|
|
|
- " _@LoopValueAst0, _@ParentLoop)",
|
|
|
- " of",
|
|
|
- " empty -> _@EmptyContentsAst;",
|
|
|
- " {L, _} -> L",
|
|
|
- " end",
|
|
|
- "end()"],
|
|
|
+ {{?Q(["erlydtl_runtime:forloop(",
|
|
|
+ " fun (_@Vars, _@Counters) ->",
|
|
|
+ " {_@IteratorVars} = if is_tuple(_@Vars), size(_@Vars) == _@IteratorCount@ -> _@Vars;",
|
|
|
+ " _@___ifclauses -> _",
|
|
|
+ " end,",
|
|
|
+ " {_@LoopBodyAst, erlydtl_runtime:increment_counter_stats(_@Counters)}",
|
|
|
+ " end,",
|
|
|
+ " _@LoopValueAst0, _@ParentLoop, _@EmptyContentsAst)"],
|
|
|
[{ifclauses, if IteratorCount > 1 ->
|
|
|
?Q(["() when is_list(_@Vars), length(_@Vars) == _@IteratorCount@ ->",
|
|
|
" list_to_tuple(_@Vars);",
|