Skip to content

Commit be51ac2

Browse files
committed
Add Lua AST to TranspiledFile interface
1 parent d5b8e65 commit be51ac2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Transpile.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ function getCustomTransformers(
3636
}
3737

3838
export interface TranspiledFile {
39+
luaAst?: Block;
3940
lua?: string;
4041
sourceMap?: string;
4142
declaration?: string;
@@ -101,14 +102,14 @@ export function transpile({
101102

102103
const processSourceFile = (sourceFile: ts.SourceFile) => {
103104
try {
104-
const [luaAST, lualibFeatureSet] = transformer.transformSourceFile(sourceFile);
105+
const [luaAst, lualibFeatureSet] = transformer.transformSourceFile(sourceFile);
105106
if (!options.noEmit && !options.emitDeclarationOnly) {
106107
const [lua, sourceMap] = printer.print(
107-
luaAST,
108+
luaAst,
108109
lualibFeatureSet,
109110
sourceFile.fileName
110111
);
111-
updateTranspiledFile(sourceFile.fileName, { lua, sourceMap });
112+
updateTranspiledFile(sourceFile.fileName, { luaAst, lua, sourceMap });
112113
}
113114
} catch (err) {
114115
if (!(err instanceof TranspileError)) throw err;

0 commit comments

Comments
 (0)