The Inbox: Compiler-BD.408.mcz

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

The Inbox: Compiler-BD.408.mcz

commits-2
A new version of Compiler was added to project The Inbox:
http://source.squeak.org/inbox/Compiler-BD.408.mcz

==================== 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') -----
  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!