Levente Uzonyi uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-topa.246.mcz ==================== Summary ==================== Name: Tools-topa.246 Author: topa Time: 14 July 2010, 5:31:19.972 pm UUID: 8d12ad18-0b3c-46bd-becc-8ca3344ad715 Ancestors: Tools-cmm.245 There is a check for possibly corrupt sources when viewing a message. Now, this allows for different parser classes for the selected class used in the metaclass and the non-metaclass. =============== Diff against Tools-cmm.245 =============== Item was added: + ----- Method: CodeHolder>>informPossiblyCorruptSource (in category 'misc') ----- + informPossiblyCorruptSource + + | sourcesName | + sourcesName := FileDirectory localNameFor: SmalltalkImage current sourcesName. + self inform: 'There may be a problem with your sources file!! + + The source code for every method should (usually) start with the + method selector but this is not the case with this method!! You may + proceed with caution but it is recommended that you get a new source file. + + This can happen if you download the "' , sourcesName , '" file, + or the ".changes" file you use, as TEXT. It must be transfered + in BINARY mode, even if it looks like a text file, + to preserve the CR line ends. + + Mac users: This may have been caused by Stuffit Expander. + To prevent the files above to be converted to Mac line ends + when they are expanded, do this: Start the program, then + from Preferences... in the File menu, choose the Cross + Platform panel, then select "Never" and press OK. + Then expand the compressed archive again. + + (Occasionally, the source code for a method may legitimately + start with a non-alphabetic character -- for example, Behavior + method #formalHeaderPartsFor:. In such rare cases, you can + happily disregard this warning.)'! Item was added: + ----- Method: CodeHolder>>validateMessageSource:forSelector:inClass: (in category 'message list') ----- + validateMessageSource: sourceString forSelector: aSelector inClass: theClass + "Check whether there is evidence that method source is invalid" + + (theClass parserClass new parseSelector: sourceString asString) = aSelector + ifFalse: [self informPossiblyCorruptSource].! Item was changed: ----- Method: CodeHolder>>sourceStringPrettifiedAndDiffed (in category 'message list') ----- sourceStringPrettifiedAndDiffed "Answer a copy of the source code for the selected message, transformed by diffing and pretty-printing exigencies" | class selector sourceString | class := self selectedClassOrMetaClass. selector := self selectedMessageName. (class isNil or: [selector isNil]) ifTrue: [^'missing']. sourceString := class ultimateSourceCodeAt: selector ifAbsent: [^'error']. + self validateMessageSource: sourceString forSelector: selector inClass: class. - self validateMessageSource: sourceString forSelector: selector. (#(#prettyPrint #prettyDiffs) includes: contentsSymbol) ifTrue: [sourceString := class prettyPrinterClass format: sourceString in: class notifying: nil]. self showingAnyKindOfDiffs ifTrue: [sourceString := self diffFromPriorSourceFor: sourceString]. ^sourceString! Item was removed: - ----- Method: CodeHolder>>validateMessageSource:forSelector: (in category 'message list') ----- - validateMessageSource: sourceString forSelector: aSelector - "Check whether there is evidence that method source is invalid" - - | sourcesName | - (self selectedClass parserClass new parseSelector: sourceString asString) = aSelector - ifFalse: [sourcesName := FileDirectory localNameFor: SmalltalkImage current sourcesName. - self inform: 'There may be a problem with your sources file!! - - The source code for every method should (usually) start with the - method selector but this is not the case with this method!! You may - proceed with caution but it is recommended that you get a new source file. - - This can happen if you download the "' , sourcesName , '" file, - or the ".changes" file you use, as TEXT. It must be transfered - in BINARY mode, even if it looks like a text file, - to preserve the CR line ends. - - Mac users: This may have been caused by Stuffit Expander. - To prevent the files above to be converted to Mac line ends - when they are expanded, do this: Start the program, then - from Preferences... in the File menu, choose the Cross - Platform panel, then select "Never" and press OK. - Then expand the compressed archive again. - - (Occasionally, the source code for a method may legitimately - start with a non-alphabetic character -- for example, Behavior - method #formalHeaderPartsFor:. In such rare cases, you can - happily disregard this warning.)'].! |
Free forum by Nabble | Edit this page |