Andreas Raab uploaded a new version of ShoutCore to project The Trunk:
http://source.squeak.org/trunk/ShoutCore-kb.11.mcz ==================== Summary ==================== Name: ShoutCore-kb.11 Author: kb Time: 26 February 2010, 3:38:22.84 pm UUID: 75d5d7b6-a9fb-429c-8e34-d0087d609d3a Ancestors: ShoutCore-kb.10 Adapted monticello's snapshot and patch browser shout styling from ShoutMonticello.1-tween.2 =============== Diff against ShoutCore-kb.9 =============== Item was added: + ----- Method: MCSnapshotBrowser>>hasBindingThatBeginsWith: (in category '*ShoutCore') ----- + hasBindingThatBeginsWith: aString + + ^false! Item was added: + ----- Method: SHMCClassDefinition>>bindingOf: (in category 'act like environment') ----- + bindingOf: aSymbol + | binding | + (binding := Smalltalk bindingOf: aSymbol) + ifNotNil: [^binding]. + items do:[:each | + (each isClassDefinition and: [each className = aSymbol]) + ifTrue:[^aSymbol -> each]]. + ^nil! Item was added: + ----- Method: SHMCClassDefinition>>classPool (in category 'act like a class') ----- + classPool + | d | + d := Dictionary new. + classDefinition classVarNames do:[:each | + d at: each put: nil]. + ^d! Item was added: + ----- Method: SHMCClassDefinition>>sharedPools (in category 'act like a class') ----- + sharedPools + | d | + d := Set new. + classDefinition poolDictionaries do:[:each | + d add: [Smalltalk at: each asSymbol ifAbsent:[nil]] ]. + ^d! Item was added: + ----- Method: SHMCClassDefinition>>items: (in category 'accessing') ----- + items: anObject + items := anObject! Item was added: + ----- Method: MCSnapshotBrowser>>bindingOf: (in category '*ShoutCore') ----- + bindingOf: aSymbol + + (Smalltalk bindingOf: aSymbol) ifNotNil: [ :binding | ^binding ]. + items do: [ :each | + (each isClassDefinition and: [ + each className = aSymbol ]) ifTrue: [ ^aSymbol -> each ] ]. + ^nil! Item was added: + ----- Method: SHMCClassDefinition>>environment (in category 'act like a class') ----- + environment + ^self! Item was added: + ----- Method: MCSnapshotBrowser>>aboutToStyle: (in category '*ShoutCore') ----- + aboutToStyle: aStyler + + | classDefinition shouldStyle | + classSelection ifNil: [ ^false ]. + self switchIsComment ifTrue: [ ^false ]. + methodSelection + ifNotNil: [ + classDefinition := items + detect: [:ea | + ea isClassDefinition and: [ ea className = classSelection ] ] + ifNone: [ + (Smalltalk at: classSelection ifAbsent: [ Object ]) asClassDefinition ]. + shouldStyle := true ] + ifNil: [ + classDefinition := nil. + shouldStyle := categorySelection ~= self extensionsCategory ]. + aStyler + environment: self; + classOrMetaClass: (classDefinition ifNotNil: [ + SHMCClassDefinition + classDefinition: classDefinition + items: items + meta: switch = #class ]). + ^shouldStyle! Item was added: + ----- Method: SHMCClassDefinition>>classDefinition: (in category 'accessing') ----- + classDefinition: aMCClassDefinition + classDefinition := aMCClassDefinition! Item was added: + ----- Method: SHMCClassDefinition>>allInstVarNames (in category 'accessing') ----- + allInstVarNames + | superclassOrDef answer classOrDef instVars| + + answer := meta + ifTrue:[classDefinition classInstVarNames asArray] + ifFalse:[ classDefinition instVarNames asArray]. + classOrDef := classDefinition. + [superclassOrDef := (classOrDef isKindOf: MCClassDefinition) + ifTrue:[ |s| + s := classOrDef superclassName. + items + detect: [:ea | ea isClassDefinition and: [ea className = s]] + ifNone: [Smalltalk at: s asSymbol ifAbsent:[nil]]] + ifFalse:[ | sc | + sc := classOrDef superclass. + sc ifNotNil:[ + items + detect: [:ea | ea isClassDefinition and: [ea className = sc name asString]] + ifNone: [sc] ]]. + superclassOrDef isNil + ] whileFalse:[ + instVars := (superclassOrDef isKindOf: MCClassDefinition) + ifTrue:[ + meta + ifTrue:[superclassOrDef classInstVarNames] + ifFalse:[superclassOrDef instVarNames]] + ifFalse:["real" + meta + ifTrue:[superclassOrDef theNonMetaClass class instVarNames] + ifFalse:[superclassOrDef theNonMetaClass instVarNames]]. + answer := answer, instVars. + classOrDef := superclassOrDef]. + ^answer! Item was added: + ----- Method: SHMCClassDefinition classSide>>classDefinition:items:meta: (in category 'as yet unclassified') ----- + classDefinition: aMCClassDefinition items: anObject meta: aBoolean + ^self new + classDefinition: aMCClassDefinition; + items: anObject; + meta: aBoolean; + yourself! Item was added: + ----- Method: SHMCClassDefinition>>shoutParserClass (in category 'accessing') ----- + shoutParserClass + "Answer the parser class" + ^SHParserST80! Item was added: + ----- Method: MCPatchBrowser>>aboutToStyle: (in category '*ShoutCore') ----- + aboutToStyle: aStyler + + selection ifNotNil: [ + selection isConflict ifTrue: [ ^false ]. + (selection isAddition or: [ selection isRemoval ]) ifTrue: [ + selection definition isOrganizationDefinition ifTrue: [ ^false ]. + aStyler classOrMetaClass: self selectedClassOrMetaClass. + ^true ] ]. + ^false! Item was added: + ----- Method: SHMCClassDefinition>>withAllSuperclasses (in category 'accessing') ----- + withAllSuperclasses + | superclassOrDef answer classOrDef | + + answer := Array with: self. + classOrDef := classDefinition. + [superclassOrDef := (classOrDef isKindOf: MCClassDefinition) + ifTrue:[ |s| + s := classOrDef superclassName. + items + detect: [:ea | ea isClassDefinition and: [ea className = s]] + ifNone: [Smalltalk at: s asSymbol ifAbsent:[nil]]] + ifFalse:[ | sc | + sc := classOrDef superclass. + sc ifNotNil:[ + items + detect: [:ea | ea isClassDefinition and: [ea className = sc name asString]] + ifNone: [sc] ]]. + superclassOrDef isNil + ] whileFalse:[ + answer := answer, (Array with: superclassOrDef). + classOrDef := superclassOrDef]. + ^answer! Item was changed: SystemOrganization addCategory: #'ShoutCore-Parsing'! SystemOrganization addCategory: #'ShoutCore-Styling'! + SystemOrganization addCategory: #'ShoutCore-Monticello'! Item was added: + ----- Method: SHMCClassDefinition>>theNonMetaClass (in category 'act like a class') ----- + theNonMetaClass + ^self copy meta: false; yourself! Item was added: + ----- Method: SHMCClassDefinition>>hasBindingThatBeginsWith: (in category 'act like environment') ----- + hasBindingThatBeginsWith: aString + + (Smalltalk hasBindingThatBeginsWith: aString) ifTrue: [^true]. + items do:[:each | + (each isClassDefinition and: [each className beginsWith: aString]) + ifTrue:[^true]]. + ^false! Item was added: + ----- Method: SHMCClassDefinition>>meta: (in category 'accessing') ----- + meta: aBoolean + meta := aBoolean! Item was added: + Object subclass: #SHMCClassDefinition + instanceVariableNames: 'classDefinition items meta' + classVariableNames: '' + poolDictionaries: '' + category: 'ShoutCore-Monticello'! |
Free forum by Nabble | Edit this page |