David T. Lewis uploaded a new version of Monticello to project The Trunk:
http://source.squeak.org/trunk/Monticello-jr.662.mcz ==================== Summary ==================== Name: Monticello-jr.662 Author: jr Time: 12 February 2017, 4:32:10.446498 pm UUID: 91d400b5-f770-9b4d-ab42-2f06632a0179 Ancestors: Monticello-mva.661 add support for restoring Trait comments from st snapshots Previously, the Trait definition was only treated as doIt in FilePackage and converted to a MCTraitDefinition by MCTraitParser. The latter does not have access to the PseudoClasses of the FilePackage and, thus, could not access the Trait's comment, leaving it empty. System-jr.919 adds PseudoTraits in FilePackage, so a correct conversion into MCTraitDefinitions including the comment is now possible. =============== Diff against Monticello-mva.661 =============== Item was changed: ----- Method: FilePackage>>classDefinition:with: (in category '*monticello') ----- classDefinition: string with: chgRec | tokens theClass | - - self flag: #traits. tokens := Scanner new scanTokens: string. "tokens size = 11 ifFalse:[^doIts add: chgRec]." theClass := self getClass: (tokens at: 3). theClass definition: string. classOrder add: theClass.! Item was added: + ----- Method: FilePackage>>traitDefinition:with: (in category '*monticello') ----- + traitDefinition: string with: chgRec + | tokens theTrait | + tokens := Scanner new scanTokens: string. + theTrait := self getTrait: (tokens at: 3). + theTrait definition: string. + classOrder add: theTrait.! Item was changed: ----- Method: MCStReader>>loadDefinitions (in category 'evaluating') ----- loadDefinitions | filePackage | filePackage := FilePackage new fullName: 'ReadStream'; fileInFrom: self readStream. definitions := OrderedCollection new. filePackage classes do: [:pseudoClass | pseudoClass hasDefinition ifTrue: [definitions add: + (pseudoClass asMCDefinitionBy: self)]. - (self classDefinitionFrom: pseudoClass)]. definitions addAll: (self methodDefinitionsFor: pseudoClass). definitions addAll: (self methodDefinitionsFor: pseudoClass metaClass)]. filePackage doIts do: [:ea | self addDefinitionsFromDoit: ea string]. ! Item was added: + ----- Method: MCStReader>>traitDefinitionFrom: (in category 'as yet unclassified') ----- + traitDefinitionFrom: aPseudoTrait + | tokens traitCompositionString lastIndex | + tokens := Scanner new scanTokens: aPseudoTrait definition. + traitCompositionString := ((ReadStream on: aPseudoTrait definition) + match: 'uses:'; + upToAll: 'category:') withBlanksTrimmed. + traitCompositionString isEmpty ifTrue: [traitCompositionString := '{}']. + lastIndex := tokens size. + ^ MCTraitDefinition + name: (tokens at: 3) + traitComposition: traitCompositionString + category: (tokens at: lastIndex) + comment: (self commentFor: aPseudoTrait) + commentStamp: (self commentStampFor: aPseudoTrait)! Item was added: + ----- Method: PseudoClass>>asMCDefinitionBy: (in category '*monticello') ----- + asMCDefinitionBy: aMCReader + ^ aMCReader classDefinitionFrom: self! Item was added: + ----- Method: PseudoTrait>>asMCDefinitionBy: (in category '*monticello') ----- + asMCDefinitionBy: aMCReader + ^ aMCReader traitDefinitionFrom: self! |
Free forum by Nabble | Edit this page |