--- a/Scanner.st Fri Nov 08 09:06:15 2019 +0100
+++ b/Scanner.st Fri Nov 15 09:07:16 2019 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
"
COPYRIGHT (c) 1989 by Claus Gittinger
All Rights Reserved
@@ -16,19 +14,19 @@
"{ NameSpace: Smalltalk }"
Object subclass:#Scanner
- instanceVariableNames:'typeArray actionArray source lineNr token tokenType tokenPosition
- tokenValue tokenName tokenLineNr tokenLastEndPosition hereChar
- peekChar peekChar2 requestor exitBlock errorFlag ignoreErrors
- ignoreWarnings saveComments currentComments collectedSource
- scanColonAsKeyword outStream outCol inArrayLiteral lastDirective
- parserFlags didWarnAboutSTXSpecialComment
- didWarnAboutUnderscoreInIdentifier didWarnAboutOldStyleAssignment
- didWarnAboutDollarInIdentifier didWarnAboutPeriodInSymbol
- unicodeActions'
- classVariableNames:'DefaultActionArray DefaultTypeArray DefaultUnicodeActions
- EmptySourceNotificationSignal'
- poolDictionaries:''
- category:'System-Compiler'
+ instanceVariableNames:'typeArray actionArray source lineNr token tokenType tokenPosition
+ tokenValue tokenName tokenLineNr tokenLastEndPosition hereChar
+ peekChar peekChar2 requestor exitBlock errorFlag ignoreErrors
+ ignoreWarnings saveComments currentComments collectedSource
+ scanColonAsKeyword outStream outCol inArrayLiteral lastDirective
+ parserFlags didWarnAboutSTXSpecialComment
+ didWarnAboutUnderscoreInIdentifier didWarnAboutOldStyleAssignment
+ didWarnAboutDollarInIdentifier didWarnAboutPeriodInSymbol
+ unicodeActions'
+ classVariableNames:'DefaultActionArray DefaultTypeArray DefaultUnicodeActions
+ EmptySourceNotificationSignal'
+ poolDictionaries:''
+ category:'System-Compiler'
!
Scanner class instanceVariableNames:'TypeArray ActionArray UnicodeActions'
@@ -39,31 +37,31 @@
!
Object subclass:#Comment
- instanceVariableNames:'commentType commentString startPosition endPosition'
- classVariableNames:''
- poolDictionaries:''
- privateIn:Scanner
+ instanceVariableNames:'commentType commentString startPosition endPosition'
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:Scanner
!
Object subclass:#Directive
- instanceVariableNames:''
- classVariableNames:''
- poolDictionaries:''
- privateIn:Scanner
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:Scanner
!
Scanner::Directive subclass:#ClassDirective
- instanceVariableNames:'className'
- classVariableNames:''
- poolDictionaries:''
- privateIn:Scanner::Directive
+ instanceVariableNames:'className'
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:Scanner::Directive
!
Scanner::Directive::ClassDirective subclass:#ClassHintDirective
- instanceVariableNames:''
- classVariableNames:''
- poolDictionaries:''
- privateIn:Scanner::Directive
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:Scanner::Directive
!
!Scanner class methodsFor:'documentation'!
@@ -145,7 +143,7 @@
extendedBinarySelectorCharacters
"return a collection of characters which are optionally allowed in binary selectors"
- "/ ^ '±×·÷«»'.
+ "/ ^ '±×·÷«»'.
^ String
with:(Character value:16rB1) "/ plus-minus
with:(Character value:16rD7) "/ times
@@ -1876,13 +1874,13 @@
!
warnParagraphAt:position
- "warn about §-character in an identifier"
+ "warn about §-character in an identifier"
ignoreWarnings ifFalse:[
"/ didWarnAboutParagraphInIdentifier ifFalse:[
parserFlags warnParagraphInIdentifier ifTrue:[
self
- warning:'§-characters in identifiers/symbols are nonportable'
+ warning:'§-characters in identifiers/symbols are nonportable'
doNotShowAgainAction:[ ParserFlags warnParagraphInIdentifier:false ]
position:position to:position.
"
@@ -3035,7 +3033,7 @@
(((nextChar == $_) and:[allowUnderscoreInIdentifier])
or:[ (allowDollarInIdentifier and:[nextChar == $$ ])
- or:[ (nextChar == $§ and:[ allowParagraphInIdentifier])
+ or:[ (nextChar == $§ and:[ allowParagraphInIdentifier])
or:[ (allowNationalCharactersInIdentifier and:[ nextChar notNil and:[nextChar isNationalLetter]])
or:[ (allowGreekCharactersInIdentifier and:[ nextChar notNil and:[nextChar isNationalLetter]])
]]]]) ifTrue:[
@@ -3046,7 +3044,7 @@
nextChar == $$ ifTrue:[
self warnDollarAt:pos.
] ifFalse:[
- nextChar == $§ ifTrue:[
+ nextChar == $§ ifTrue:[
self warnParagraphAt:pos.
] ifFalse:[
"/ self warnNationalCharacterAt:pos.
@@ -3066,7 +3064,7 @@
].
ok := ((nextChar == $_) and:[allowUnderscoreInIdentifier])
or:[((nextChar == $$ ) and:[allowDollarInIdentifier])
- or:[((nextChar == $§ ) and:[allowParagraphInIdentifier])
+ or:[((nextChar == $§ ) and:[allowParagraphInIdentifier])
or:[(nextChar notNil and:[allowNationalCharactersInIdentifier and:[nextChar isNationalLetter]])
or:[(nextChar notNil and:[allowGreekCharactersInIdentifier and:[nextChar isGreekLetter]])
]]]].
@@ -3162,16 +3160,19 @@
i.e. 1e5 -> float (technically a double precision IEEE)
1d5 -> float (also, a double precision IEEE)
- 1q5 -> long float (a c-long double / quad precision IEEE)
+ 1q5 -> long float (a c-long double / extended or quad precision IEEE, dep. on CPU)
+ 1Q5 -> quad float (quad precision IEEE)
1s -> a fixed point with precision from number of digits given.
1s5 -> a fixed point with 5 digits precision.
1d -> float (technically a double precision IEEE float).
- 1q -> long float (technically a c-long double / extended or quad precision IEEE float).
-
- 1f5 -> shortFloat (technically a single precision IEEE float) or float.
- 1f -> shortFloat (technically a single precision IEEE float) or float.
+ 1q -> long float (technically a c-long double / extended or quad precision IEEE float, dep. on CPU).
+ 1Q -> quad float (quad precision IEEE)
+
+ 1f5 -> shortFloat (technically a single precision IEEE float) or float, dep on parserFlags.
+ 1f -> shortFloat (technically a single precision IEEE float) or float, dep on parserFlags.
support for scaled decimals can be disabled, if code needs to be read,
- which does not know about them (very unlikely)"
+ which does not know about them (very unlikely).
+ support for single prec. floats with f/F is controlled by a parser flag"
|pos1 nextChar value integerPart sign
expSign tokenRadix mantissaAndScaledPart d type exp scale|
@@ -3814,7 +3815,7 @@
"/ a nil token means: continue reading
] ifFalse:[
((ch isNationalLetter and:[parserFlags allowNationalCharactersInIdentifier])
- or:[ (ch == $§ and:[parserFlags allowParagraphInIdentifier])
+ or:[ (ch == $§ and:[parserFlags allowParagraphInIdentifier])
or:[ (ch isGreekLetter and:[parserFlags allowGreekCharactersInIdentifier])
]]) ifTrue:[
tok := self nextIdentifier.