diff --git a/compiler/2c.js b/compiler/2c.js index 8ad450f9..e637e5ee 100644 --- a/compiler/2c.js +++ b/compiler/2c.js @@ -35,7 +35,10 @@ const todo = msg => { throw new TodoError(`todo: ${msg}`); }; -const removeBrackets = str => str.startsWith('(') && str.endsWith(')') ? str.slice(1, -1) : str; +const removeBrackets = str => { + if (str.startsWith('(long)(unsigned long)')) return '(long)(unsigned long)(' + removeBrackets(str.slice(22, -1)) + ')'; + return str.startsWith('(') && str.endsWith(')') ? str.slice(1, -1) : str; +}; export default ({ funcs, globals, tags, exceptions, pages }) => { const invOperatorOpcode = Object.values(operatorOpcode).reduce((acc, x) => { diff --git a/compiler/index.js b/compiler/index.js index 43e43dc0..139bf32b 100644 --- a/compiler/index.js +++ b/compiler/index.js @@ -82,6 +82,8 @@ export default (code, flags) => { } else { console.log(c); } + + if (process.version) process.exit(); } if (target === 'native') { @@ -96,6 +98,8 @@ export default (code, flags) => { // obvious command escape is obvious execSync(args.join(' '), { stdio: 'inherit' }); + + if (process.version) process.exit(); } return out;