File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ import * as fs from "fs";
22import * as path from "path" ;
33import * as ts from "typescript" ;
44
5+ import * as tstl from "./LuaAST" ;
6+
57import { CompilerOptions , LuaLibImportKind } from "./CompilerOptions" ;
68import { LuaPrinter } from "./LuaPrinter" ;
79import { LuaTransformer } from "./LuaTransformer" ;
@@ -111,6 +113,13 @@ export class LuaTranspiler {
111113 return this . luaPrinter . print ( luaAST , lualibFeatureSet ) ;
112114 }
113115
116+ public transpileSourceFileKeepAST ( sourceFile : ts . SourceFile ) : [ tstl . Block , string ] {
117+ // Transform AST
118+ const [ luaAST , lualibFeatureSet ] = this . luaTransformer . transformSourceFile ( sourceFile ) ;
119+ // Print AST
120+ return [ luaAST , this . luaPrinter . print ( luaAST , lualibFeatureSet ) ] ;
121+ }
122+
114123 public reportDiagnostic ( diagnostic : ts . Diagnostic ) : void {
115124 if ( diagnostic . file ) {
116125 const { line, character} = diagnostic . file . getLineAndCharacterOfPosition ( diagnostic . start ! ) ;
You can’t perform that action at this time.
0 commit comments