restructure
This commit is contained in:
parent
edcbfde351
commit
eebaadc16e
21 changed files with 937 additions and 626 deletions
31
cli/main.go
Normal file
31
cli/main.go
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
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")
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue