You might want to try and pretty print the complete image and see if you loose any comments or if comments are moved at the wrong place.
>From within a green browser press "refactor > pretty print" and get a coffee (it takes a long time). Note that you might want to disable pretty-printing in the refactoring changes. The diff looks better with pretty printing enabled, but then this is not what you get afterwards. Lukas 2009/11/22 Schwab,Wilhelm K <[email protected]>: > If anyone builds this, I can easily clone one of my images and give it > torture test with comments littering method bodies. If it can keep the "data > collector" code in tact, it works. > > Bill > > > > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of Nicolas > Cellier > Sent: Sunday, November 22, 2009 9:56 AM > To: [email protected] > Subject: Re: [Pharo-project] (no subject) > > Without looking at RB code, this is how I would handle it: > 1) Reify Smalltalk tokens, and create a SpaceToken (can include various > separators character and comments) > the tokens just include a copy of corresponding source text. > 2) Scanner creates a linked list of tokens including SpaceTokens > 3) Parser parses the stream of tokens and build an AST that retain pointers > to the links (firstLink and lastLink) > The advantage of storing links rather than position is that we can > add/remove links easily without recomputing positions > 4) refactoring operates on AST and replaces links content, > eventually if it add or remove links, then some special care of intersticial > SpaceToken has to happen. > 5) printing refactored source code is printing the tokens verbatim (that is > just nextPutAll: their contents) > > Nicolas > > 2009/11/22 Lukas Renggli <[email protected]>: >>> at one point gwenael changed the parser to handle comments but >>> apparently the code could not be loaded and it was never integrated. I >>> imagine that now it is too divergent. >> >> The code never worked for me. It broke most parts of the Refactoring Engine. >> >> The new code is a fresh port from John's repository. There existing >> port was a total mess, partly broken, partly incomplete, very >> inefficient and polluted with code from other projects. >> >> Lukas >> >> -- >> Lukas Renggli >> http://www.lukas-renggli.ch >> >> _______________________________________________ >> Pharo-project mailing list >> [email protected] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> > > _______________________________________________ > Pharo-project mailing list > [email protected] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > > _______________________________________________ > Pharo-project mailing list > [email protected] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > -- Lukas Renggli http://www.lukas-renggli.ch _______________________________________________ Pharo-project mailing list [email protected] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
