32 lines
No EOL
546 B
Go
32 lines
No EOL
546 B
Go
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, variables, err := parser.ParseFile(inputFile)
|
|
if err != nil {
|
|
fmt.Printf("ERROR! %v\n", err)
|
|
os.Exit(1)
|
|
}
|
|
|
|
err = compiler.Compile(parsedElememts, variables, outputFile)
|
|
if err != nil {
|
|
fmt.Printf("ERROR! %v\n", err)
|
|
os.Exit(1)
|
|
}
|
|
|
|
fmt.Println("SUCCESS! Output saved to ", outputFile)
|
|
} |