[squeak-dev] The Inbox: Compiler-BD.408.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Jul 19 08:11:36 UTC 2019

A new version of Compiler was added to project The Inbox:

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

Name: Compiler-BD.408
Author: BD
Time: 19 July 2019, 10:11:34.88827 am
UUID: ff185a05-5998-470c-bc24-bd56be3159b2
Ancestors: Compiler-ct.407

Replace the code duplication from xLetter which was the same as the step method.
This is done in order to allow customization of the step method without having to modify both places. All other methods already use the explicit step method.
"open code step for speed" no longer applies anyways as a method call is fast enough nowadays.

=============== Diff against Compiler-ct.407 ===============

Item was changed:
  ----- Method: Scanner>>xLetter (in category 'multi-character scans') -----
  	"Form a word or keyword."
  	| type |
  	buffer reset.
  	[(type := self typeTableAt: hereChar) == #xLetter
  		or: [type == #xDigit
  		or: [type == #xUnderscore and:[self allowUnderscoreSelectors]]]] whileTrue:
+ 			[buffer nextPut: self step].
- 			["open code step for speed"
- 			buffer nextPut: hereChar.
- 			hereChar := aheadChar.
- 			aheadChar := source atEnd
- 							ifTrue: [DoItCharacter]
- 							ifFalse: [source next]].
  	tokenType := (type == #xColon and: [aheadChar ~~ $=])
  						[buffer nextPut: self step.
  						"Allow any number of embedded colons in literal symbols"
  						[(self typeTableAt: hereChar) == #xColon] whileTrue:
  							[buffer nextPut: self step].
  	token := buffer contents!

More information about the Squeak-dev mailing list