[squeak-dev] The Inbox: Tools-topa.246.mcz

Tobias Pape Das.Linux at gmx.de
Wed Jul 14 15:38:36 UTC 2010


Hi,

currently I'm working on a setup, where a class
and its metaclass have different parser classes associated.
However, while browsing works fine on the instance side,
it did not work on the class side, because only the parser for 
the class (i.e., for the instance side) was taken into account.
  This upload should fix this. Would any Trunk-commiter please 
accept it? :)

So Long,
	-Tobias

PS: CodeHolder seems to need some refactorings… there are
several methods that send messages that are
  a) not implemented in code holder and
  b) only implemented in some of its subclasses
(e.g., #selectedClassOrMetaClass)


Am 2010-07-14 um 15:31 schrieb commits at source.squeak.org:

> A new version of Tools was added to project The Inbox:
> http://source.squeak.org/inbox/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.)'].!
> 




More information about the Squeak-dev mailing list