[Pkg] SystemEditor: SystemEditor-mtf.110.mcz
squeaksource-noreply at iam.unibe.ch
squeaksource-noreply at iam.unibe.ch
Tue Jul 22 19:40:04 UTC 2008
A new version of SystemEditor was added to project SystemEditor:
http://www.squeaksource.com/SystemEditor/SystemEditor-mtf.110.mcz
==================== Summary ====================
Name: SystemEditor-mtf.110
Author: mtf
Time: 22 July 2008, 12:39:31 pm
UUID: fc4653c8-9bf5-4566-bfe9-ac5f2164c863
Ancestors: SystemEditor-mtf.109
- Fixed a bug: the metaclass superclass was not being set to the superclass metaclass
- simplified instSize and allInstVarNames, and format in both ClassEditor and MetaclassEditor
=============== Diff against SystemEditor-mtf.109 ===============
Item was added:
+ ----- Method: MetaclassEditor>>indexIfCompact (in category 'reflecting') -----
+ indexIfCompact
+ self subject ifNotNil: [^ self subject indexIfCompact].
+ ^ 0!
Item was added:
+ ----- Method: MetaclassEditor>>edClassFormat (in category 'building') -----
+ edClassFormat
+ ^ ClassFormat
+ size: self instSize
+ type: self typeOfClass
+ index: self indexIfCompact!
Item was changed:
----- Method: ClassEditor>>edName:superclassEditor:type:instVarString:classVarString:poolImports:category: (in category 'building') -----
edName: aSymbol superclassEditor: anEditor type: typeOfClass instVarString: instString classVarString: classString poolImports: poolString category: catString
| scanner |
scanner := Scanner new.
name := aSymbol.
+ self superclass: anEditor.
- superEditor := anEditor.
type := typeOfClass.
category := catString.
instVarNames := scanner scanFieldNames: instString.
classVarNames := scanner scanFieldNames: classString.
sharedPools := (scanner scanFieldNames: poolString)
collect: [:ea | system edResolve: ea asSymbol]!
Item was changed:
----- Method: MetaclassEditor>>instSize (in category 'reflecting') -----
instSize
"Override the implemenation in Behavior, so that when inspecting the
ClassEditor, it will look like a regular Class"
self isDebuggingAsEditor ifTrue: [^ super instSize].
+ ^ self instVarNames size + (self edSuperclass
+ ifNil: [0] ifNotNilDo: [:ed | ed instSize])!
- ^ self allInstVarNames size!
Item was changed:
----- Method: MetaclassEditor>>format (in category 'reflecting') -----
format
"Override the implemenation in Behavior. That will return the format of ClassEditor,
but we want the format of the subject's meta class"
+ ^ self edClassFormat bits!
- | superFormat |
- superFormat := ClassFormat fromBits: self edSuperclass format.
- ^ (superFormat namedSubclass: self instVarNames size) bits!
Item was changed:
----- Method: ClassEditor>>superclass: (in category 'editing') -----
superclass: aClassOrEditor
+ superEditor := self system edEditorFor: aClassOrEditor.
+ self class superclass: superEditor class
+ !
- superEditor := (aClassOrEditor isKindOf: ClassEditor)
- ifTrue: [aClassOrEditor]
- ifFalse: [ (ClassEditor on: aClassOrEditor for: system) edRegisterEditor]!
Item was changed:
----- Method: ClassEditor>>instSize (in category 'reflecting') -----
instSize
+ ^ self instVarNames size + (self edSuperclass
- ^ self instVarNames size + (self edSuperEditor
ifNil: [0] ifNotNilDo: [:ed | ed instSize])!
Item was changed:
----- Method: ClassEditor>>edBuild (in category 'building') -----
edBuild
| meta |
meta := self class edBuild.
product := subject ifNil: [meta new]
ifNotNil: [meta adoptInstance: subject from: subject class].
product
superclass: self edSuperclass;
setFormat: self format;
setName: self name;
setInstVarNames: self instVarNames;
classPoolFrom: self;
instVarNamed: #sharedPools put: self sharedPools;
organization: self organization build.
product methodDictionary: MethodDictionary new.
- product class methodDictionary: MethodDictionary new.
self decoratorsDo: [:ea | ea buildFor: self].
"Class methods should be compiled before instance methods,
since #compilerClass may be among the class methods"
self class methods buildFor: self class.
self methods buildFor: self.
^product!
Item was changed:
----- Method: MetaclassEditor>>allInstVarNames (in category 'reflecting') -----
allInstVarNames
"specialized in order to enable debugger to show as self"
- | vars |
self isDebuggingAsEditor ifTrue: [^ super allInstVarNames].
+ ^ self edSuperEditor
+ ifNil: [self instVarNames copy]
+ ifNotNil: [self edSuperEditor allInstVarNames, self instVarNames]!
-
- vars := self subject ifNil: [ #() ] ifNotNil: [ self instVarNames ].
-
- ^ superclass == nil
- ifTrue: [ vars copy] "Guarantee a copy is answered."
- ifFalse: [ self superclass allInstVarNames , vars ].
- !
Item was changed:
----- Method: MetaclassEditor>>edSuperclass (in category 'building') -----
edSuperclass
^ superEditor
ifNil: [self subject superclass]
+ ifNotNil: [superEditor product]!
- ifNotNil: [superEditor subject]!
Item was added:
+ ----- Method: MetaclassEditor>>typeOfClass (in category 'reflecting') -----
+ typeOfClass
+ ^ #normal!
More information about the Packages
mailing list