write code in stream mode

This commit is contained in:
Jordi Baylina
2020-01-27 13:08:11 +07:00
parent 20058a38d6
commit 3a9766a008
9 changed files with 108 additions and 45 deletions

View File

@@ -83,7 +83,8 @@ async function compile(srcFile, options) {
if (options.cSourceWriteStream) {
const cSrc = buildC(ctx);
options.cSourceWriteStream.write(cSrc);
cSrc.pipe(options.cSourceWriteStream);
await new Promise(fulfill => options.cSourceWriteStream.on("finish", fulfill));
}
// const mainCode = gen(ctx,ast);