[Pharo-dev] AST node replacement API

2017-01-23 Thread Yuriy Tymchuk
Hi everyone, does anyone have a better knowledge about replacing nodes in AST? Because what I saw is that there are methods like replaceSourceWith: that can be sent to an AST node with another AST node as a parameter. But this is not enough to get a new source code. Because when you ask the AST

Re: [Pharo-dev] AST node replacement API

2017-01-23 Thread Nicolai Hess
2017-01-23 14:48 GMT+01:00 Yuriy Tymchuk : > Hi everyone, > > does anyone have a better knowledge about replacing nodes in AST? Because > what I saw is that there are methods like replaceSourceWith: that can be > sent to an AST node with another AST node as a parameter. But this is not > enough to

Re: [Pharo-dev] AST node replacement API

2017-01-23 Thread John Brant
On 01/23/2017 07:48 AM, Yuriy Tymchuk wrote: Hi everyone, does anyone have a better knowledge about replacing nodes in AST? Because what I saw is that there are methods like replaceSourceWith: that can be sent to an AST node with another AST node as a parameter. But this is not enough to get

Re: [Pharo-dev] AST node replacement API

2017-01-23 Thread Yuriy Tymchuk
I think that we hacked too much :). I like how ParsetreeRewriter is working, but I think that it would be nice to have some API to say: ok, I have this node, now I want to replace it (maybe it should generate a new changed tree), so the pattern syntax would be more of a nice interface instead of

Re: [Pharo-dev] AST node replacement API

2017-01-23 Thread John Brant
On 01/23/2017 10:00 AM, Yuriy Tymchuk wrote: I think that we hacked too much :). I like how ParsetreeRewriter is working, but I think that it would be nice to have some API to say: ok, I have this node, now I want to replace it (maybe it should generate a new changed tree), so the pattern synt

Re: [Pharo-dev] AST node replacement API

2017-01-23 Thread Denis Kudriashov
2017-01-23 17:00 GMT+01:00 Yuriy Tymchuk : > I think that we hacked too much :). I like how ParsetreeRewriter is > working, but I think that it would be nice to have some API to say: ok, I > have this node, now I want to replace it (maybe it should generate a new > changed tree), so the pattern sy