Check-in [fc0b463347]
Not logged in
Overview
SHA1 Hash:fc0b46334714be41ff2b8ead07f54bf29e520aa0
Date: 2010-12-05 00:15:28
User: kinaba
Comment:Made the repl terminate by EOF (thanks yhamigaki!)
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | manifest
Tags And Properties
Changes

Modified polemy/repl.d from [4d8d31e11afa4a19] to [b98f6cda3b1606b7].

9 9 import polemy.layer; 10 10 import polemy.eval; 11 11 import polemy.runtime; 12 12 import polemy.value; 13 13 import polemy.valueconv; 14 14 import std.stdio; 15 15 import std.string; 16 +import std.cstream; 16 17 17 18 enum VersionNoMajor = 0; /// Version Number 18 19 enum VersionNoMinor = 1; /// Version Number 19 20 enum VersionNoRev = 0; /// Version Number 20 21 21 22 /// Read-Eval-Print-Loop 22 23 ................................................................................ 49 50 } 50 51 51 52 /// Read one line from stdin, and do some reaction 52 53 bool singleInteraction() 53 54 { 54 55 writef(">> ", lineno); 55 56 string line = readln(); 56 - if( line.startsWith("exit") || line.startsWith("quit") ) 57 + if( line.startsWith("exit") || line.startsWith("quit") || din.eof() ) 57 58 return false; 58 59 try { 59 60 if( tryRun(line) ) 60 61 writeln(lastVal); 61 62 } catch(Throwable e) { 62 63 writeln(e); 63 64 }