[Pkg] The Trunk: Tools-ul.365.mcz
commits at source.squeak.org
commits at source.squeak.org
Sat Jul 9 14:21:06 UTC 2011
Levente Uzonyi uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-ul.365.mcz
==================== Summary ====================
Name: Tools-ul.365
Author: ul
Time: 9 July 2011, 4:20:52.211 pm
UUID: 624e76fc-7a58-c94c-b93a-d33754c3371e
Ancestors: Tools-fbs.364
A bit faster and cleaner MessageNames >> #computeSelectorListFromSearchString.
=============== Diff against Tools-fbs.364 ===============
Item was changed:
----- Method: MessageNames>>computeSelectorListFromSearchString (in category 'search') -----
computeSelectorListFromSearchString
+ "Compute selector list from search string. The searchString is a list of expressions separated by ;. Each expression is matched individually. An expression can be a simple string (same as *expression*), a string with double quotes (exact match) or a match expression (see String >> #match:)."
+
- "Compute selector list from search string"
searchString := searchString asString copyWithout: $ . "?dubious?"
+ ^selectorList := Cursor wait showWhile: [
+ (Array streamContents: [ :stream |
+ (searchString findBetweenSubStrs: ';') do: [ :selPat |
+ (selPat first = $" and: [ selPat last = $" and: [ selPat size > 2 ] ])
+ ifTrue: [
+ Symbol
+ hasInterned: (selPat copyFrom: 2 to: selPat size - 1)
+ ifTrue: [ :sym | stream nextPut: sym ] ]
+ ifFalse: [
+ | raw n m |
+ n := selPat occurrencesOf: $*.
+ m := selPat occurrencesOf: $#.
+ raw := ((n > 0 or: [ m > 0 ]) and: [ selPat size > (n + m) ])
+ ifTrue: [ Symbol selectorsMatching: selPat ]
+ ifFalse: [ Symbol selectorsContaining: selPat ].
+ stream nextPutAll: raw ] ] ])
+ sort: [ :x :y | x caseInsensitiveLessOrEqual: y ] ]!
- selectorList := Cursor wait showWhile:
- [| sorted |
- sorted := SortedCollection sortBlock: [:x :y | x asLowercase <= y asLowercase].
- (searchString findBetweenSubStrs: ';') do:
- [:selPat| | raw n m |
- selPat size > 0 ifTrue:
- [(selPat first = $" and: [selPat last = $" and: [selPat size > 2]])
- ifTrue:
- [Symbol hasInterned: (selPat copyFrom: 2 to: selPat size - 1) ifTrue: [:sym| sorted add: sym]]
- ifFalse:
- [raw := (((n := selPat occurrencesOf: $*) > 0)
- | ((m := selPat occurrencesOf: $#) > 0)
- and: [selPat size > (n + m)])
- ifTrue: [Symbol selectorsMatching: selPat]
- ifFalse: [Symbol selectorsContaining: selPat].
- sorted addAll: raw]]].
- sorted asArray].
- ^selectorList!
More information about the Packages
mailing list