Isn't there a rewrite tool for Squeak?
Cheers!
-Boris (via BlackBerry)
----- Original Message ----- From: squeak-dev-bounces@lists.squeakfoundation.org squeak-dev-bounces@lists.squeakfoundation.org To: The general-purpose Squeak developers list squeak-dev@lists.squeakfoundation.org Sent: Sat Nov 08 09:26:05 2008 Subject: [squeak-dev] Getting rid of Display global
I'd like to ask, is there any ways to automatically replace all references to some global ( Display, for instance) with message send and recompile all modified methods accordingly. In OB i saw some ways to manipulate with code on AST level, where it can clearly tell that Display is global. I tried to do a global text search & replace , but its quite inconvenient, because it still leaves a lot of manual work. The most bigger issues with textual replace is, that if you replace 'Display' with 'self getDisplay' in 'DisplayScreen' , you will get 'self getDisplayScreen' :) It is possible, of course to write a clever regex pattern to avoid such situations, but again, what if i don't want to touch comments?
Another thing is assignment - with AST on hand, it can clearly tell, if you need to replace an assignment with setter message send, while if you doing a textual replace you have to deal with it by writing another regex.
And finally, replacing using AST will guarantee that method will be compiled under any circumstances.
Can anyone tell me, or show some code snippets, how to do this using OB? I found a lot of different refactoring features in OB, but can't find an easy way to do what i need.
2008/11/8 Boris Popov boris@deepcovelabs.com:
Isn't there a rewrite tool for Squeak?
Never heard of it. Have any pointers?
Cheers!
-Boris (via BlackBerry)
squeak-dev@lists.squeakfoundation.org