Parser.st
changeset 915 d3add8c1bb04
parent 903 038c2c447dcf
child 918 e088f51a649e
--- a/Parser.st	Thu Jul 15 21:42:42 1999 +0200
+++ b/Parser.st	Sun Jul 18 16:24:15 1999 +0200
@@ -18,8 +18,8 @@
 		usedGlobals usedSymbols usedMessages localVarDefPosition
 		evalExitBlock selfNode superNode nilNode hasPrimitiveCode
 		hasNonOptionalPrimitiveCode primitiveNr primitiveResource logged
-		warnedUndefVars warnSTXHereExtensionUsed correctedSource
-		foldConstants lineNumberInfo currentNamespace
+		warnedUndefVars warnedUnknownNamespaces warnSTXHereExtensionUsed
+		correctedSource foldConstants lineNumberInfo currentNamespace
 		currentUsedNamespaces warnUndeclared methodNode
 		alreadyWarnedClassInstVarRefs localBlockVarDefPosition
 		endOfSelectorPosition startOfBlockPosition'
@@ -1989,7 +1989,11 @@
         ].
 
         "/ upperCase vars are declared as global
-        self warning:('adding ''' , varName , ''' as Global.') withCRs position:pos1 to:pos2.
+        (warnedUndefVars isNil or:[(warnedUndefVars includes:varName) not]) ifTrue:[
+            (warnedUnknownNamespaces isNil or:[(warnedUnknownNamespaces includes:varName) not]) ifTrue:[
+                self warning:('adding ''' , varName , ''' as Global.') withCRs position:pos1 to:pos2.
+            ].
+        ].
         ^ VariableNode type:#GlobalVariable name:(varName asSymbol)
     ].
 
@@ -2577,6 +2581,7 @@
     |doCorrect msg idx|
 
     warnUndeclared ifFalse:[^ false].
+    ignoreWarnings ifTrue:[^ false].
 
     "
      alredy warned about this one ?
@@ -3818,10 +3823,16 @@
 
                     nameSpaceGlobal := Smalltalk at:nameSpace asSymbol ifAbsent:nil.
                     nameSpaceGlobal isNil ifTrue:[
-                        self warning:('unknown nameSpace: ', nameSpace) 
-                             position:pos to:tokenPosition-1.
-"/                        self parseError:('unknown nameSpace: ', nameSpace) position:pos to:tokenPosition-1.
-"/                        errorFlag := true
+                        warnedUnknownNamespaces isNil ifTrue:[
+                            warnedUnknownNamespaces := Set new.
+                        ].
+                        (warnedUnknownNamespaces includes:nameSpace) ifFalse:[
+                            self warning:('unknown nameSpace: ', nameSpace) 
+                                 position:pos to:tokenPosition-1.
+"/                            self parseError:('unknown nameSpace: ', nameSpace) position:pos to:tokenPosition-1.
+"/                            errorFlag := true
+                            warnedUnknownNamespaces add:nameSpace.
+                        ]
                     ] ifFalse:[
                         nameSpaceGlobal isNamespace ifTrue:[
                             "/ for now: only Smalltalk is allowed
@@ -5010,6 +5021,6 @@
 !Parser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.210 1999-07-12 15:13:20 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.211 1999-07-18 14:24:15 cg Exp $'
 ! !
 Parser initialize!