AST method copyInContext:

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

AST method copyInContext:

Mark Rizun
What is the purpose of the mothod copyInContext: in AST-Core package?

Thanks,
Mark
Reply | Threaded
Open this post in threaded view
|

Re: AST method copyInContext:

Clément Béra
By looking at the senders of #copyInContext:, I believe it is used in RBStringReplaceRule. By looking at this rule class comment, I believe it replaces a matched tree with another tree.

So I guess copyInContext: is used to replace a subtree of the AST by another tree.

Regards,

Clement


2014-06-17 17:06 GMT+02:00 Mark Rizun <[hidden email]>:
What is the purpose of the mothod copyInContext: in AST-Core package?

Thanks,
Mark

Reply | Threaded
Open this post in threaded view
|

Re: AST method copyInContext:

Mark Rizun
I understand that it copies subtree.
I'm interested how it uses its argument aDictionary. Is it Dictionary of Nodes?


2014-06-17 19:28 GMT+03:00 Clément Bera <[hidden email]>:
By looking at the senders of #copyInContext:, I believe it is used in RBStringReplaceRule. By looking at this rule class comment, I believe it replaces a matched tree with another tree.

So I guess copyInContext: is used to replace a subtree of the AST by another tree.

Regards,

Clement


2014-06-17 17:06 GMT+02:00 Mark Rizun <[hidden email]>:

What is the purpose of the mothod copyInContext: in AST-Core package?

Thanks,
Mark


Reply | Threaded
Open this post in threaded view
|

Re: AST method copyInContext:

stepharo

On 17/6/14 18:35, Mark Rizun wrote:
I understand that it copies subtree.
I'm interested how it uses its argument aDictionary. Is it Dictionary of Nodes?

try to put a breakPoint and run the code to see.

Stef


2014-06-17 19:28 GMT+03:00 Clément Bera <[hidden email]>:
By looking at the senders of #copyInContext:, I believe it is used in RBStringReplaceRule. By looking at this rule class comment, I believe it replaces a matched tree with another tree.

So I guess copyInContext: is used to replace a subtree of the AST by another tree.

Regards,

Clement


2014-06-17 17:06 GMT+02:00 Mark Rizun <[hidden email]>:

What is the purpose of the mothod copyInContext: in AST-Core package?

Thanks,
Mark