mirror of https://github.com/ethereum/go-ethereum
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
372 B
25 lines
372 B
10 years ago
|
package ethrepl
|
||
11 years ago
|
|
||
|
import (
|
||
|
"bufio"
|
||
|
"fmt"
|
||
|
"os"
|
||
|
)
|
||
|
|
||
|
func (self *JSRepl) read() {
|
||
|
reader := bufio.NewReader(os.Stdin)
|
||
|
for {
|
||
11 years ago
|
fmt.Printf(self.prompt)
|
||
11 years ago
|
str, _, err := reader.ReadLine()
|
||
|
if err != nil {
|
||
|
fmt.Println("Error reading input", err)
|
||
|
} else {
|
||
|
self.parseInput(string(str))
|
||
|
}
|
||
|
}
|
||
|
}
|
||
11 years ago
|
|
||
|
func (self *JSRepl) PrintValue(value otto.Value) {
|
||
|
fmt.Println(value)
|
||
|
}
|