#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Wed, 07 Mar 2018 20:58:15 +0100
changeset 22601 8258751a7465
parent 22600 ca4fea0b5b62
child 22602 720e9d06bab7
#FEATURE by cg class: Context added: #printWithSeparator:on: changed: #printOn:
Context.st
--- a/Context.st	Wed Mar 07 20:57:40 2018 +0100
+++ b/Context.st	Wed Mar 07 20:58:15 2018 +0100
@@ -2057,41 +2057,7 @@
 printOn:aStream
     "append a brief description (excl. arguments) of the receiver onto aStream"
 
-    | m |
-
-    self printReceiverOn:aStream.
-    "/ aStream nextPutAll:' '.
-    aStream nextPutAll:' >> '.
-
-    aStream bold.
-    m := self method.
-    m isJavaMethod ifTrue:[
-	aStream nextPutAll: (m printStringForBrowserWithSelector: self selector).
-    ] ifFalse:[
-	self selector printOn:aStream.    "show as string (as symbol looks too ugly in browser ...)"
-	"/ self selector storeOn:aStream.    "show as symbol"
-    ].
-    aStream normal.
-
-    (method notNil and:[method isWrapped]) ifTrue:[
-	aStream nextPutAll:' (wrapped) '
-    ].
-    aStream nextPutAll:' ['.
-    m isJavaMethod ifTrue:[
-	aStream nextPutAll: self method mclass sourceFile ? '???' .
-	m isNative ifTrue:[
-	    aStream nextPutAll: ':in native code'
-	] ifFalse:[
-	    aStream nextPut: $:.
-	    (m lineNumberForPC0: lineNr) ? '???' printOn: aStream.
-	].
-    ] ifFalse:[
-	self lineNumber printOn: aStream
-    ].
-    aStream nextPut:$].
-
-    "Modified: / 05-08-2012 / 12:00:00 / cg"
-    "Modified: / 08-08-2014 / 07:37:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    self printWithSeparator:' >> ' on:aStream
 !
 
 printReceiverOn:aStream
@@ -2180,6 +2146,46 @@
     "Modified: / 05-02-2014 / 17:50:33 / cg"
 !
 
+printWithSeparator:sep on:aStream
+    "append a brief description (excl. arguments) of the receiver onto aStream"
+
+    | m |
+
+    self printReceiverOn:aStream.
+    "/ aStream nextPutAll:' '.
+    aStream nextPutAll:sep.
+
+    aStream bold.
+    m := self method.
+    m isJavaMethod ifTrue:[
+        aStream nextPutAll: (m printStringForBrowserWithSelector: self selector).
+    ] ifFalse:[
+        self selector printOn:aStream.    "show as string (as symbol looks too ugly in browser ...)"
+        "/ self selector storeOn:aStream.    "show as symbol"
+    ].
+    aStream normal.
+
+    (method notNil and:[method isWrapped]) ifTrue:[
+        aStream nextPutAll:' (wrapped) '
+    ].
+    aStream nextPutAll:' ['.
+    m isJavaMethod ifTrue:[
+        aStream nextPutAll: self method mclass sourceFile ? '???' .
+        m isNative ifTrue:[
+            aStream nextPutAll: ':in native code'
+        ] ifFalse:[
+            aStream nextPut: $:.
+            (m lineNumberForPC0: lineNr) ? '???' printOn: aStream.
+        ].
+    ] ifFalse:[
+        self lineNumber printOn: aStream
+    ].
+    aStream nextPut:$].
+
+    "Modified: / 05-08-2012 / 12:00:00 / cg"
+    "Modified: / 08-08-2014 / 07:37:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 receiverPrintString
     "return a string describing the receiver of the context"