diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-08-30 09:25:33 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-08-30 09:25:33 +0100 |
| commit | 0469bc1b4ebcc22d118b7234bc7b62d3fa2f9ca4 (patch) | |
| tree | b6b7b20b26fda5800954199a1ab7541c51f16fb7 /hobgoblin | |
| parent | 93fdddf21b33fb95f249348d6fe8d38f6564243c (diff) | |
Add constructor 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 23fef2d..07a3f0e 100644 --- a/hobgoblin/src/output/lang/typescript/ast.hob +++ b/hobgoblin/src/output/lang/typescript/ast.hob @@ -25,15 +25,27 @@ struct TypescriptClassDeclaration { // == Class elements == sum TypescriptClassElement { + variant TypescriptClassConstructor; variant TypescriptClassFieldDeclaration; } +struct TypescriptClassConstructor { + field params: List[TypescriptParam]; +} + struct TypescriptClassFieldDeclaration { field name: TypescriptIdentifier; field type: Option[TypescriptExpression]; field initialValue: Option[TypescriptExpression]; } +// == Parameters == + +struct TypescriptParam { + field name: TypescriptIdentifier; + field type: Option[TypescriptExpression]; +} + // == Expressions == sum TypescriptExpression { |
