'From Croquet1.0beta of 11 April 2006 [latest update: #1] on 7 October 2010 at 9:18:31 am'! !PositionableStream methodsFor: 'fileIn/Out' stamp: 'eem 5/15/2009 11:29'! nextChunkNoTag "Answer the contents of the receiver, up to the next terminator character. Doubled terminators indicate an embedded terminator character. Unlike nextChunk, do not look for ]lang[ tags." | terminator out ch | terminator := $!!. out := WriteStream on: (String new: 1000). self skipSeparators. [(ch := self next) == nil] whileFalse: [ch == terminator ifTrue: [self peek == terminator ifTrue:"skip doubled terminator" [self next] ifFalse: [^out contents "terminator is not doubled; we're done!!"]]. out nextPut: ch]. ^out contents! ! Object subclass: #StdioListener instanceVariableNames: 'quitOnEof stdin stdout stderr' classVariableNames: '' poolDictionaries: '' category: 'MicroSqueak-Tools'! !StdioListener methodsFor: 'initialize-release' stamp: 'eem 5/14/2009 17:35'! initialize quitOnEof := true. stdin := CrLfFileStream stdin. stdout := CrLfFileStream stdout. stderr := CrLfFileStream stderr! ! !StdioListener methodsFor: 'accessing' stamp: 'eem 5/14/2009 17:36'! quitOnEof ^quitOnEof! ! !StdioListener methodsFor: 'accessing' stamp: 'eem 5/14/2009 17:36'! quitOnEof: aBoolean quitOnEof := aBoolean! ! !StdioListener methodsFor: 'run loop' stamp: 'eem 5/14/2009 17:46'! logError: errMsg inContext: aContext to: aStream aStream nextPutAll: errMsg; cr. aContext errorReportOn: aStream. aStream cr! ! !StdioListener methodsFor: 'run loop' stamp: 'eem 5/15/2009 14:24'! run [stdin atEnd] whileFalse: [| nextChunk | stdout nextPutAll: 'squeak> '; flush. nextChunk := stdin nextChunkNoTag. Transcript cr; nextPutAll: nextChunk; cr; flush. [stdout print: (Compiler evaluate: nextChunk); cr; flush] on: Error do: [:ex| self logError: ex description inContext: ex signalerContext to: stderr]]. quitOnEof ifTrue: [Smalltalk snapshot: false andQuit: true]! !