ReadEvalPrintLoop.st
changeset 20833 58ae6ff92df5
parent 20774 a29ae1f5f429
child 20834 92fe48284264
--- a/ReadEvalPrintLoop.st	Sat Nov 05 12:41:16 2016 +0100
+++ b/ReadEvalPrintLoop.st	Sat Nov 05 12:46:48 2016 +0100
@@ -42,20 +42,24 @@
 "
     A simple read-eval-print loop for non-GUI or stscript operation.
     Invoked, for example if stx is started with a --repl argument.
-.
+
     A line starting with '?' shows the usage message.
     Lines starting with '#' are directives:
-	#exit   - exit the rep-loop
-
+        #exit   - exit the rep-loop
+        type '?' to see more.
+        
     The input can be in one of two formats:
-	1) traditional chunk format (bang-separated chunks, bangs duplicated)
-	  this is the traditional fileIn format, as generated by fileOut from the browser
+        1) traditional chunk format (bang-separated chunks, bangs duplicated)
+          this is the traditional fileIn format, as generated by fileOut from the browser
 
-	2) interactive line mode. Chunks are any number of lines up to either an empty line or
-	  a line ending in a period. This is more useful for an interactive REPL, where statements/expressions
-	  are entered linewise by a user.
+        2) interactive line mode. Chunks are any number of lines up to either an empty line or
+          a line ending in a period. This is more useful for an interactive REPL, where statements/expressions
+          are entered linewise by a user.
 
     The input can is switched to non-chunk format whenever a line with a '#' in the first column appears.
+
+    [Author:]
+        Claus Gittinger
 "
 ! !
 
@@ -576,6 +580,9 @@
 
     ControlInterrupt handle:[:ex |
         self errorStream nextPutLine:('Caught: ', ex description).
+        self inputStream atEnd ifTrue:[
+            ex return.
+        ].    
         ex restart.
     ] do:[
         |input output error compilerClass|
@@ -593,6 +600,7 @@
         StreamError handle:[:ex |
             (input isOpen not or:[input atEnd]) ifTrue:[
                 error nextPutLine:'EOF on input'.
+                ex return.
             ].    
             (output isOpen not) ifTrue:[
                 error nextPutLine:'no output'.