correctly scan #_ (i.e. a symbol consisting of a single underscore)
authorClaus Gittinger <cg@exept.de>
Mon, 01 Oct 2001 22:53:21 +0200
changeset 1191 47011122e30e
parent 1190 8600334a549e
child 1192 b13a83abf72f
correctly scan #_ (i.e. a symbol consisting of a single underscore)
Scanner.st
--- a/Scanner.st	Fri Sep 28 17:54:00 2001 +0200
+++ b/Scanner.st	Mon Oct 01 22:53:21 2001 +0200
@@ -1342,11 +1342,14 @@
             string := ''.
             [nextChar notNil 
              and:[nextChar isLetterOrDigit 
-                  or:[allowUnderscoreInIdentifier == true
-                      and:[nextChar == $_]]
+                  or:[allowUnderscoreInIdentifier == true and:[nextChar == $_]]
                  ]
             ] whileTrue:[
-                part := source nextAlphaNumericWord.
+                nextChar == $_ ifTrue:[
+                    part := nil.
+                ] ifFalse:[
+                    part := source nextAlphaNumericWord.
+                ].
                 part notNil ifTrue:[
                     string := string , part.
                 ].
@@ -2126,6 +2129,6 @@
 !Scanner class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.125 2001-09-07 15:09:25 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.126 2001-10-01 20:53:21 cg Exp $'
 ! !
 Scanner initialize!