changed:
authorClaus Gittinger <cg@exept.de>
Tue, 01 Dec 2009 21:02:28 +0100
changeset 2290 d84dd6eff7ea
parent 2289 eed444897010
child 2291 8a52a38a1c38
changed: #isSpecialOrExtendedSpecialCharacter: #nextSpecialWith:
Scanner.st
--- a/Scanner.st	Tue Dec 01 11:22:05 2009 +0100
+++ b/Scanner.st	Tue Dec 01 21:02:28 2009 +0100
@@ -2040,6 +2040,10 @@
     charType := typeArray at:code.
     ^ (charType == #special) 
        or:[ (charType == #extendedSpecial) and:[parserFlags allowExtendedBinarySelectors] ] 
+
+    "
+     self basicNew isSpecialOrExtendedSpecialCharacter:$-
+    "
 !
 
 notifying:anObject
@@ -2698,23 +2702,23 @@
     ].
 
     secondChar notNil ifTrue:[
+        (secondChar == $-) ifTrue:[
+            "special- look if minus belongs to number following"
+            p := source position1Based.
+            source next.
+            thirdChar := source peekOrNil.
+            source position1Based:p.
+            (thirdChar notNil and:[thirdChar isDigit]) ifTrue:[
+                tokenName := token := string.
+                tokenType := #BinaryOperator.
+                self 
+                    warnPossibleIncompatibility:'add a space before ''-'' for compatibility with other ST systems' 
+                    position:p 
+                    to:p.
+                ^ tokenType
+            ]
+        ].
         (self isSpecialOrExtendedSpecialCharacter:secondChar) ifTrue:[
-            (secondChar == $-) ifTrue:[
-                "special- look if minus belongs to number following"
-                p := source position1Based.
-                source next.
-                thirdChar := source peekOrNil.
-                source position1Based:p.
-                (thirdChar notNil and:[thirdChar isDigit]) ifTrue:[
-                    tokenName := token := string.
-                    tokenType := #BinaryOperator.
-                    self 
-                        warnPossibleIncompatibility:'add a space before ''-'' for compatibility with other ST systems' 
-                        position:p 
-                        to:p.
-                    ^ tokenType
-                ]
-            ].
             source next.
             string := string copyWith:secondChar.
 
@@ -3270,7 +3274,11 @@
 !Scanner class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.251 2009-09-15 12:13:44 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.252 2009-12-01 20:02:28 cg Exp $'
+!
+
+version_CVS
+    ^ '$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.252 2009-12-01 20:02:28 cg Exp $'
 ! !
 
 Scanner initialize!