[net.lang.st80] bugfix in bs goody for printing clas

georg@unido.UUCP (04/01/85)

In the b2 goody for printing out classes in troff format there is a bug which 
causes 
an interrupt printing out methods with empty body.

This is fixed in the following bugfix:
 
Georg Heeg, University of Dortmund, West Germany
georg@unido.UUCP

'From Smalltalk-80, version 2, of April 1, 1983 on 1 April 1985 at 14:15:21'!



!ClassDescription methodsFor: 'fileIn/Out'!

printOutMessage: aString on: aFileStream 
	"Create troff ready file for the method aString"

	| sourceCode bodyStart inComment |
	sourceCode _ self sourceCodeAt: aString asSymbol.
	bodyStart _ sourceCode findString: '\' withCRs startingAt: 1.
	(bodyStart = 0)
		ifTrue:[self printOutMacro: 'MH'
			with: sourceCode
			on: aFileStream.]
		ifFalse:[self printOutMacro: 'MH'
			with: (sourceCode copyFrom: 1 to: (bodyStart - 1))
			on: aFileStream.].
	bodyStart = 0
		ifTrue: 
			[aFileStream tab; nextPutAll: '\(uaself'; cr; nextPutAll: '.ME'; cr.
			^self].
	inComment _ false.
	(sourceCode copyFrom: bodyStart + 1 to: sourceCode size)
		do: [:char |
			char = $^
				ifTrue: [aFileStream nextPutAll: '\(ua']
				ifFalse: [char = $\
					ifTrue: [aFileStream nextPutAll: '\e']
					ifFalse: [char = $~
						ifTrue: [aFileStream nextPutAll: '\(ap']
						ifFalse: [char = $_
							ifTrue: [aFileStream nextPutAll: '\(<-']
							ifFalse: [(char = $') | (char = $.)
								ifTrue: [aFileStream nextPutAll: '\&'; nextPut: char]
								ifFalse: [char = $"
									ifTrue: [aFileStream nextPutAll:
										(inComment ifTrue: ['"\fP'] ifFalse: ['\fI"']).
										inComment _ inComment not]
									ifFalse: [aFileStream nextPut: char]]]]]]].
	(sourceCode at: sourceCode size) ~= Character cr
		ifTrue: [aFileStream cr].
	aFileStream nextPutAll: '.ME'; cr! !