allow degenerated keyword '_:'
authorClaus Gittinger <cg@exept.de>
Tue, 07 Jan 1997 12:40:57 +0100
changeset 467 feaacb47b0b5
parent 466 7f136821cdd2
child 468 b56afb940e6d
allow degenerated keyword '_:' i.e. foo:_:_:_: is now a valid selector
Scanner.st
--- a/Scanner.st	Sun Jan 05 16:51:09 1997 +0100
+++ b/Scanner.st	Tue Jan 07 12:40:57 1997 +0100
@@ -829,10 +829,12 @@
         nextChar := source nextPeek.
         (nextChar isAlphaNumeric or:[nextChar == $_]) ifFalse:[
             "oops: a single underscore is an old-style assignement"
-            self warnOldStyleAssignmentAt:tokenPosition.
-            source next.
-            tokenType := $_.
-            ^ tokenType
+            nextChar ~~ $: ifTrue:[
+                self warnOldStyleAssignmentAt:tokenPosition.
+                source next.
+                tokenType := $_.
+                ^ tokenType
+            ]
         ].
         string := '_'.
         self warnUnderscoreAt:tokenPosition.
@@ -840,7 +842,9 @@
             string := string copyWith:$_.
             nextChar := source nextPeek.
         ].
-        string := string , source nextAlphaNumericWord.
+        nextChar isAlphaNumeric ifTrue:[
+            string := string , source nextAlphaNumericWord.
+        ]
     ] ifFalse:[
         string := source nextAlphaNumericWord "self nextId".
     ].
@@ -895,7 +899,7 @@
     ^ tokenType
 
     "Created: 13.9.1995 / 12:56:42 / claus"
-    "Modified: 14.10.1996 / 18:50:45 / cg"
+    "Modified: 7.1.1997 / 12:31:36 / cg"
 !
 
 nextMantissa:radix
@@ -1277,6 +1281,6 @@
 !Scanner class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.59 1997-01-04 13:16:39 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.60 1997-01-07 11:40:57 cg Exp $'
 ! !
 Scanner initialize!