31 lines
432 B
Go
31 lines
432 B
Go
package main
|
|
|
|
import (
|
|
"bufio"
|
|
"fmt"
|
|
"os"
|
|
|
|
loxgo "git.red-panda.pet/pandaware/lox-go"
|
|
"git.red-panda.pet/pandaware/lox-go/reporter"
|
|
)
|
|
|
|
var (
|
|
file string
|
|
)
|
|
|
|
func main() {
|
|
reporter.SetLevel(reporter.LevelDebug)
|
|
|
|
s := bufio.NewScanner(os.Stdin)
|
|
for {
|
|
fmt.Printf("repl> ")
|
|
s.Scan()
|
|
|
|
loxgo.Run(s.Text())
|
|
if err := s.Err(); err != nil {
|
|
reporter.Fatal(1, -1, "repl", "stdin", err.Error())
|
|
}
|
|
|
|
fmt.Printf("\n")
|
|
}
|
|
}
|