The Trunk: Compiler-mt.404.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Compiler-mt.404.mcz

commits-2
Marcel Taeumel uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-mt.404.mcz

==================== 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') -----
  xLetter
  "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 ~~ $=])
  ifTrue:
  [buffer nextPut: self step.
  "Allow any number of embedded colons in literal symbols"
  [(self typeTableAt: hereChar) == #xColon] whileTrue:
  [buffer nextPut: self step].
  #keyword]
  ifFalse:
  [#word].
  token := buffer contents!