The Trunk: Tools-cmm.647.mcz

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

The Trunk: Tools-cmm.647.mcz

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

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

Name: Tools-cmm.647
Author: cmm
Time: 10 November 2015, 10:57:40.093 am
UUID: 41a53017-5459-4126-a74f-d65917846dac
Ancestors: Tools-mt.646

When accepting a method, assign its category to that of the last-selected method (now being overtyped) instead of "as yet unclassified."

=============== Diff against Tools-mt.646 ===============

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 selector category oldMessageList |
  selectedMessageName := self selectedMessageName.
  oldMessageList := self messageList.
+ selectedClassOrMetaClass := self selectedClassOrMetaClass.
  contents := nil.
+ selector := (selectedClassOrMetaClass newParser parseSelector: aString).
- selector := (self selectedClassOrMetaClass newParser parseSelector: aString).
  (self metaClassIndicated
+ and: [(selectedClassOrMetaClass includesSelector: selector) not
- and: [(self 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]].
+ selector := selectedClassOrMetaClass
- selector := self selectedClassOrMetaClass
  compile: aString
+ classified: (category := (selectedClassOrMetaClass >> selectedMessageName) methodReference category)
- classified: (category := self selectedMessageCategoryName)
  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!