Parser.st
changeset 687 27565829b5d4
parent 685 fbbe821b0ce3
child 688 4079c5dd2dca
--- a/Parser.st	Thu Apr 16 18:58:53 1998 +0200
+++ b/Parser.st	Thu Apr 16 19:00:04 1998 +0200
@@ -1740,6 +1740,11 @@
     "Created: / 31.3.1998 / 18:06:17 / cg"
 !
 
+markInstVarIdentifierFrom:pos1 to:pos2
+
+    "Created: / 16.4.1998 / 18:34:10 / cg"
+!
+
 markLocalIdentifierFrom:pos1 to:pos2
 
     "Created: / 31.3.1998 / 15:29:35 / cg"
@@ -1771,6 +1776,19 @@
 
     "Modified: / 31.3.1998 / 19:16:26 / cg"
     "Created: / 31.3.1998 / 19:35:53 / cg"
+!
+
+markVariable:v
+    "support for syntaxColoring"
+
+    "Modified: / 16.4.1998 / 18:47:45 / cg"
+!
+
+markVariable:v from:pos1 to:pos2
+    "support for syntaxColoring"
+
+    "Modified: / 16.4.1998 / 18:47:45 / cg"
+    "Created: / 16.4.1998 / 18:50:03 / cg"
 ! !
 
 !Parser methodsFor:'error correction'!
@@ -3516,6 +3534,8 @@
             ]
         ].
 
+        self markVariable:var from:pos to:pos+var name size - 1.
+
         ((tokenType == $_) or:[tokenType == #':=']) ifFalse:[
             ^ var
         ].
@@ -3795,7 +3815,7 @@
     ^ #Error
 
     "Created: / 13.9.1995 / 12:50:50 / claus"
-    "Modified: / 1.4.1998 / 13:09:40 / cg"
+    "Modified: / 16.4.1998 / 18:51:41 / cg"
 !
 
 statement
@@ -3974,32 +3994,17 @@
 variable
     "parse a variable; if undefined, notify error and correct if user wants to"
 
-    |v pos1 type|
-
-    pos1 := tokenPosition.
+    |v pos1|
+
     v := self variableOrError:tokenName.
     (v ~~ #Error) ifTrue:[
         (v isMemberOf:VariableNode) ifTrue:[
-            type := v type.
-            (type == #BlockArg
-            or:[type == #MethodArg]) ifTrue:[
-                self markArgumentIdentifierFrom:pos1 to:pos1+tokenName size-1.
-            ] ifFalse:[
-                (type == #BlockVariable
-                or:[type == #MethodVariable]) ifTrue:[
-                    self markLocalIdentifierFrom:pos1 to:pos1+tokenName size-1.
-                ] ifFalse:[
-                    (type == #GlobalVariable) ifTrue:[
-                        self markGlobalIdentifierFrom:pos1 to:pos1+tokenName size-1.
-                    ] ifFalse:[
-                        self markIdentifierFrom:pos1 to:pos1+tokenName size-1.
-                    ]
-                ]
-            ]
+            self markVariable:v.
         ].
         ^ v
     ].
 
+    pos1 := tokenPosition.
     self markUnknownIdentifierFrom:pos1 to:pos1+tokenName size-1.
 
     v := self correctVariable.
@@ -4021,7 +4026,7 @@
     self markGlobalIdentifierFrom:pos1 to:pos1+tokenName size-1.
     ^ VariableNode type:#GlobalVariable name:tokenName asSymbol
 
-    "Modified: / 7.4.1998 / 17:14:46 / cg"
+    "Modified: / 16.4.1998 / 18:46:45 / cg"
 !
 
 variableOrError
@@ -4606,6 +4611,6 @@
 !Parser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.165 1998-04-14 16:59:29 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.166 1998-04-16 17:00:04 cg Exp $'
 ! !
 Parser initialize!