mirror of
https://gitlab.com/pulsechaincom/go-pulse.git
synced 2024-12-26 13:18:22 +00:00
25 lines
372 B
Go
25 lines
372 B
Go
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)
|
|
}
|