A "high-level" language for the Gameboy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

19 lines
456 B

import { promises } from "fs"
import { basename, resolve } from "path"
import { compile } from "./compile"
const { readFile } = promises
if (process.argv.length !== 3) {
console.error("usage: gbuoy <program.gby>")
process.exit(1)
}
const fileName = process.argv[2]
const localName = basename(resolve(fileName))
readFile(fileName, { encoding: "utf-8" }).then(source => {
const output = compile(localName, source)
console.log(output)
})