currentClasses nameSpace is first to look for globals.
authorClaus Gittinger <cg@exept.de>
Mon, 10 Feb 1997 14:42:34 +0100
changeset 494 bb3e71c90dfd
parent 493 77e0d6979865
child 495 03187fd2a7da
currentClasses nameSpace is first to look for globals.
Parser.st
--- a/Parser.st	Sat Feb 08 20:02:43 1997 +0100
+++ b/Parser.st	Mon Feb 10 14:42:34 1997 +0100
@@ -3658,8 +3658,13 @@
     "is it in a namespace ?"
     space := self findNameSpaceWith:varName.
     space notNil ifTrue:[
-        parseForCode ifFalse:[self rememberGlobalUsed:(space name , '::' , varName)].
-        ^ VariableNode type:#PrivateClass class:space name:varName
+        space ~~ Smalltalk ifTrue:[
+            parseForCode ifFalse:[self rememberGlobalUsed:(space name , '::' , varName)].
+            ^ VariableNode type:#PrivateClass class:space name:varName
+        ] ifFalse:[
+            parseForCode ifFalse:[self rememberGlobalUsed:varName].
+            ^ VariableNode type:#GlobalVariable name:varName asSymbol
+        ]
     ].
 
     "is it a global-variable ?"
@@ -3673,7 +3678,7 @@
 
     ^ #Error
 
-    "Modified: 19.12.1996 / 23:53:37 / cg"
+    "Modified: 10.2.1997 / 14:40:39 / cg"
 ! !
 
 !Parser methodsFor:'private'!
@@ -3719,7 +3724,7 @@
 !
 
 findNameSpaceWith:aVariableName
-    |ns currentSpace usedSpaces|
+    |topNameSpace ns currentSpace usedSpaces|
 
     "/ private names have already been searched for.
 
@@ -3745,6 +3750,14 @@
                 ^ ns
             ]
         ].
+
+        ns := classToCompileFor nameSpace.
+        ns notNil ifTrue:[
+            "is it in the current classes namespace ?"
+            (ns at:aVariableName asSymbol) notNil ifTrue:[
+                ^ ns
+            ]
+        ].
     ].
 
     "is it in the current namespace ?"
@@ -3768,7 +3781,7 @@
     ^ nil
 
     "Created: 19.12.1996 / 23:51:02 / cg"
-    "Modified: 23.1.1997 / 00:43:29 / cg"
+    "Modified: 10.2.1997 / 14:34:30 / cg"
 ! !
 
 !Parser methodsFor:'queries'!
@@ -4030,6 +4043,6 @@
 !Parser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.127 1997-02-08 19:02:43 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.128 1997-02-10 13:42:34 cg Exp $'
 ! !
 Parser initialize!