comments
authorClaus Gittinger <cg@exept.de>
Mon, 31 Jan 2000 20:26:02 +0100
changeset 1026 831aa102111f
parent 1025 5b3022ecb269
child 1027 c944d9be2a69
comments
Scanner.st
--- a/Scanner.st	Mon Jan 31 20:06:35 2000 +0100
+++ b/Scanner.st	Mon Jan 31 20:26:02 2000 +0100
@@ -1311,6 +1311,9 @@
 !
 
 nextHash
+    "a # has been read - return a symbol, HashLeftParen (for '#('),
+     #HashLeftBrack (for '#['), or HashLeftBrace (for '#{' and AllowQualifiedNames)"
+
     |nextChar string part|
 
     nextChar := source nextPeek.
@@ -1421,6 +1424,9 @@
 !
 
 nextId
+    "no longer used here - remains for backwardCompatibility for
+     subclass users ... (sigh)"
+
     |nextChar string oldString 
      index "{ Class: SmallInteger }"
      max   "{ Class: SmallInteger }" |
@@ -1448,6 +1454,9 @@
 !
 
 nextIdentifier
+    "an alpha character (or underscor if AllowUnderscore) has been read.
+     Return the next identifier."
+
     |nextChar string ok pos|
 
     hereChar == $_ ifTrue:[
@@ -1537,9 +1546,9 @@
     ].
 
     tokenName := token := string.
-    (self checkForKeyword:string) ifTrue:[^ tokenType].
-
-    tokenType := #Identifier.
+    (self checkForKeyword:string) ifFalse:[
+        tokenType := #Identifier.
+    ].
     ^ tokenType
 
     "Created: / 13.9.1995 / 12:56:42 / claus"
@@ -1547,6 +1556,8 @@
 !
 
 nextMantissa:radix
+    "read the mantissa of a radix number"
+
     |nextChar value factor|
 
     value := 0.
@@ -1563,6 +1574,10 @@
 !
 
 nextNumber
+    "scan a number; handles radix prefix, mantissa and exponent.
+     Does not yet handle fixNums. Allows for e, d or q to be used as exponent
+     limiter."
+
     |nextChar value s tokenRadix|
 
     tokenRadix := 10.
@@ -1604,7 +1619,7 @@
         ]
     ].
 
-    ((nextChar == $e) or:[nextChar == $E]) ifTrue:[
+    ('eEdDqQ' includes:nextChar) ifTrue:[
         nextChar := source nextPeek.
         (nextChar notNil and:[(nextChar isDigit"Radix:tokenRadix") or:['+-' includes:nextChar]]) ifTrue:[
             s := 1.
@@ -1649,6 +1664,8 @@
 !
 
 nextPrimitive
+    "scan an inline C-primitive."
+
     |nextChar inPrimitive string 
      index "{ Class: SmallInteger }"
      len   "{ Class: SmallInteger }" |
@@ -1753,6 +1770,8 @@
 !
 
 nextString
+    "a single quote has been scanned; scan the string (caring for doubled quotes"
+
     |nextChar string pos
      index "{ Class: SmallInteger }"
      len   "{ Class: SmallInteger }"
@@ -1901,6 +1920,8 @@
 !
 
 nextToken:aCharacter
+    "return a character token"
+
     tokenType := token := aCharacter.
     hereChar notNil ifTrue:[source next].
     ^ tokenType
@@ -1909,6 +1930,8 @@
 !
 
 skipComment
+    "skip over a comment; handles ST/X eol comments."
+
     |commentStream commentType startPos|
 
     saveComments ifTrue:[
@@ -2053,6 +2076,6 @@
 !Scanner class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.115 2000-01-19 16:02:11 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.116 2000-01-31 19:26:02 cg Exp $'
 ! !
 Scanner initialize!