[squeak-dev] The Inbox: Compiler-cmm.185.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Jan 13 02:48:26 UTC 2011


A new version of Compiler was added to project The Inbox:
http://source.squeak.org/inbox/Compiler-cmm.185.mcz

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

Name: Compiler-cmm.185
Author: cmm
Time: 12 January 2011, 8:48:16.196 pm
UUID: 8aa7ae35-517f-4922-950c-0b88c9a33ec7
Ancestors: Compiler-nice.184

Fix multiplying comments on pretty-print.

=============== Diff against Compiler-nice.184 ===============

Item was changed:
  ----- Method: Parser>>statements:innerBlock:blockNode: (in category 'expression types') -----
  statements: argNodes innerBlock: inner blockNode: theBlockNode
  
  	| stmts returns start |
  	"give initial comment to block, since others trail statements"
  	theBlockNode comment: currentComment.
  	stmts := OrderedCollection new.
  	returns := false.
  	hereType ~~ #rightBracket ifTrue:
  		[[theBlockNode startOfLastStatement: (start := self startOfNextToken).
  		  (returns := self matchReturn)
  			ifTrue: 
  				[self expression ifFalse:
  					[^self expected: 'Expression to return'].
  				 self addComment.
  				 stmts addLast: (parseNode isReturningIf
  								ifTrue: [parseNode]
  								ifFalse: [ReturnNode new
  											expr: parseNode
  											encoder: encoder
  											sourceRange: (start to: self endOfLastToken)])]
  			ifFalse: 
  				[self expression
  					ifTrue: 
+ 						[currentComment := nil..
- 						[self addComment.
  						 stmts addLast: parseNode]
  					ifFalse: 
  						[self addComment.
  						 stmts size = 0 ifTrue: 
  							[stmts addLast: 
  								(encoder encodeVariable:
  									(inner ifTrue: ['nil'] ifFalse: ['self']))]]].
  		  returns ifTrue: 
  			[self match: #period.
  			 (hereType == #rightBracket or: [hereType == #doIt]) ifFalse:
  				[^self expected: 'End of block']].
  		  returns not and: [self match: #period]] whileTrue].
  	theBlockNode
  		arguments: argNodes
  		statements: stmts
  		returns: returns
  		from: encoder.
  	parseNode := theBlockNode.
  	^true!




More information about the Squeak-dev mailing list