[squeak-dev] The Trunk: Compiler-mt.404.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Jul 22 06:40:20 UTC 2019

Marcel Taeumel uploaded a new version of Compiler to project The Trunk:

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

Name: Compiler-mt.404
Author: mt
Time: 22 July 2019, 8:40:19.7179 am
UUID: a82bc364-41dc-4671-94b7-7b4b669f3bd4
Ancestors: Compiler-eem.403

(Extracted from Compiler-BD.408)

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-eem.403 ===============

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