Scanner.st
changeset 2181 9498c1060445
parent 2180 891d45ffad68
child 2182 bce48a1e1367
equal deleted inserted replaced
2180:891d45ffad68 2181:9498c1060445
  2851          ]
  2851          ]
  2852     ] whileTrue:[
  2852     ] whileTrue:[
  2853         nextChar == $_ ifTrue:[
  2853         nextChar == $_ ifTrue:[
  2854             part := nil.
  2854             part := nil.
  2855         ] ifFalse:[
  2855         ] ifFalse:[
  2856             nextChar == $. ifTrue:[
  2856             (allowPeriodInSymbol and:[nextChar == $.]) ifTrue:[
  2857                 part := nil.
  2857                 part := nil.
  2858             ] ifFalse:[
  2858             ] ifFalse:[
  2859                 part := source nextAlphaNumericWord.
  2859                 part := source nextAlphaNumericWord.
  2860             ]
  2860             ]
  2861         ].
  2861         ].
  2869             nextChar == $_ ifTrue:[
  2869             nextChar == $_ ifTrue:[
  2870                 self warnUnderscoreAt:source position1Based.
  2870                 self warnUnderscoreAt:source position1Based.
  2871             ] ifFalse:[
  2871             ] ifFalse:[
  2872                 self warnPeriodAt:source position1Based.
  2872                 self warnPeriodAt:source position1Based.
  2873             ].
  2873             ].
  2874             [(nextChar == $_) or:[nextChar == $.]] whileTrue:[
  2874             [(nextChar == $_) or:[(allowPeriodInSymbol and:[nextChar == $.])]] whileTrue:[
  2875                 string := string copyWith:nextChar.
  2875                 string := string copyWith:nextChar.
  2876                 nextChar := source nextPeek.
  2876                 nextChar := source nextPeek.
  2877                 (nextChar notNil and:[nextChar isLetterOrDigit]) ifTrue:[
  2877                 (nextChar notNil and:[nextChar isLetterOrDigit]) ifTrue:[
  2878                     string := string , source nextAlphaNumericWord.
  2878                     string := string , source nextAlphaNumericWord.
  2879                     nextChar := source peek.
  2879                     nextChar := source peek.
  2880                 ] ifFalse:[
  2880                 ] ifFalse:[
  2881                     string last == $. ifTrue:[
  2881                     (allowPeriodInSymbol and:[string last == $.]) ifTrue:[
  2882                         peekChar := nextChar.
  2882                         peekChar := nextChar.
  2883                         nextChar := $..
  2883                         nextChar := $..
  2884                         string := string copyWithoutLast:1.
  2884                         string := string copyWithoutLast:1.
  2885                         tokenValue := token := string asSymbol.
  2885                         tokenValue := token := string asSymbol.
  2886                         tokenType := #Symbol.
  2886                         tokenType := #Symbol.
  3267 ! !
  3267 ! !
  3268 
  3268 
  3269 !Scanner class methodsFor:'documentation'!
  3269 !Scanner class methodsFor:'documentation'!
  3270 
  3270 
  3271 version
  3271 version
  3272     ^ '$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.248 2009-05-18 14:28:02 cg Exp $'
  3272     ^ '$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.249 2009-05-20 14:15:51 sr Exp $'
  3273 ! !
  3273 ! !
  3274 
  3274 
  3275 Scanner initialize!
  3275 Scanner initialize!