ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <peterrei...@apache.org>
Subject Re: macro/for fun
Date Mon, 21 Feb 2005 10:46:00 GMT
Matt Benson wrote:

>Anyone from ant-contrib want to add a caveat to the
>documentation of the for task?  Being based on
>macrodefs, for is the only place I know of where this
>comes into play: 
>
Same applies to macros in macros!

> since the @ character is escaped
>with another (@@) in macrodefs/for, nested for loops
>must double-escape the @ character (@@@@).  This
>applies to for loops appearing in macros as well. 
>Looks like the rule is an additional two '@'s per
>nesting level.  So no nesting = @@, one level deep =
>@@@@, and two levels deep = @@@@@@ .
>  
>
No, It is doubling each level:
    <property name="chars" value="a"/>
    <ac:for param="c1" list="${chars}">
      <sequential>
        <ac:for param="c2" list="${chars}">
          <sequential>
            <ac:for param="c3" list="${chars}">
              <sequential>
                <echo>'@@@@@@@@'</echo>
              </sequential>
            </ac:for>
          </sequential>
        </ac:for>
      </sequential>
    </ac:for>

outputs '@'

Actually on testing, it seems that there is a bug with the escaping of
nested @{x}, will investigate further.

Peter

>-Matt
>
>
>		
>__________________________________ 
>Do you Yahoo!? 
>Yahoo! Mail - now with 250MB free storage. Learn more.
>http://info.mail.yahoo.com/mail_250
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>For additional commands, e-mail: dev-help@ant.apache.org
>
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message