groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paolo Di Tommaso <paolo.ditomm...@gmail.com>
Subject Re: Transform a Gstring to a lazy Gstring
Date Mon, 14 Sep 2015 09:22:49 GMT
Hi Shil,

Thanks for sharing, however I've solved this in a similar manner months
ago. I used a ClassCodeVisitorSupport instead of a
ClassCodeExpressionTransform as in your case

https://github.com/nextflow-io/nextflow/blob/master/src/main/groovy/nextflow/ast/NextflowDSLImpl.groovy#L819-L896


Cheers,
Paolo


On Sun, Sep 13, 2015 at 1:02 AM, Shil Sinha <shil.sinha@gmail.com> wrote:

> Hi Paolo,
>
> I worked on this a while ago but my implementation had a bug that wasn't
> immediately obvious to me. I gave it another shot today and got it to work
> -
> https://github.com/shils/groovy-exp/blob/master/src/main/groovy/internal/transform/LazyGStringASTTransformation.groovy
>
> Shil
>
> On Wed, May 13, 2015 at 6:34 PM, Paolo Di Tommaso <
> paolo.ditommaso@gmail.com> wrote:
>
>> Hi,
>>
>> Does anybody have a suggestion how to write an AST transformation to
>> convert any Gstring to a lazy Gstring?
>>
>> For example, given:
>>
>> "$foo and ${bar +2}"
>>
>>
>> I would have it transformed to
>>
>> "${-> foo} and ${-> bar +2}"
>>
>>
>>
>> Any idea?
>>
>>
>> Cheers,
>> Paolo
>>
>>
>>
>
>

Mime
View raw message