[squeak-dev] The Trunk: Tools-ul.386.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Dec 6 14:47:57 UTC 2011


Levente Uzonyi uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-ul.386.mcz

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

Name: Tools-ul.386
Author: ul
Time: 6 December 2011, 3:47:09.09 pm
UUID: fc4b47c7-76fd-ec44-8007-2dd1fa8f227e
Ancestors: Tools-ul.385

Fix for http://bugs.squeak.org/view.php?id=7678 .

=============== Diff against Tools-ul.385 ===============

Item was changed:
  ----- Method: SelectorBrowser>>quickList (in category 'as yet unclassified') -----
  quickList
  	"Compute the selectors for the single example of receiver and args, in the very top pane" 
  
  	| data result resultArray dataStrings mf dataObjects aa statements |
+ 	data := contents asString withBlanksTrimmed.
- 	data := contents asString.
- 	"delete t
-  railing period. This should be fixed in the Parser!!"
-  	[data last isSeparator] whileTrue: [data := data allButLast]. 
- 	data last = $. ifTrue: [data := data allButLast]. 	"Eval"
  	mf := MethodFinder new.
  	data := mf cleanInputs: data.	"remove common mistakes"
  	dataObjects := Compiler evaluate: '{', data, '}'. "#( data1 data2 result )"
  	statements := (Compiler new parse: 'zort ' , data in: Object notifying: nil)
  				body statements select: [:each | (each isKindOf: ReturnNode) not].
   	dataStrings := statements collect:
  				[:node | String streamContents:
  					[:strm | (node isMessage) ifTrue: [strm nextPut: $(].
  					node shortPrintOn: strm.
  					(node isMessage) ifTrue: [strm nextPut: $)].]].
  	dataObjects size < 2 ifTrue: [self inform: 'If you are giving an example of receiver, \args, and result, please put periods between the parts.\Otherwise just type one selector fragment' withCRs. ^#()].
   	dataObjects := Array with: dataObjects allButLast with: dataObjects last. "#( (data1
    data2) result )" 
  	result := mf load: dataObjects; findMessage.
  	(result first beginsWith: 'no single method') ifFalse: [
  		aa := self testObjects: dataObjects strings: dataStrings.
  		dataObjects := aa second.  dataStrings := aa third].
  	resultArray := self listFromResult: result. 
  	resultArray isEmpty ifTrue: [self inform: result first].
  
  	dataStrings size = (dataObjects first size + 1) ifTrue:
  		[resultArray := resultArray collect: [:expression | | newExp |
  		newExp := expression.
  		dataObjects first withIndexDo: [:lit :i |
  			newExp := newExp copyReplaceAll: 'data', i printString
  							with: (dataStrings at: i)].
  		newExp, ' --> ', dataStrings last]].
  
   	^ resultArray!




More information about the Squeak-dev mailing list