[Newcompiler] Changing just a part of a method

Marcus Denker denker at iam.unibe.ch
Mon Jul 30 12:27:34 UTC 2007


On 27.07.2007, at 21:05, Mathieu Suen wrote:

> Yes even so how would you do to kept the indentation when you are  
> changing  the AST.
> I have roughly think about it and couldn't figure out how to do it.
>

The RB today flushes all the formatting information as soon as it  
does any change...
This is clearly not needed. We should try to do better...

An interesting idea that Martin v. Loewis had was that we can even  
get the formatting
for new (or changed) code from the formatting of the  
ParseTreeRewriter input.

> 	Mth
>
>
>
> On Jul 27, 2007, at 8:58 PM, Stéphane Ducasse wrote:
>
>> I have doubts that RB... maintain information about the nodes so  
>> that you will not lose the formatting.
>>
>> stef
>>
>> On 27 juil. 07, at 14:27, Damien Cassou wrote:
>>
>>> Hi,
>>>
>>> is it possible to rewrite only a small part of a method without
>>> reindenting everything? I'm using ParseTreeRewriter to change code
>>> from
>>>
>>> 'ReadStream on: ``@Expression'
>>>
>>> to
>>>
>>> '``@Expression readStream'
>>>
>>>
>>> However, when I compile the new tree back, all the indentation is
>>> changed, all $_ are converted to :=...
>>>
>>> When I then browse the changes with Monticello, the change I made is
>>> not clear because it's lost in the other changes.
>>>
>>> Is there any solution?
>>>
>>> -- 
>>> Damien Cassou
>>
>
>
> 	
>
> 	
> 		
> ______________________________________________________________________ 
> _____
> Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et  
> son interface révolutionnaire.
> http://fr.mail.yahoo.com

	Marcus
--
Marcus Denker  --  denker at iam.unibe.ch
http://www.iam.unibe.ch/~denker





More information about the Newcompiler mailing list