[squeak-dev] The Trunk: Compiler-ul.195.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Mar 14 16:51:20 UTC 2011


Levente Uzonyi uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-ul.195.mcz

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

Name: Compiler-ul.195
Author: ul
Time: 13 March 2011, 8:50:34.098 pm
UUID: 330dc985-d425-1a44-bdda-e67bdb1df894
Ancestors: Compiler-nice.194

- use #== for character comparison, #asciiValue for value comparison.

=============== Diff against Compiler-nice.194 ===============

Item was changed:
  ----- Method: Scanner>>scanToken (in category 'expression types') -----
  scanToken
  
  	[(tokenType := self typeTableAt: hereChar) == #xDelimiter]
  		whileTrue: [self step].  "Skip delimiters fast, there almost always is one."
+ 	mark := (aheadChar asciiValue = 30 and: [source atEnd])
- 	mark := (aheadChar == 30 asCharacter and: [source atEnd])
  		ifTrue: [source position]
  		ifFalse: [source position - 1].
+ 	(tokenType at: 1) == $x "x as first letter"
- 	(tokenType at: 1) = $x "x as first letter"
  		ifTrue: [self perform: tokenType "means perform to compute token & type"]
  		ifFalse: [token := self step asSymbol "else just unique the first char"].
  	^token!

Item was changed:
  ----- Method: Scanner>>xDigit (in category 'multi-character scans') -----
  xDigit
  	"Form a number."
  
  	tokenType := #number.
+ 	(aheadChar asciiValue = 30 and: [source atEnd
+ 			and:  [source skip: -1. source next asciiValue ~= 30]])
- 	(aheadChar = 30 asCharacter and: [source atEnd
- 			and:  [source skip: -1. source next ~= 30 asCharacter]])
  		ifTrue: [source skip: -1 "Read off the end last time"]
  		ifFalse: [source skip: -2].
  	token := (SqNumberParser on: source)
  		failBlock: [:errorString :position | self notify: errorString at:position];
  		nextNumber.
  	self step; step!

Item was changed:
  ----- Method: Scanner>>xSingleQuote (in category 'multi-character scans') -----
  xSingleQuote
  	"String."
  
  	self step.
  	buffer reset.
+ 	[hereChar == $' 
+ 		and: [aheadChar == $' 
- 	[hereChar = $' 
- 		and: [aheadChar = $' 
  				ifTrue: [self step. false]
  				ifFalse: [true]]]
  		whileFalse: 
  			[buffer nextPut: self step.
+ 			(hereChar asciiValue = 30 and: [source atEnd])
- 			(hereChar = 30 asCharacter and: [source atEnd])
  				ifTrue: [^self offEnd: 'Unmatched string quote']].
  	self step.
  	token := buffer contents.
  	tokenType := #string!




More information about the Squeak-dev mailing list