[squeak-dev] The Trunk: Kernel-ul.576.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Apr 30 01:49:30 UTC 2011


Levente Uzonyi uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ul.576.mcz

==================== Summary ====================

Name: Kernel-ul.576
Author: ul
Time: 30 April 2011, 3:48:56.834 am
UUID: 46b435fa-0bc5-954d-8b1b-37a9e581c85a
Ancestors: Kernel-ul.574

- documented the issues with Behavior >> #commentsIn:
- remove SortedCollection (mis)usage from #allSubclassesWithLevelDo:startingLevel:

=============== Diff against Kernel-ul.574 ===============

Item was changed:
  ----- Method: Behavior>>allSubclassesWithLevelDo:startingLevel: (in category 'accessing class hierarchy') -----
  allSubclassesWithLevelDo: classAndLevelBlock startingLevel: level 
  	"Walk the tree of subclasses, giving the class and its level"
+ 
- 	| subclassNames |
  	classAndLevelBlock value: self value: level.
  	self == Class ifTrue:  [^ self].  "Don't visit all the metaclasses"
  	"Visit subclasses in alphabetical order"
+ 	self subclasses
+ 		sort: [ :a :b | a name <= b name ];
+ 		do: [ :subclass | 
+ 			subclass
+ 				allSubclassesWithLevelDo: classAndLevelBlock
+ 				startingLevel: level + 1 ]!
- 	subclassNames := SortedCollection new.
- 	self subclassesDo: [:subC | subclassNames add: subC name].
- 	subclassNames do:
- 		[:name | (self environment at: name)
- 			allSubclassesWithLevelDo: classAndLevelBlock
- 			startingLevel: level+1]!

Item was changed:
  ----- Method: Behavior>>commentsIn: (in category 'accessing method dictionary') -----
  commentsIn: sourceString
+ 	"Return the comments as a collection of strings in sourceString. This method along with #nextQuotePosIn:startingFrom: is wrong, because it assumes that all double quote characters are comment delimiters, but even this method has a double quote which is not part of any method comment. Also this method has nothing to do with the Behavior itself. Probably CompiledMethod is the best place for this."
- 
  	
  	| commentStart nextQuotePos someComments aPos |
+ 	(sourceString includes: $") ifFalse: [^#()].
- 	('*"*' match: sourceString) ifFalse: [^#()].
  	someComments:= OrderedCollection new.
- 	sourceString size = 0 ifTrue: [^ someComments].
  	aPos:=1.
  	nextQuotePos:= 0.
  	[commentStart := sourceString findString: '"' startingAt: aPos.
  	nextQuotePos:= self nextQuotePosIn: sourceString startingFrom: commentStart.
  	(commentStart ~= 0 and: [nextQuotePos >commentStart])] whileTrue: [
  		commentStart ~= nextQuotePos ifTrue: [
  			someComments add: ((sourceString copyFrom: commentStart + 1 to: nextQuotePos - 1) copyReplaceAll: '""' with: '"').].
  	aPos := nextQuotePos+1].
  	^someComments!




More information about the Squeak-dev mailing list