Re: [Pharo-project] Adding a statement programmatically

2012-03-09 Thread HernĂ¡n Morales Durand
| parseTree resultNode searchTree | parseTree := RBParser parseMethod: 'renderContentOn: aRenderer aRenderer div id: ''id1''; with: [ aRenderer div id: ''idInner1''; render: ''text1'' ].'. searchTree := RBParser parseExpression:

Re: [Pharo-project] Adding a statement programmatically

2012-03-08 Thread Noury Bouraqadi
Hi Sean, Did you thought about: -using method wrappers? -object as methods. An object o put in a method dictionary instead of some method with selector #s. When #s is looked up, o receives the message run: selector with: args in: originalReceiver -proxies (look at Ghost) so you

Re: [Pharo-project] Adding a statement programmatically

2012-03-08 Thread Philippe Marschall
On 03/07/2012 09:12 PM, Sean P. DeNigris wrote: What's the easiest way to add a statement to an existing method? In the case I'm thinking about, it's going at the end, so I can cheat and just recompile with the string appended, but I'd like to know how to insert into an arbitrary place in the

Re: [Pharo-project] Adding a statement programmatically

2012-03-08 Thread Marcus Denker
On Mar 8, 2012, at 12:21 PM, Noury Bouraqadi wrote: Hi Sean, Did you thought about: -using method wrappers? -object as methods. An object o put in a method dictionary instead of some method with selector #s. When #s is looked up, o receives the message run: selector with: args

Re: [Pharo-project] Adding a statement programmatically

2012-03-08 Thread Sean P. DeNigris
Marcus Denker-4 wrote - Compile the code to an RB AST, this then has all the interfaces needed to replace nodes or add nodes. You can then pretty print it back to source. Thanks Marcus. That's what I was trying to do. I got the AST and created the node: body :=

Re: [Pharo-project] Adding a statement programmatically

2012-03-08 Thread Norbert Hartl
Am 08.03.2012 um 17:08 schrieb Sean P. DeNigris: Marcus Denker-4 wrote - Compile the code to an RB AST, this then has all the interfaces needed to replace nodes or add nodes. You can then pretty print it back to source. Thanks Marcus. That's what I was trying to do. I got the AST

Re: [Pharo-project] Adding a statement programmatically

2012-03-08 Thread Sean P. DeNigris
Norbert Hartl wrote Try... Thanks Norbert. Same result. -- View this message in context: http://forum.world.st/Adding-a-statement-programmatically-tp4454447p4457352.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.

Re: [Pharo-project] Adding a statement programmatically

2012-03-08 Thread Norbert Hartl
Am 08.03.2012 um 20:05 schrieb Sean P. DeNigris s...@clipperadams.com: Norbert Hartl wrote Try... Thanks Norbert. Same result. Does not work? What do you mean by saying same result? Norbert -- View this message in context:

[Pharo-project] Adding a statement programmatically

2012-03-07 Thread Sean P. DeNigris
What's the easiest way to add a statement to an existing method? In the case I'm thinking about, it's going at the end, so I can cheat and just recompile with the string appended, but I'd like to know how to insert into an arbitrary place in the AST... Thanks. Sean -- View this message in