diff --git a/cli/asc.js b/cli/asc.js index 7a5cfa62ba..98335e8290 100644 --- a/cli/asc.js +++ b/cli/asc.js @@ -223,7 +223,9 @@ exports.main = function main(argv, options, callback) { baseDir: { value: baseDir }, readFile: { value: readFile }, writeFile: { value: writeFile }, - listFiles: { value: listFiles } + listFiles: { value: listFiles }, + log: { value: writeStdout }, + error: { value: (str) => stderr.write(str)} }); transforms.push(new classOrModule()); } else { diff --git a/cli/transform.d.ts b/cli/transform.d.ts index 82085bf878..0d7c5ab294 100644 --- a/cli/transform.d.ts +++ b/cli/transform.d.ts @@ -19,6 +19,12 @@ export abstract class Transform { /** Lists all files in a directory. */ listFiles(dirname: string, baseDir: string): string[] | null; + /** Prints to stdout */ + log(s: string): void; + + /** Prints to stderr */ + error(s: string): void; + /** Called when parsing is complete, before a program is instantiated from the AST. */ afterParse?(parser: Parser): void; }