Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.872.mcz ==================== Summary ==================== Name: Tools-mt.872 Author: mt Time: 14 August 2019, 10:08:00.084413 am UUID: 65b76512-a570-f34f-98d0-606db67a9b98 Ancestors: Tools-mt.871 Fixes time-profile browser: (1) override the parse-to-class-and-selector method, (2) no label format (for deprecations) if there is no class. =============== Diff against Tools-mt.871 =============== Item was added: + ----- Method: TimeProfileBrowser class>>parse:toClassAndSelector: (in category 'utilities') ----- + parse: aString toClassAndSelector: csBlock + "Try to create a MethodReference from a line returned by MessageTally. Set both class and selector to nil if the string doesn't have the given format." + + | stream className class selector | + stream := aString readStream. + "Skip percentages and timing data." + stream + skipTo: $}; + skipSeparators. + (stream peekFor: $[) ifTrue: [ "Skip block markers." + stream upToAnyOf: CharacterSet separators ]. + className := stream upToAnyOf: '(>'. + + stream atEnd ifTrue: [ ^ csBlock value: nil value: nil ]. + stream last == $( ifTrue: [ "Method is defined in a super class" + className := stream upTo: $). + (stream peekFor: $>) ifFalse: [ ^ csBlock value: nil value: nil ] ]. + (stream peekFor: $>) ifFalse: [ ^ csBlock value: nil value: nil ]. + selector := stream upToEnd. + + self flag: #environments. "missing information about the class environment" + (class := Smalltalk classNamed: className) ifNil: [^ csBlock value: nil value: nil]. + (selector := Symbol lookup: selector) ifNil: [^ csBlock value: nil value: nil]. + ^ csBlock value: class value: selector! Item was added: + ----- Method: TimeProfileBrowser>>formattedLabel:forSelector:inClass: (in category 'as yet unclassified') ----- + formattedLabel: aString forSelector: aSymbol inClass: aClass + + ^ aClass + ifNil: [aString] + ifNotNil: [super formattedLabel: aString forSelector: aSymbol inClass: aClass]! Item was changed: ----- Method: TimeProfileBrowser>>methodReferenceFrom: (in category 'private') ----- methodReferenceFrom: aString - "Try to create a MethodReference from a line returned by MessageTally. Return nil if the string doesn't have the given format." + ^ self class parse: aString toClassAndSelector: [:class :selector | + class ifNotNil: [MethodReference class: class selector: selector]]! - | stream className selector | - stream := aString readStream. - "Skip percentages and timing data." - stream - skipTo: $}; - skipSeparators. - (stream peekFor: $[) ifTrue: [ "Skip block markers." - stream upToAnyOf: CharacterSet separators ]. - className := stream upToAnyOf: '(>'. - stream atEnd ifTrue: [ ^nil ]. - stream last == $( ifTrue: [ "Method is defined in a super class" - className := stream upTo: $). - (stream peekFor: $>) ifFalse: [ ^nil ] ]. - (stream peekFor: $>) ifFalse: [ ^nil ]. - selector := stream upToEnd. - ^MethodReference - class: ((Smalltalk classNamed: className) ifNil: [ ^nil ]) - selector: ((Symbol lookup: selector) ifNil: [ ^nil ])! |
Free forum by Nabble | Edit this page |