[squeak-dev] The Trunk: Tools-cmm.652.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Nov 16 06:07:15 UTC 2015


Chris Muller uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-cmm.652.mcz

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

Name: Tools-cmm.652
Author: cmm
Time: 16 November 2015, 12:06:46.092 am
UUID: 9911b7d5-97f5-403d-b9bd-10f71d9c99dc
Ancestors: Tools-mt.651

- Assign the selected category if no prior method was selected.

=============== Diff against Tools-mt.651 ===============

Item was changed:
  ----- Method: Browser>>defineMessageFrom:notifying: (in category 'message functions') -----
  defineMessageFrom: aString notifying: aController
  	"Compile the expressions in aString. Notify aController if a syntax error occurs. Install the compiled method in the selected class classified under  the currently selected message category name. Answer the selector obtained if compilation succeeds, nil otherwise."
  	| selectedMessageName selector category oldMessageList selectedClassOrMetaClass |
  	selectedMessageName := self selectedMessageName.
  	oldMessageList := self messageList.
  	selectedClassOrMetaClass := self selectedClassOrMetaClass.
  	contents := nil.
  	selector := (selectedClassOrMetaClass newParser parseSelector: aString).
  	(self metaClassIndicated
  		and: [(selectedClassOrMetaClass includesSelector: selector) not
  		and: [Metaclass isScarySelector: selector]])
  		ifTrue: ["A frist-time definition overlaps the protocol of Metaclasses"
  				(self confirm: ((selector , ' is used in the existing class system.
  Overriding it could cause serious problems.
  Is this really what you want to do?') asText makeBoldFrom: 1 to: selector size))
  				ifFalse: [^nil]].
+ 	category := selectedMessageName
+ 		ifNil: [ self selectedMessageCategoryName ]
+ 		ifNotNil: [ (selectedClassOrMetaClass >> selectedMessageName) methodReference ifNotNil: [ : ref | ref category ]].
  	selector := selectedClassOrMetaClass
  				compile: aString
+ 				classified: category
- 				classified: (selectedMessageName ifNotNil: [category := (selectedClassOrMetaClass >> selectedMessageName) methodReference ifNotNil: [ : ref | ref category ]])
  				notifying: aController.
  	selector == nil ifTrue: [^ nil].
  	contents := aString copy.
  	selector ~~ selectedMessageName
  		ifTrue: 
  			[category = ClassOrganizer nullCategory
  				ifTrue: [self changed: #classSelectionChanged.
  						self changed: #classList.
  						self messageCategoryListIndex: 1].
  			self setClassOrganizer.  "In case organization not cached"
  			(oldMessageList includes: selector)
  				ifFalse: [self changed: #messageList].
  			self messageListIndex: (self messageList indexOf: selector)].
  	^ selector!



More information about the Squeak-dev mailing list