hylia/main.go

32 lines
524 B
Go
Raw Normal View History

package main
import (
"fmt"
"os"
"hylia/parser"
"hylia/compiler"
)
func main() {
if len(os.Args) < 3 {
fmt.Println("Usage: hylia <input.hy> <output.html>")
return
}
inputFile := os.Args[1]
outputFile := os.Args[2]
parsedElememts, err := parser.ParseFile(inputFile)
if err != nil {
fmt.Printf("ERROR! %v\n", err)
os.Exit(1)
}
err = compiler.Compile(parsedElememts, outputFile)
if err != nil {
fmt.Printf("ERROR! %v\n", err)
os.Exit(1)
}
fmt.Println("SUCCESS! Output saved to ", outputFile)
}