showCr: -> showCR:
authorClaus Gittinger <cg@exept.de>
Sat, 18 May 1996 16:04:40 +0200
changeset 273 2758f1723f53
parent 272 04bf9e0c89da
child 274 8e120bd82c69
showCr: -> showCR:
Parser.st
--- a/Parser.st	Sat May 18 16:02:50 1996 +0200
+++ b/Parser.st	Sat May 18 16:04:40 1996 +0200
@@ -1557,7 +1557,7 @@
     or:[(self instVarNames notNil and:[self instVarNames includes:aSelectorString])
     or:[(self classInstVarNames notNil and:[self classInstVarNames includes:aSelectorString])
     or:[(self classVarNames notNil and:[self classVarNames includes:aSelectorString])]]]]) ifTrue:[
-	err := ' is currently nowhere implemented ..
+        err := ' is currently nowhere implemented ..
 .. but a variable with that name is defined. 
 
 Missing ''.'' after the previous expression 
@@ -1571,89 +1571,99 @@
     ok := false.
     sym := aSelectorString asSymbolIfInterned.
     sym notNil ifTrue:[
-	ok := true.
-	receiver notNil ifTrue:[
-	    "
-	     if the receiver is a constant, we can check if it responds
-	     to this selector
-	    "
-	    receiver isConstant ifTrue:[
-		rec := receiver evaluate.
-		ok := rec respondsTo:sym.
-		err := ' will not be understood here (message to ' , rec classNameWithArticle , ')'.
-	    ] ifFalse:[
-		receiver isBlock ifTrue:[
-		    "/ this should help with typos, sending #ifTrue to blocks ...
-		    ok := [] respondsTo:sym.
-		    err := ' will not be understood here (message to a Block)'.
-		] ifFalse:[
-		    "
-		     if the receiver is a global, we check it too ...
-		    "
-		    receiver type == #GlobalVariable ifTrue:[
-			"dont check autoloaded classes - it may work after
-			 loading"
-
-			rec := receiver evaluate. 
-			(rec notNil 
-			 and:[rec isBehavior
-			 and:[rec isLoaded not]]) ifTrue:[^ aSelectorString].
-
-			ok := rec respondsTo:sym.
-			err := ' may not be understood here (is currently ' , rec classNameWithArticle , ')'.
-		    ] ifFalse:[
-			"if its a super send, we can do more checking"
-			receiver isSuper ifTrue:[
-			    receiver isHere ifFalse:[
-				((superCls := classToCompileFor superclass) notNil
-				and:[(superCls whichClassIncludesSelector:sym) isNil]) ifTrue:[
-				    err := ' is currently not implemented in any superclass'.
-				    ok := false
-				]
-			    ] ifTrue:[
-				(classToCompileFor whichClassIncludesSelector:sym) isNil ifTrue:[
-				    err := ' is currently not implemented in this class'.
-				    ok := false
-				]
-			    ]
-			].
-
-			(receiver isUnaryMessage
-			and:[receiver selector == #class
-			and:[receiver receiver type == #Self]]) ifTrue:[
-			    "its a message to self class - can check this too ..."
-			    (classToCompileFor class whichClassIncludesSelector:sym) isNil ifTrue:[
-				ok := false.
-				classToCompileFor allSubclasses do:[:subclass |
-				    (subclass class implements:sym) ifTrue:[
-					ok := true
-				    ]
-				].
-				err := ' is currently not implemented in the class'.
-			    ]
-			]
-		    ]
-		]
-	    ]
-	]
+        ok := true.
+        receiver notNil ifTrue:[
+            "
+             if the receiver is a constant, we can check if it responds
+             to this selector
+            "
+            receiver isConstant ifTrue:[
+                rec := receiver evaluate.
+                ok := rec respondsTo:sym.
+                err := ' will not be understood here (message to ' , rec classNameWithArticle , ')'.
+            ] ifFalse:[
+                receiver isBlock ifTrue:[
+                    "/ this should help with typos, sending #ifTrue to blocks ...
+                    ok := [] respondsTo:sym.
+                    err := ' will not be understood here (message to a Block)'.
+                ] ifFalse:[
+                    "
+                     if the receiver is a global, we check it too ...
+                    "
+                    receiver type == #GlobalVariable ifTrue:[
+                        "dont check autoloaded classes - it may work after
+                         loading"
+
+                        rec := receiver evaluate. 
+                        (rec notNil 
+                         and:[rec isBehavior
+                         and:[rec isLoaded not]]) ifTrue:[
+                            ^ aSelectorString
+                        ].
+
+                        ok := rec respondsTo:sym.
+                        ok ifFalse:[
+                            "if it implements #doesNotUnderstand, assume its ok"
+                            (rec class implements:#doesNotUnderstand:) ifTrue:[
+                                ^ aSelectorString
+                            ]
+                        ].
+
+                        err := ' may not be understood here (is currently ' , rec classNameWithArticle , ')'.
+                    ] ifFalse:[
+                        "if its a super send, we can do more checking"
+                        receiver isSuper ifTrue:[
+                            receiver isHere ifFalse:[
+                                ((superCls := classToCompileFor superclass) notNil
+                                and:[(superCls whichClassIncludesSelector:sym) isNil]) ifTrue:[
+                                    err := ' is currently not implemented in any superclass'.
+                                    ok := false
+                                ]
+                            ] ifTrue:[
+                                (classToCompileFor whichClassIncludesSelector:sym) isNil ifTrue:[
+                                    err := ' is currently not implemented in this class'.
+                                    ok := false
+                                ]
+                            ]
+                        ].
+
+                        (receiver isUnaryMessage
+                        and:[receiver selector == #class
+                        and:[receiver receiver type == #Self]]) ifTrue:[
+                            "its a message to self class - can check this too ..."
+                            (classToCompileFor class whichClassIncludesSelector:sym) isNil ifTrue:[
+                                ok := false.
+                                classToCompileFor allSubclasses do:[:subclass |
+                                    (subclass class implements:sym) ifTrue:[
+                                        ok := true
+                                    ]
+                                ].
+                                err := ' is currently not implemented in the class'.
+                            ]
+                        ]
+                    ]
+                ]
+            ]
+        ]
     ].
 
     ok ifFalse:[
 
 "OLD: "
-	self warning:('#' , aSelectorString , err) position:pos1 to:pos2
+        self warning:('#' , aSelectorString , err) position:pos1 to:pos2
 " "   
 
 "NEW:    - not finished - need more interfaces
    (currently produces warning output on Transcript while filing in
 
 
-	^ self correctSelector:aSelectorString message:('#' , aSelectorString , err) position:pos1 to:pos2
+        ^ self correctSelector:aSelectorString message:('#' , aSelectorString , err) position:pos1 to:pos2
 "
     ].
     ^ aSelectorString
 
     "Modified: 5.9.1995 / 17:02:11 / claus"
+    "Modified: 18.5.1996 / 15:41:22 / cg"
 ! !
 
 !Parser methodsFor:'error handling'!
@@ -1725,40 +1735,43 @@
     |text|
 
     ignoreErrors ifFalse:[
-	Smalltalk silentLoading == true ifFalse:[
-	    Transcript show:(pos printString).
-	    Transcript show:' '.
-	    selector notNil ifTrue:[
-		Transcript show:aMessage.
-		classToCompileFor notNil ifTrue:[
-		    text := ' in ' , classToCompileFor name , '>>' , selector
-		] ifFalse:[
-		    text := ' in ' , selector
-		]
-	    ] ifFalse:[
-		classToCompileFor notNil ifTrue:[
-		    text := aMessage , ' (' , classToCompileFor name , ')'
-		] ifFalse:[
-		    text := aMessage
-		]
-	    ].
-	    Transcript showCr:text.
-	]
+        Smalltalk silentLoading == true ifFalse:[
+            Transcript show:(pos printString).
+            Transcript show:' '.
+            selector notNil ifTrue:[
+                Transcript show:aMessage.
+                classToCompileFor notNil ifTrue:[
+                    text := ' in ' , classToCompileFor name , '>>' , selector
+                ] ifFalse:[
+                    text := ' in ' , selector
+                ]
+            ] ifFalse:[
+                classToCompileFor notNil ifTrue:[
+                    text := aMessage , ' (' , classToCompileFor name , ')'
+                ] ifFalse:[
+                    text := aMessage
+                ]
+            ].
+            Transcript showCR:text.
+        ]
     ]
+
+    "Modified: 18.5.1996 / 15:44:15 / cg"
 !
 
 showErrorMessageForClass:aClass
 "/        compiler parseError:'syntax error'.
     Transcript show:'    '.
     aClass notNil ifTrue:[
-	Transcript show:aClass name , '>>'
+        Transcript show:aClass name , '>>'
     ].
     selector notNil ifTrue:[
-	Transcript show:(selector)
+        Transcript show:(selector)
     ].
-    Transcript showCr:' -> Error'.
+    Transcript showCR:' -> Error'.
 
     "Created: 13.12.1995 / 20:24:34 / cg"
+    "Modified: 18.5.1996 / 15:44:17 / cg"
 !
 
 undefError:aName position:pos1 to:pos2
@@ -3467,6 +3480,6 @@
 !Parser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.78 1996-04-27 18:06:40 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.79 1996-05-18 14:04:40 cg Exp $'
 ! !
 Parser initialize!