diff options
author | obscuren <geffobscura@gmail.com> | 2014-07-16 02:34:25 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-07-16 02:34:25 +0800 |
commit | 28948d061cfc14d7a5da307a12ebd504b78d2dbb (patch) | |
tree | 168772cef16e9fb7eea6727d4ae254097d277ce1 /ethereum/repl/repl_windows.go | |
parent | 288f1c5387c1a0a8863499389e8a7ca7e3068208 (diff) | |
download | go-tangerine-28948d061cfc14d7a5da307a12ebd504b78d2dbb.tar go-tangerine-28948d061cfc14d7a5da307a12ebd504b78d2dbb.tar.gz go-tangerine-28948d061cfc14d7a5da307a12ebd504b78d2dbb.tar.bz2 go-tangerine-28948d061cfc14d7a5da307a12ebd504b78d2dbb.tar.lz go-tangerine-28948d061cfc14d7a5da307a12ebd504b78d2dbb.tar.xz go-tangerine-28948d061cfc14d7a5da307a12ebd504b78d2dbb.tar.zst go-tangerine-28948d061cfc14d7a5da307a12ebd504b78d2dbb.zip |
Moved the repl to a new package
Diffstat (limited to 'ethereum/repl/repl_windows.go')
-rw-r--r-- | ethereum/repl/repl_windows.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/ethereum/repl/repl_windows.go b/ethereum/repl/repl_windows.go new file mode 100644 index 000000000..4106c89bc --- /dev/null +++ b/ethereum/repl/repl_windows.go @@ -0,0 +1,24 @@ +package ethrepl + +import ( + "bufio" + "fmt" + "os" +) + +func (self *JSRepl) read() { + reader := bufio.NewReader(os.Stdin) + for { + fmt.Printf(self.prompt) + str, _, err := reader.ReadLine() + if err != nil { + fmt.Println("Error reading input", err) + } else { + self.parseInput(string(str)) + } + } +} + +func (self *JSRepl) PrintValue(value otto.Value) { + fmt.Println(value) +} |