The Trunk: System-nice.199.mcz

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

The Trunk: System-nice.199.mcz

commits-2
Nicolas Cellier uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-nice.199.mcz

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

Name: System-nice.199
Author: nice
Time: 22 December 2009, 12:26:29 pm
UUID: bf4f5175-5630-4008-824a-2abb1a3d9de3
Ancestors: System-jcg.198

Cosmetic changes from Pharo
- use notNil
- use ifAbsentPut:
Cosmetic clean up from me:
- remove misleading (file position: position - 150) when looking at preamble.

=============== Diff against System-jcg.198 ===============

Item was changed:
  ----- Method: ChangeSet class>>scanVersionsOf:class:meta:category:selector: (in category 'scanning') -----
  scanVersionsOf: method class: class meta: meta category: cat selector: selector
  | position prevPos prevFileIndex preamble tokens sourceFilesCopy stamp changeList file |
  changeList := OrderedCollection new.
  position := method filePosition.
  sourceFilesCopy := SourceFiles collect:[:x | x ifNotNil:[x readOnlyCopy]].
  method fileIndex == 0 ifTrue: [^ nil].
  file := sourceFilesCopy at: method fileIndex.
  [position notNil & file notNil] whileTrue:[
- 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.
  ].
  (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.
  ]
  ].
    changeList add: (ChangeRecord new file: file position: position type: #method
  class: class name category: cat meta: meta stamp: stamp).
  position := prevPos.
  prevPos notNil ifTrue:[file := sourceFilesCopy at: prevFileIndex].
  ].
  sourceFilesCopy do: [:x | x ifNotNil:[x close]].
  ^changeList!

Item was changed:
+ ----- Method: ChangeSet class>>superclassOrder: (in category 'filein/out') -----
- ----- Method: ChangeSet class>>superclassOrder: (in category 'fileIn/Out') -----
  superclassOrder: classes
  "Arrange the classes in the collection, classes, in superclass order so the
  classes can be properly filed in. Do it in sets instead of ordered collections.
  SqR 4/12/2000 22:04"
 
  | all list aClass inclusionSet aClassIndex cache |
 
  list := classes copy. "list is indexable"
  inclusionSet := list asSet. cache := Dictionary new.
  all := OrderedCollection new: list size.
  list size timesRepeat:
  [
+ aClassIndex := list findFirst: [:one | one notNil and:
- aClassIndex := list findFirst: [:one | one isNil not and:
  [self doWeFileOut: one given: inclusionSet cache: cache]].
  aClass := list at: aClassIndex.
  all addLast: aClass.
  inclusionSet remove: aClass.
  list at: aClassIndex put: nil
  ].
  ^all!

Item was changed:
  ----- Method: ClassChangeRecord>>findOrMakeMethodChangeAt:priorMethod: (in category 'method changes') -----
+ findOrMakeMethodChangeAt: selector priorMethod: priorMethod
+ ^methodChanges at: selector
+ ifAbsentPut: [MethodChangeRecord new priorMethod: priorMethod]!
- findOrMakeMethodChangeAt: selector priorMethod: priorMethod
-
- ^ methodChanges at: selector
- ifAbsent: [methodChanges at: selector
- put: (MethodChangeRecord new priorMethod: priorMethod)]!