Parser.st
changeset 1220 53e6eeadee72
parent 1215 f2b18b227c78
child 1221 2768cbe3be2b
--- a/Parser.st	Thu Nov 15 21:03:13 2001 +0100
+++ b/Parser.st	Thu Nov 15 21:04:08 2001 +0100
@@ -2389,15 +2389,16 @@
 "/                how := how , #( BlockVariable ).
 "/            ].
             selector notNil ifTrue:[
-                l := l , #( 'Method local' ).
+                l := l , #( 'Method Local Variable' ).
                 how := how , #( MethodVariable ).
             ].
-"/            (classToCompileFor notNil
-"/            and:[classToCompileFor isMeta not
-"/            and:[classToCompileFor isBuiltInClass not]]) ifTrue:[
-"/                l := l , (Array with:( 'Instance variable of ' , classToCompileFor name )).
-"/                how := how , #( InstanceVariable ).
-"/            ].
+            (classToCompileFor notNil
+            and:[classToCompileFor isMeta not
+            and:[classToCompileFor isBuiltInClass not 
+            and:[selector notNil and:[selector ~~ #doIt]]]]) ifTrue:[
+                l := l copyWith:'Instance Variable'.
+                how := how copyWith: #InstanceVariable.
+            ].
         ] ifFalse:[
             l := l , #( 'Global' 'NameSpace' ).
             how := how , #( GlobalVariable NameSpace ).
@@ -2405,11 +2406,12 @@
             (classToCompileFor notNil
             and:[classToCompileFor isBuiltInClass not
             and:[selector notNil and:[selector ~~ #doIt]]]) ifTrue:[
-                l := l , (Array 
-                            with:'Class Variable in ' , classToCompileFor name
-"/                            with:'Class Instance Variable in ' , classToCompileFor name
-                      ).
-                how := how , #( ClassVariable ClassInstVariable).
+                classToCompileFor isMeta ifTrue:[
+                    l := l , #('Class Instance Variable').
+                    how := how , #( ClassInstanceVariable).
+                ].
+                l := l , #('Class Variable' ).
+                how := how , #( ClassVariable).
             ]
         ].
         (selector isNil or:[selector == #doIt]) ifTrue:[
@@ -2417,7 +2419,7 @@
                 l := l ,  #( '-' ).
                 how := how , #( nil ).
             ].
-            l := l , #( 'Workspace variable' ).
+            l := l , #( 'Workspace Variable' ).
             how := how , #( WorkspaceVariable ).
         ].
         l size > 0 ifTrue:[
@@ -2445,6 +2447,22 @@
                     classToCompileFor addClassVarName:varName.
                     ^ VariableNode type:#ClassVariable class:classToCompileFor name:varName
                 ].
+                choice == #InstanceVariable ifTrue:[
+                    classToCompileFor theNonMetaclass addInstVarName:varName.
+                    "/ ST/X special - classToCompileFor is obsoleted
+                    classToCompileFor := Smalltalk classNamed:(classToCompileFor name).
+                    Compiler restartCompilationSignal raise.    
+                    "/ not reached - restarted compile will not arrive here again
+                    self halt.
+                ].
+                choice == #ClassInstanceVariable ifTrue:[
+                    classToCompileFor theMetaclass addInstVarName:varName.
+                    "/ ST/X special - classToCompileFor is obsoleted
+                    classToCompileFor := Smalltalk classNamed:(classToCompileFor name).
+                    Compiler restartCompilationSignal raise.    
+                    "/ not reached - restarted compile will not arrive here again
+                    self halt.
+                ].
                 choice == #MethodVariable ifTrue:[
                     |varIndex var endLocalsPos posToInsert ins|
 
@@ -2531,7 +2549,7 @@
     ^ rslt
 
     "Modified: / 22.1.1998 / 16:34:01 / stefan"
-    "Modified: / 4.7.1999 / 19:24:10 / cg"
+    "Modified: / 15.11.2001 / 17:18:35 / cg"
 !
 
 defineAsUndeclaredVariable:aName
@@ -5845,6 +5863,12 @@
 
 !Parser methodsFor:'setup'!
 
+classToCompileFor
+    ^ classToCompileFor
+
+    "Created: / 15.11.2001 / 17:21:10 / cg"
+!
+
 foldConstants:aSymbolOrNil
     "change the constant folding level. See the classMethod for a description."
 
@@ -6014,6 +6038,6 @@
 !Parser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.314 2001-11-09 18:14:52 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.315 2001-11-15 20:04:08 cg Exp $'
 ! !
 Parser initialize!