The Trunk: ShoutCore-ul.25.mcz

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

The Trunk: ShoutCore-ul.25.mcz

commits-2
Levente Uzonyi uploaded a new version of ShoutCore to project The Trunk:
http://source.squeak.org/trunk/ShoutCore-ul.25.mcz

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

Name: ShoutCore-ul.25
Author: ul
Time: 15 November 2010, 4:15:51.755 am
UUID: 36efb55e-901b-c742-85d1-1c4d4111beec
Ancestors: ShoutCore-ul.24

- fix for http://bugs.squeak.org/view.php?id=7565 (properly highlight message patterns, selectors and variables if the first or last character is an underscore)
- added missing method SHParserST80 >> #ranges (the example in the class comment uses it)

=============== Diff against ShoutCore-ul.24 ===============

Item was changed:
  ----- Method: SHParserST80>>isKeyword (in category 'token testing') -----
  isKeyword
+ "This method assumes that currentTokenFirst is a non-letter character when currentToken is nil."
+
+ ^(currentTokenFirst isLetter or: [
+ currentTokenFirst == $_ and: [
+ currentToken notNil and: [
+ currentToken size > 1 and: [
+ self allowUnderscoreSelectors ] ] ] ]) and: [
+ currentToken last == $: ]!
- ^currentTokenFirst isLetter and: [currentToken last == $:]!

Item was changed:
  ----- Method: SHParserST80>>isName (in category 'token testing') -----
  isName
+ "This method assumes that currentTokenFirst is a non-letter character when currentToken is nil."
+
+ ^(currentTokenFirst isLetter or: [
+ currentTokenFirst == $_ and: [
+ currentToken notNil and: [
+ currentToken size > 1 and: [
+ self allowUnderscoreSelectors ] ] ] ]) and: [
+ currentToken last isAlphaNumeric or: [
+ currentToken last == $_ and: [
+ self allowUnderscoreSelectors ] ] ] !
- ^currentTokenFirst isLetter and: [currentToken last isAlphaNumeric]!

Item was added:
+ ----- Method: SHParserST80>>ranges (in category 'accessing') -----
+ ranges
+
+ ^ranges!

Item was changed:
  ----- Method: SHParserST80>>scanNext (in category 'scan') -----
  scanNext
  self scanWhitespace.
  currentTokenFirst := self currentChar.
  currentTokenFirst
  ifNil: [" end of input "
  currentTokenFirst := $ .
  currentTokenSourcePosition := nil.
  currentToken := nil.
  ^nil].
  currentTokenFirst isDigit ifTrue: [^self scanNumber].
+ (currentTokenFirst isLetter or: [
+ currentTokenFirst == $_ and: [ self allowUnderscoreSelectors ] ])
+ ifTrue: [^self scanIdentifier].
- currentTokenFirst isLetter ifTrue: [^self scanIdentifier].
  ^self scanBinary!