go-ethereum/ethereum/repl_windows.go

25 lines
369 B
Go
Raw Normal View History

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