elysium/main.go
2024-03-10 22:48:57 +01:00

26 lines
360 B
Go

// The compiler
package main
import (
"log"
"os"
)
func main() {
if len(os.Args) != 2 {
log.Fatalln("Usage: " + os.Args[0] + " <file>")
}
content, err := os.ReadFile(os.Args[1])
if err != nil {
log.Fatalln("Cannot open input file.", err)
}
ast, err := lexer(string(content))
if err != nil {
log.Fatalln(err)
}
log.Printf("%+#v\n", ast)
}