ReadEvalPrintLoop.st
changeset 20911 1c11be64f4a1
parent 20910 d97034358023
child 20912 fc5c40cbdb26
equal deleted inserted replaced
20910:d97034358023 20911:1c11be64f4a1
   647      If chunkFormat is true, chunks are read.
   647      If chunkFormat is true, chunks are read.
   648      Otherwise, lines up to an empty line (or EOF) or a line ending in '.' are read.
   648      Otherwise, lines up to an empty line (or EOF) or a line ending in '.' are read.
   649      A '#' character appearing in the first column of the first line turns off chunkmode,
   649      A '#' character appearing in the first column of the first line turns off chunkmode,
   650      which allows for convenient shell scripts containing a #/bin/stx as the first line."
   650      which allows for convenient shell scripts containing a #/bin/stx as the first line."
   651 
   651 
       
   652     exitAction := [^ self].
       
   653 
   652     [
   654     [
   653         |lines chunk|
   655         |lines chunk|
   654 
   656 
   655         prompt notNil ifTrue:[
   657         prompt notNil ifTrue:[
   656             error nextPutAll:prompt.
   658             error nextPutAll:prompt.
   772      If the chunkFormat-argument is true, chunks are read.
   774      If the chunkFormat-argument is true, chunks are read.
   773      Otherwise, lines up to an empty line (or EOF) are read.
   775      Otherwise, lines up to an empty line (or EOF) are read.
   774      A '#' character appearing in the first column of the first line
   776      A '#' character appearing in the first column of the first line
   775      switches to chunkmode."
   777      switches to chunkmode."
   776 
   778 
   777     exitAction := [^ self].
       
   778 
       
   779     ControlInterrupt handle:[:ex |
   779     ControlInterrupt handle:[:ex |
   780         self errorStream nextPutLine:('Caught: ', ex description).
   780         self errorStream nextPutLine:('Caught: ', ex description).
   781         self inputStream atEnd ifTrue:[
   781         self inputStream atEnd ifTrue:[
   782             ex return.
   782             ex return.
   783         ].    
   783         ].