go-ethereum/ethereum/repl/repl_windows.go

25 lines
372 B
Go
Raw Normal View History

2014-07-15 13:34:25 -05:00
package ethrepl
2014-05-17 08:15:46 -05:00
import (
"bufio"
"fmt"
"os"
)
func (self *JSRepl) read() {
reader := bufio.NewReader(os.Stdin)
for {
2014-05-19 06:04:31 -05:00
fmt.Printf(self.prompt)
2014-05-17 08:15:46 -05:00
str, _, err := reader.ReadLine()
if err != nil {
fmt.Println("Error reading input", err)
} else {
self.parseInput(string(str))
}
}
}
2014-05-19 09:32:45 -05:00
func (self *JSRepl) PrintValue(value otto.Value) {
fmt.Println(value)
}