Parser.st
changeset 4380 2cd73b81e46b
parent 4379 b0e0f34e06b2
child 4394 174a0d149d1f
--- a/Parser.st	Mon Mar 04 10:34:49 2019 +0100
+++ b/Parser.st	Mon Mar 04 12:25:48 2019 +0100
@@ -2838,6 +2838,7 @@
 !
 
 checkPlausibilityOf:aNode from:startPosition to:endPosition
+    <resource: #todo>
     |note fixes|
     
     (ignoreErrors or:[ignoreWarnings]) ifTrue:[^ self].
@@ -2845,7 +2846,9 @@
     (ParserFlags isFlag:#warnPlausibilityChecks enabledForClass:classToCompileFor selector:selector) ifFalse:[^ self].
 
     aNode isMessage ifTrue:[
-        (#('isNil' 'notNil') includes:aNode selector) ifFalse:[
+        (#(isNil notNil notEmptyOrNil isEmptyOrNil ifNil: ifNotNil:) includes:aNode selector) ifFalse:[
+            "XXX: this warning is wrong, if the message is sent in a while loop
+                  and inside a block that checks for nil."
             self warnIfPossiblyUninitializedLocal:aNode receiver.
         ].
         aNode arguments do:[:eachArg |
@@ -2882,6 +2885,7 @@
 
     "Created: / 19-01-2012 / 10:44:05 / cg"
     "Modified: / 08-02-2019 / 17:22:07 / Claus Gittinger"
+    "Modified (format): / 04-03-2019 / 12:15:51 / Stefan Vogel"
 !
 
 checkReturnedValues
@@ -4896,9 +4900,14 @@
         self
             warning:'"',expr name,'" is uninitialized here (always nil)'
             position:(expr startPosition) to:(expr endPosition).
+        alreadyWarnedUninitializedVars isNil ifTrue:[
+            alreadyWarnedUninitializedVars := Set new
+        ].
+        alreadyWarnedUninitializedVars add:expr name.
     ].
 
     "Created: / 08-02-2019 / 17:14:16 / Claus Gittinger"
+    "Modified (format): / 04-03-2019 / 12:20:01 / Stefan Vogel"
 !
 
 warnSTXHereExtensionUsedAt:position