import { createMemoryStream, main } from "assemblyscript/asc";
export const compiler = {
    compile: main,
};
export class CompilationError extends Error {
    constructor(errorMessage) {
        super(errorMessage);
        this.name = "CompilationError";
    }
}
export async function ascMain(ascArgv) {
    const stderr = createMemoryStream();
    const { error } = await compiler.compile(ascArgv.concat("--noColors"), { stderr });
    if (error) {
        throw new CompilationError(stderr.toString());
    }
}
//# sourceMappingURL=ascWrapper.js.map