Moved the repl to a new package

This commit is contained in:
obscuren
2014-07-15 20:34:25 +02:00
parent 288f1c5387
commit 28948d061c
10 changed files with 105 additions and 76 deletions

View File

@ -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)
}