summaryrefslogtreecommitdiff
path: root/tools/ts_library_builder/ast_util.ts
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2018-11-05 16:07:11 +1100
committerRyan Dahl <ry@tinyclouds.org>2018-11-05 07:17:47 -0800
commit5e48a681c4d6d6cb3debb4024b5108780dbbad90 (patch)
tree0def78c67885a2752d3227836ac489066c211aed /tools/ts_library_builder/ast_util.ts
parentbd88e56cbc6e64da471b379f996bac6c564a7e1e (diff)
Fix issue with runtime lib generation.
Diffstat (limited to 'tools/ts_library_builder/ast_util.ts')
-rw-r--r--tools/ts_library_builder/ast_util.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/ts_library_builder/ast_util.ts b/tools/ts_library_builder/ast_util.ts
index 81fc45f0c..528036b99 100644
--- a/tools/ts_library_builder/ast_util.ts
+++ b/tools/ts_library_builder/ast_util.ts
@@ -58,6 +58,14 @@ export function addVariableDeclaration(
});
}
+/** Copy one source file to the end of another source file. */
+export function appendSourceFile(
+ sourceFile: SourceFile,
+ targetSourceFile: SourceFile
+): void {
+ targetSourceFile.addStatements(`\n${sourceFile.print()}`);
+}
+
/** Check diagnostics, and if any exist, exit the process */
export function checkDiagnostics(project: Project, onlyFor?: string[]) {
const program = project.getProgram();