Parser.st
changeset 1193 c441d3b202e5
parent 1190 8600334a549e
child 1196 83da458b0a24
--- a/Parser.st	Tue Oct 02 13:29:42 2001 +0200
+++ b/Parser.st	Tue Oct 02 13:36:06 2001 +0200
@@ -1950,6 +1950,10 @@
     evalExitBlock := aBlock
 !
 
+foo
+    ^ super bar
+!
+
 getNameSpace
     "retrieve the nameSpace, as found in a Namespace directive"
 
@@ -4426,15 +4430,22 @@
             self rememberSelectorUsed:sel receiver:lastReceiver
         ].
 
-        (sel = #and: 
-        or:[sel = #or:]) ifTrue:[
+"/        (contextToEvaluateIn isNil and:[selfValue isNil]) ifTrue:[    "/ do not check this for doits
+"/            receiver isSuper ifTrue:[
+"/                sel ~= selector ifTrue:[
+"/                    self warnCommonMistake:'possible bad super message (selector should be same as in current method) ?'
+"/                                  position:posR1 to:posR2-1
+"/                ].
+"/            ].
+"/        ].
+"/
+        (sel = #and: or:[sel = #or:]) ifTrue:[
             receiver arg1 isBlock ifFalse:[
                 self warnCommonMistake:'(possible common mistake) missing block brackets ?'
                               position:pos2+1 to:tokenPosition-1
             ]
         ].
-        (sel = #whileTrue: 
-        or:[sel = #whileFalse:]) ifTrue:[
+        (sel = #whileTrue: or:[sel = #whileFalse:]) ifTrue:[
             receiver receiver isBlock ifFalse:[
                 self warnCommonMistake:'(possible common mistake) missing block brackets ?'
                               position:posR1 to:posR2-1
@@ -5016,7 +5027,7 @@
 unaryExpression
     "parse a unary-expression; return a node-tree, nil or #Error"
 
-    |receiver thisReceiver sel pos pos2 try|
+    |receiver thisReceiver sel pos pos2 try note|
 
     receiver := self primary.
     (receiver == #Error) ifTrue:[^ #Error].
@@ -5035,6 +5046,10 @@
         ] ifFalse:[
             receiver := try
         ].
+        note := self plausibilityCheck:receiver.
+        note notNil ifTrue:[
+            self warning:note position:pos to:pos2
+        ].
         receiver lineNumber:tokenLineNr.
         parseForCode ifFalse:[
             self rememberSelectorUsed:sel receiver:thisReceiver
@@ -5510,10 +5525,21 @@
 !
 
 plausibilityCheck:aNode
-    ^ aNode plausibilityCheck
-
-    "Created: / 19.10.1998 / 19:56:09 / cg"
-    "Modified: / 19.10.1998 / 19:56:29 / cg"
+    |note|
+
+    note := aNode plausibilityCheck.
+    note isNil ifTrue:[
+        aNode isMessage ifTrue:[
+            (contextToEvaluateIn isNil and:[selfValue isNil]) ifTrue:[    "/ do not check this for doits
+                aNode receiver isSuper ifTrue:[
+                    aNode selector ~= selector ifTrue:[
+                        ^ 'possible bad super message (selector should be same as in current method) ?'
+                    ].
+                ].
+            ].
+        ].
+    ].
+    ^ note
 ! !
 
 !Parser methodsFor:'queries'!
@@ -5965,6 +5991,6 @@
 !Parser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.300 2001-09-28 15:54:00 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.301 2001-10-02 11:36:06 cg Exp $'
 ! !
 Parser initialize!