diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-09-19 21:48:26 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-09-19 21:48:26 +0100 |
| commit | 3563b294bfaeb494511d6542301ea2a3b77091d5 (patch) | |
| tree | f97e823708849501b69252567315bc258b4f1ec7 /hobgoblin | |
| parent | 72b49c434662cc5df5294c89eb349ae1dfb70972 (diff) | |
Add imports to TypeScript AST
Diffstat (limited to 'hobgoblin')
| -rw-r--r-- | hobgoblin/src/output/lang/typescript/ast.hob | 12 |
1 files changed, 12 insertions, 0 deletions
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 { |
