--- a/SourceCodeManagerUtilities.st Wed Sep 23 14:31:14 2009 +0200
+++ b/SourceCodeManagerUtilities.st Wed Sep 23 15:14:05 2009 +0200
@@ -2948,6 +2948,7 @@
] ifFalse:[
initialLogStream
print: (selectors size);
+ print: ' methods';
cr.
].
].
@@ -2988,30 +2989,31 @@
modifiedSelectors notEmpty ifTrue:[
selectorsWithCommentOrFormattingChangeOnly := Set new.
selectorsWithVariableChangeOnly := Set new.
-
- modifiedSelectors do:[:eachSelector |
- |oldest newest oldMethod newMethod oldTree newTree variableMapping|
-
- (newSelectors includes:eachSelector) ifFalse:[
- oldest := allMethodChangesForThisClass detect:[:change | change changeSelector = eachSelector].
- newest := allMethodChangesForThisClass detectLast:[:change | change changeSelector = eachSelector].
-
- oldMethod := oldest previousVersion notNil ifTrue:[oldest previousVersion] ifFalse:[oldest changeMethod].
- newMethod := newest changeMethod.
-
- oldTree := oldMethod parseTree.
- newTree := newMethod parseTree.
-
- variableMapping := Dictionary new.
- (oldTree equalTo:newTree withMapping: variableMapping) ifTrue:[
- (variableMapping at:'self' ifAbsent:nil) = 'self' ifTrue:[
- ((variableMapping associations count:[:assoc | assoc key ~= assoc value]) == 0) ifTrue:[
- selectorsWithCommentOrFormattingChangeOnly add:eachSelector.
- ] ifFalse:[
- selectorsWithVariableChangeOnly add:eachSelector.
+ RBParser notNil ifTrue:[
+ modifiedSelectors do:[:eachSelector |
+ |oldest newest oldMethod newMethod oldTree newTree variableMapping|
+
+ (newSelectors includes:eachSelector) ifFalse:[
+ oldest := allMethodChangesForThisClass detect:[:change | change changeSelector = eachSelector].
+ newest := allMethodChangesForThisClass detectLast:[:change | change changeSelector = eachSelector].
+
+ oldest := oldest previousVersion notNil ifTrue:[oldest previousVersion] ifFalse:[oldest].
+
+ oldTree := RBParser parseMethod:oldest source onError:[:aString :pos | nil].
+ newTree := RBParser parseMethod:newest source onError:[:aString :pos | nil].
+ (oldTree notNil and:[newTree notNil]) ifTrue:[
+ variableMapping := Dictionary new.
+ (oldTree equalTo:newTree withMapping: variableMapping) ifTrue:[
+ (variableMapping at:'self' ifAbsent:nil) = 'self' ifTrue:[
+ ((variableMapping associations count:[:assoc | assoc key ~= assoc value]) == 0) ifTrue:[
+ selectorsWithCommentOrFormattingChangeOnly add:eachSelector.
+ ] ifFalse:[
+ selectorsWithVariableChangeOnly add:eachSelector.
+ ].
+ ].
].
].
- ].
+ ]
].
].
modifiedSelectors removeAllFoundIn:selectorsWithCommentOrFormattingChangeOnly.
@@ -3083,5 +3085,5 @@
!SourceCodeManagerUtilities class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.186 2009-09-22 19:44:23 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.187 2009-09-23 13:14:05 sr Exp $'
! !