diff --git a/cmd/scpt/main.go b/cmd/scpt/main.go new file mode 100644 index 0000000..9fbd2c0 --- /dev/null +++ b/cmd/scpt/main.go @@ -0,0 +1,27 @@ +package main + +import ( + "flag" + "gitea.arsenm.dev/Arsen6331/scpt" + "log" + "os" +) + +func main() { + filePath := flag.String("file", "", "File to parse") + flag.Parse() + + if *filePath == "" { + log.Fatalln("Use --file to specify a file to parse") + } + + file, err := os.Open(*filePath) + if err != nil { + log.Fatalln("Error opening specified file:", err) + } + ast, err := scpt.Parse(file) + if err != nil { + log.Fatalln("Error parsing file:", err) + } + ast.Execute() +} \ No newline at end of file