tsll
Version:
Compiler frontend for translating Typescript to LLVM IR
38 lines • 1.36 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var yargs_1 = __importDefault(require("yargs/yargs"));
var converter_1 = require("./converter");
var fs_1 = __importDefault(require("fs"));
var options = {
'emitIR': {
describe: 'Emit LLVM Intermediate Representation to standard output',
requiresArg: false,
boolean: true,
default: true,
require: false
},
'emitBitcode': {
describe: 'Emit LLVM Bitcode to a specific file',
requiresArg: false,
string: true,
default: 'llvm.bc',
require: false
}
};
var argv = yargs_1.default(process.argv.slice(2)).options(options).help().string('_').check(function (argv) {
var filePaths = argv._;
if (filePaths.length === 0)
throw new Error('At least one file should be provided.');
var allExist = filePaths.every(function (filePath) { return fs_1.default.existsSync(filePath); });
if (!allExist)
throw new Error('Filepath does not exist.');
return allExist;
}).fail(function (msg) {
console.log(msg);
}).parseSync();
converter_1.convert(argv._, argv.emitIR, argv.emitBitcode);
//# sourceMappingURL=cli.js.map