| parseTree resultNode searchTree |
parseTree := RBParser parseMethod: 'renderContentOn: aRenderer
������ aRenderer div id: ''id1'';
������ ������ with: [
������ ������ ������ aRenderer div
������ ������ ������ ������ ������ id: ''idInner1'';
������ ������ ������ ������ ������ render: ''text1'' ].'.
������ ������ ������ ������
searchTree := RBParser parseExpression: 'aRenderer div
������ ������ ������ ������ ������ id: ''idInner1'';
������ ������ ������ ������ ������ render: ''text1''.'.
������ ������
resultNode := ( RBParseTreeSearcher new
������ matchesTree: searchTree
������ do: [ :aNode :answer | aNode parent ] ) executeTree: parseTree.
resultNode addNode: (RBParser parseExpression: 'envelopes := nil').
parseTree formattedCode.
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 context: http://forum.world.st/Adding-a-statement-programmatically-tp4454447p4454447.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.