VSEFileSourceWriter.st
changeset 3911 f89a36b30e5e
parent 3886 a5b2ba4eafa3
child 3912 9919eaafa258
equal deleted inserted replaced
3907:2d10ee6c6f08 3911:f89a36b30e5e
   424 
   424 
   425     source := newSource.
   425     source := newSource.
   426 !
   426 !
   427 
   427 
   428 rewriteEOLComments
   428 rewriteEOLComments
   429     |tree parser eolComments|
   429     |tree parser eolComments xlatedComment newSource|
   430 
   430 
   431     parser := Parser new.
   431     parser := Parser new.
   432     parser foldConstants:false.
   432     parser foldConstants:false.
   433     parser saveComments:true.
   433     parser saveComments:true.
   434     parser parseMethod:source in:methodClass ignoreErrors:true ignoreWarnings:true.
   434     parser parseMethod:source in:methodClass ignoreErrors:true ignoreWarnings:true.
   443 
   443 
   444         eolComments reverseDo:[:each |
   444         eolComments reverseDo:[:each |
   445             (source at:each endPosition) = $" ifTrue:[
   445             (source at:each endPosition) = $" ifTrue:[
   446                 "/ nothing to do...
   446                 "/ nothing to do...
   447             ] ifFalse:[
   447             ] ifFalse:[
   448                 source := (source copyTo:(each endPosition)),'"',(source copyFrom:(each endPosition + 1))
   448                 xlatedComment := source copyFrom:(each startPosition+2) to:each endPosition.
       
   449                 (xlatedComment includes:$") ifTrue:[
       
   450                     "/ self halt.
       
   451                     xlatedComment := xlatedComment copyReplaceAll:$" with:$'.
       
   452                 ].
       
   453                 newSource := source copyTo:(each startPosition-1).
       
   454                 newSource := newSource,'"',xlatedComment,'"'.
       
   455                 newSource := newSource,(source copyFrom:(each endPosition + 1)).
       
   456                 source := newSource.
   449             ].
   457             ].
   450         ].
   458         ].
   451 
   459 
   452         "/ to verify, check parsability    
   460         "/ to verify, check parsability    
   453         RBParser 
   461         RBParser 
   631 
   639 
   632     (source includesString:'thisContext') ifFalse:[
   640     (source includesString:'thisContext') ifFalse:[
   633         ^ self
   641         ^ self
   634     ].
   642     ].
   635 
   643 
   636     self halt.
   644     "/ self halt.
   637 
   645 
   638     parser := Parser new. 
   646     parser := Parser new. 
   639     parser foldConstants:false.
   647     parser foldConstants:false.
   640     parser
   648     parser
   641         parseMethod:source 
   649         parseMethod:source