Nicolas Cellier uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-nice.148.mcz ==================== Summary ==================== Name: Tools-nice.148 Author: nice Time: 22 December 2009, 12:32:02 pm UUID: a4cfbd19-55d0-43d1-ae8b-b48e84fe6143 Ancestors: Tools-ul.147 Cosmetic clean up: - remove misleading (file position: position - 150) when looking at preamble. =============== Diff against Tools-ul.147 =============== Item was changed: ----- Method: VersionsBrowser>>scanVersionsOf:class:meta:category:selector: (in category 'init & update') ----- scanVersionsOf: method class: class meta: meta category: category selector: selector | position prevPos prevFileIndex preamble tokens sourceFilesCopy stamp cat | selectorOfMethod := selector. currentCompiledMethod := method. classOfMethod := meta ifTrue: [class class] ifFalse: [class]. cat := category ifNil: ['']. changeList := OrderedCollection new. list := OrderedCollection new. self addedChangeRecord ifNotNil: [ :change | self addItem: change text: ('{1} (in {2})' translated format: { change stamp. change fileName }) ]. listIndex := 0. position := method filePosition. sourceFilesCopy := SourceFiles collect: [:x | x isNil ifTrue: [ nil ] ifFalse: [x readOnlyCopy]]. method fileIndex == 0 ifTrue: [^ nil]. file := sourceFilesCopy at: method fileIndex. [position notNil & file notNil] whileTrue: + [preamble := method getPreambleFrom: file at: (0 max: position - 3). - [file position: (0 max: position-150). "Skip back to before the preamble" - preamble := method getPreambleFrom: file at: (0 max: position - 3). "Preamble is likely a linked method preamble, if we're in a changes file (not the sources file). Try to parse it for prior source position and file index" prevPos := nil. stamp := ''. (preamble findString: 'methodsFor:' startingAt: 1) > 0 ifTrue: [tokens := Scanner new scanTokens: preamble] ifFalse: [tokens := Array new "ie cant be back ref"]. ((tokens size between: 7 and: 8) and: [(tokens at: tokens size-5) = #methodsFor:]) ifTrue: [(tokens at: tokens size-3) = #stamp: ifTrue: ["New format gives change stamp and unified prior pointer" stamp := tokens at: tokens size-2. prevPos := tokens last. prevFileIndex := sourceFilesCopy fileIndexFromSourcePointer: prevPos. prevPos := sourceFilesCopy filePositionFromSourcePointer: prevPos] ifFalse: ["Old format gives no stamp; prior pointer in two parts" prevPos := tokens at: tokens size-2. prevFileIndex := tokens last]. cat := tokens at: tokens size-4. (prevPos = 0 or: [prevFileIndex = 0]) ifTrue: [prevPos := nil]]. ((tokens size between: 5 and: 6) and: [(tokens at: tokens size-3) = #methodsFor:]) ifTrue: [(tokens at: tokens size-1) = #stamp: ifTrue: ["New format gives change stamp and unified prior pointer" stamp := tokens at: tokens size]. cat := tokens at: tokens size-2]. self addItem: (ChangeRecord new file: file position: position type: #method class: class name category: category meta: meta stamp: stamp) text: stamp , ' ' , class name , (meta ifTrue: [' class '] ifFalse: [' ']) , selector, ' {', cat, '}'. position := prevPos. prevPos notNil ifTrue: [file := sourceFilesCopy at: prevFileIndex]]. sourceFilesCopy do: [:x | x notNil ifTrue: [x close]]. listSelections := Array new: list size withAll: false! |
Free forum by Nabble | Edit this page |