[squeak-dev] The Trunk: Compiler-tpr.486.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Jan 16 00:27:53 UTC 2023


tim Rowledge uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-tpr.486.mcz

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

Name: Compiler-tpr.486
Author: tpr
Time: 15 January 2023, 4:27:50.519001 pm
UUID: 13fe3f29-8bcb-4c2f-b6cb-6c85cd980a3a
Ancestors: Compiler-eem.485

Remove a variable shadowing from Parser>>#collectTemporaryDeclarationsFrom:
It is possible that a better solution would be to simply remove the | mark | declaration that creates the shadowing and to use the Parser instance variable named 'mark'.

=============== Diff against Compiler-eem.485 ===============

Item was changed:
  ----- Method: Parser>>collectTemporaryDeclarationsFrom: (in category 'error correction') -----
  collectTemporaryDeclarationsFrom: methodNode
  	| tempsMarks str |
  	tempsMarks := OrderedCollection new.
  	str := cue requestor text asString.
  	methodNode accept: (ParseNodeEnumerator
  		ofBlock: [ :aNode | 
+ 			| thisTempMark |
- 			| mark |
  			(aNode class canUnderstand: #tempsMark) 
  				ifTrue: 
+ 					[thisTempMark := aNode tempsMark.
+ 					(thisTempMark notNil and: [ thisTempMark between: 1 and: str size ] and: [ (str at: thisTempMark) = $| ])
- 					[mark := aNode tempsMark.
- 					(mark notNil and: [ mark between: 1 and: str size ] and: [ (str at: mark) = $| ])
  						ifTrue: [ tempsMarks addLast: aNode ]]]).
  	(tempsMark notNil and: [ tempsMark between: 1 and: str size ] and: [ (str at: tempsMark) = $| ])
  						ifTrue: [ tempsMarks addLast: self ].
  	^ tempsMarks sorted: [ :a :b | a tempsMark > b tempsMark ]!



More information about the Squeak-dev mailing list