[squeak-dev] can anyone justify the following comment behaviour?

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

[squeak-dev] can anyone justify the following comment behaviour?

Eliot Miranda-2
Hi All,

  in ParseNode>>printCommentOn: there is the most perplexing destructive modification of a comment on printing:

printCommentOn: aStream indent: indent 
        
| thisComment | 
        
self comment == nil ifTrue: [^ self]. 
        
1 to: self comment size 
         
do: [:index | 
                 
index > 1 ifTrue: [aStream crtab: indent]
                 
aStream nextPut: $"
                 
thisComment := self comment at: index
                 
self printSingleComment: thisComment 
                          
on: aStream 
                          
indent: indent
                 
aStream nextPut: $"]. 
 !!     
self comment: nil

  The result is that a parse tree can only be printed once before it prints without comments.  Can anyone justify this?  I would like to remove it; it makes no sense to me.

best
Eliot