Change all foreach loops in Soy templates to use the for loop syntax

This also updates to a newer version of Closure Rules and fixes a protobuf dep
compile issue.

Full description of the change:

Soy supports 2 kinds of loops:
* foreach- for iterating over items in a collection, e.g.
  {foreach $item in $list}...{/foreach}
* for - for indexed iteration, e.g. {for $i in range(0, 10)}...{/for}

The reason Soy has two different loops is an accident of history; Soy didn’t use
to have a proper grammar for expressions and so the alternate ‘for...range’
syntax was added to make it possible to write indexed loops.  As the grammar has
improved having the two syntaxes is no longer necessary and so we are
eliminating one of them.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182843207
This commit is contained in:
mcilwain 2018-01-22 15:07:04 -08:00 committed by jianglai
parent 81dc2bbbc3
commit b5fb62c984
23 changed files with 105 additions and 106 deletions

View file

@ -48,9 +48,9 @@
{/if}
<contact:addr>
{if $street}
{foreach $s in $street}
{for $s in $street}
<contact:street>{$s}</contact:street>
{/foreach}
{/for}
{/if}
{if $city}
<contact:city>{$city}</contact:city>