From 3563b294bfaeb494511d6542301ea2a3b77091d5 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 19 Sep 2026 21:48:26 +0100 Subject: Add imports to TypeScript AST --- hobgoblin/src/output/lang/typescript/ast.hob | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'hobgoblin') diff --git a/hobgoblin/src/output/lang/typescript/ast.hob b/hobgoblin/src/output/lang/typescript/ast.hob index 14ad052..8a254b6 100644 --- a/hobgoblin/src/output/lang/typescript/ast.hob +++ b/hobgoblin/src/output/lang/typescript/ast.hob @@ -7,9 +7,21 @@ struct TypescriptModule { // identifiers, but we have this constraint for simplicity. field name: List[TypescriptIdentifier]; + field imports: List[TypescriptImportDeclaration]; + field body: List[TypescriptStatement]; } +struct TypescriptImportDeclaration { + field namedImports: List[TypescriptNamedImport]; + field fromModule: String; +} + +struct TypescriptNamedImport { + field exportName: TypescriptIdentifier; + field importName: TypescriptIdentifier; +} + // == Statements == sum TypescriptStatement { -- cgit v1.2.3