ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: svn commit: r703525 - in /ant/sandbox/antlibs/props/trunk/src: main/org/apache/ant/props/NestedPropertyExpander.java tests/antunit/nested-test.xml
Date Fri, 10 Oct 2008 19:24:51 GMT

--- Dominique Devienne <ddevienne@gmail.com> wrote:

> On Fri, Oct 10, 2008 at 12:12 PM, 
> <mbenson@apache.org> wrote:
> > +    <property name="$$" value="$$.value" />
> > +    <au:assertTrue>
> > +      <and>
> > +        <equals arg1="${$$}" arg2="$$.value" />
> 
> This one I get.
> 
> > +        <equals arg1="${$$}" arg2="${$}" />
> 
> OTOH, I don't understand this Matt. Where does the $
> property come
> from? And why is it equal to $$'s value? Thanks,
> --DD

Remember that in Ant we merge any $$ sequence to $ so
that, if need be, the user can specify e.g.
<echo>$${foo}=${foo}</echo> to get (given ${foo} =
"FOO"):

${foo}=FOO

Nested property expansion is handling by resolving
embedded property references inside the ${} sequence. 
$ handling is the province of the PropertyHelper (in
Ant 1.8, its delegates), so property names in a nested
property expression are subject to $$->$ parsing. 
Thus when we say:

<property name="$$" value="$$.value" />

We are actually setting $="$.value" because Ant does
property replacement against all string attributes
when configuring the Java object model.  Now also
remember that a single $ will remain a single $ when
not followed by { ($ and $$ are equivalent), so ${$}
and ${$$} are equivalent and both mean "expansion of
property with key '$'".  Does that make sense?

-Matt 

> 
> > +      </and>
> > +    </au:assertTrue>
> > +  </target>
> 
>
---------------------------------------------------------------------
> 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