[squeak-dev] The Trunk: Collections-nice.934.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Apr 13 14:49:04 UTC 2021


Nicolas Cellier uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-nice.934.mcz

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

Name: Collections-nice.934
Author: nice
Time: 13 April 2021, 4:48:56.45442 pm
UUID: ef1096e7-ebfe-e843-9853-f106df649cf4
Ancestors: Collections-nice.933

Make a Symbol lookup more straightforward.

=============== Diff against Collections-nice.933 ===============

Item was changed:
  ----- Method: TextLink>>validate: (in category 'initialize-release') -----
  validate: specString
  	"Can this string be decoded to be Class space Method (or Comment, Definition, Hierarchy)? If so, return it in valid format, else nil" 
  
  	| list first mid last |
  	list := specString findTokens: ' 	.|'.
  	list isEmpty ifTrue: [ ^nil ].
  	last := list last.
  	last first isUppercase ifTrue: [
  		(#('Comment' 'Definition' 'Hierarchy') includes: last) ifFalse: [^ nil].
  		"Check for 'Rectangle Comment Comment' and remove last one"
  		(list at: list size - 1 ifAbsent: [^nil]) = last ifTrue: [list := list allButLast]].
  	list size > 3 ifTrue: [^ nil].
  	list size < 2 ifTrue: [^ nil].
+ 	first := Symbol lookup: list first.
- 	Symbol hasInterned: list first ifTrue: [:sym | first := sym].
  	first ifNil: [^ nil].
  	Smalltalk at: first ifAbsent: [^ nil].
  	mid := list size = 3 
  		ifTrue: [(list at: 2) = 'class' ifTrue: ['class '] ifFalse: [^ nil]]
  		ifFalse: [''].
  	"OK if method name is not interned -- may not be defined yet"
  	^ first, ' ', mid, last!



More information about the Squeak-dev mailing list