The Trunk: Traits-nice.298.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Traits-nice.298.mcz

commits-2
Nicolas Cellier uploaded a new version of Traits to project The Trunk:
http://source.squeak.org/trunk/Traits-nice.298.mcz

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

Name: Traits-nice.298
Author: nice
Time: 20 September 2013, 1:03:19.14 am
UUID: 4d949a9d-99e3-4511-9fd0-805df6f747ca
Ancestors: Traits-fbs.297

If you just need the parameter names, then just ask for the parameter names.
Asking for parameter and temp names, then throwing the temps away sounds like not using the right API in the right place...

=============== Diff against Traits-fbs.297 ===============

Item was changed:
  ----- Method: ClassDescription>>replaceSelector:withAlias:in: (in category '*Traits-NanoKernel') -----
  replaceSelector: originalSelector withAlias: aliasSelector in: source
  "replaces originalSelector with aliasSelector in in given source code"
  | oldKeywords newKeywords args selectorWithArgs s |
  oldKeywords := originalSelector keywords.
  newKeywords := aliasSelector keywords.
  oldKeywords size = newKeywords size ifFalse:[self error: 'Keyword mismatch'].
+ args := self newParser parseParameterNames: source asString.
- args := (self newParser parseArgsAndTemps: source asString notifying: nil)
- copyFrom: 1 to: originalSelector numArgs.
  selectorWithArgs := String streamContents: [:stream |
  newKeywords keysAndValuesDo: [:index :keyword |
  stream nextPutAll: keyword.
  stream space.
  args size >= index ifTrue: [
  stream nextPutAll: (args at: index); space]]].
  s := source asString readStream.
  oldKeywords do: [ :each | s match: each ].
  args isEmpty ifFalse: [ s match: args last ].
  ^selectorWithArgs withBlanksTrimmed asText , s upToEnd
  !