package main

import (
	"fmt"
	"os"

	"github.com/jorenchik/mdemory/src/compiler/api"
)

func main() {
	file, err := os.ReadFile(
		"/home/jorenchik/Code/mdemory/src/compiler/input.mdem",
	)
	if (err != nil) { 
		fmt.Printf(
			"Cannot open the input file: %s\n",
			err.Error(),
		)
		return
	}
	fileContents := string(file)

	fmt.Println("Compilation started...")
    _, err = api.Compile(fileContents)
    if err != nil {
        fmt.Println(err.Error())
        return
    }
	fmt.Println("Compilation completed")
}
