@@ -5147,6 +5147,95 @@ declare module "assemblyscript/src/definitions" {
51475147 build ( ) : string ;
51485148 }
51495149}
5150+ declare module "assemblyscript/src/extra/ast" {
5151+ /**
5152+ * @fileoverview Abstract Syntax Tree extras.
5153+ *
5154+ * Provides serialization of the AssemblyScript AST back to it source form.
5155+ *
5156+ * @license Apache-2.0
5157+ */
5158+ import { Node , Source , TypeNode , NamedTypeNode , FunctionTypeNode , TypeName , TypeParameterNode , IdentifierExpression , LiteralExpression , FloatLiteralExpression , IntegerLiteralExpression , StringLiteralExpression , RegexpLiteralExpression , ArrayLiteralExpression , AssertionExpression , BinaryExpression , CallExpression , CommaExpression , ElementAccessExpression , FunctionExpression , NewExpression , ParenthesizedExpression , PropertyAccessExpression , TernaryExpression , UnaryPostfixExpression , UnaryExpression , UnaryPrefixExpression , ClassExpression , ObjectLiteralExpression , Statement , BlockStatement , BreakStatement , ContinueStatement , DoStatement , EmptyStatement , ExportImportStatement , ExportStatement , ExportDefaultStatement , ExpressionStatement , ForStatement , ForOfStatement , IfStatement , ImportStatement , InstanceOfExpression , ReturnStatement , SwitchStatement , ThrowStatement , TryStatement , VariableStatement , WhileStatement , ClassDeclaration , EnumDeclaration , EnumValueDeclaration , FieldDeclaration , FunctionDeclaration , ImportDeclaration , IndexSignatureDeclaration , InterfaceDeclaration , MethodDeclaration , NamespaceDeclaration , TypeDeclaration , VariableDeclaration , DecoratorNode , ParameterNode , ExportMember , SwitchCase , DeclarationStatement } from "assemblyscript/src/ast" ;
5159+ /** An AST builder. */
5160+ export class ASTBuilder {
5161+ /** Rebuilds the textual source from the specified AST, as far as possible. */
5162+ static build ( node : Node ) : string ;
5163+ private sb ;
5164+ private indentLevel ;
5165+ visitNode ( node : Node ) : void ;
5166+ visitSource ( source : Source ) : void ;
5167+ visitTypeNode ( node : TypeNode ) : void ;
5168+ visitTypeName ( node : TypeName ) : void ;
5169+ visitNamedTypeNode ( node : NamedTypeNode ) : void ;
5170+ visitFunctionTypeNode ( node : FunctionTypeNode ) : void ;
5171+ visitTypeParameter ( node : TypeParameterNode ) : void ;
5172+ visitIdentifierExpression ( node : IdentifierExpression ) : void ;
5173+ visitArrayLiteralExpression ( node : ArrayLiteralExpression ) : void ;
5174+ visitObjectLiteralExpression ( node : ObjectLiteralExpression ) : void ;
5175+ visitAssertionExpression ( node : AssertionExpression ) : void ;
5176+ visitBinaryExpression ( node : BinaryExpression ) : void ;
5177+ visitCallExpression ( node : CallExpression ) : void ;
5178+ private visitArguments ;
5179+ visitClassExpression ( node : ClassExpression ) : void ;
5180+ visitCommaExpression ( node : CommaExpression ) : void ;
5181+ visitElementAccessExpression ( node : ElementAccessExpression ) : void ;
5182+ visitFunctionExpression ( node : FunctionExpression ) : void ;
5183+ visitLiteralExpression ( node : LiteralExpression ) : void ;
5184+ visitFloatLiteralExpression ( node : FloatLiteralExpression ) : void ;
5185+ visitInstanceOfExpression ( node : InstanceOfExpression ) : void ;
5186+ visitIntegerLiteralExpression ( node : IntegerLiteralExpression ) : void ;
5187+ visitStringLiteral ( str : string , singleQuoted ?: boolean ) : void ;
5188+ visitStringLiteralExpression ( node : StringLiteralExpression ) : void ;
5189+ visitRegexpLiteralExpression ( node : RegexpLiteralExpression ) : void ;
5190+ visitNewExpression ( node : NewExpression ) : void ;
5191+ visitParenthesizedExpression ( node : ParenthesizedExpression ) : void ;
5192+ visitPropertyAccessExpression ( node : PropertyAccessExpression ) : void ;
5193+ visitTernaryExpression ( node : TernaryExpression ) : void ;
5194+ visitUnaryExpression ( node : UnaryExpression ) : void ;
5195+ visitUnaryPostfixExpression ( node : UnaryPostfixExpression ) : void ;
5196+ visitUnaryPrefixExpression ( node : UnaryPrefixExpression ) : void ;
5197+ visitNodeAndTerminate ( statement : Statement ) : void ;
5198+ visitBlockStatement ( node : BlockStatement ) : void ;
5199+ visitBreakStatement ( node : BreakStatement ) : void ;
5200+ visitContinueStatement ( node : ContinueStatement ) : void ;
5201+ visitClassDeclaration ( node : ClassDeclaration , isDefault ?: boolean ) : void ;
5202+ visitDoStatement ( node : DoStatement ) : void ;
5203+ visitEmptyStatement ( node : EmptyStatement ) : void ;
5204+ visitEnumDeclaration ( node : EnumDeclaration , isDefault ?: boolean ) : void ;
5205+ visitEnumValueDeclaration ( node : EnumValueDeclaration ) : void ;
5206+ visitExportImportStatement ( node : ExportImportStatement ) : void ;
5207+ visitExportMember ( node : ExportMember ) : void ;
5208+ visitExportStatement ( node : ExportStatement ) : void ;
5209+ visitExportDefaultStatement ( node : ExportDefaultStatement ) : void ;
5210+ visitExpressionStatement ( node : ExpressionStatement ) : void ;
5211+ visitFieldDeclaration ( node : FieldDeclaration ) : void ;
5212+ visitForStatement ( node : ForStatement ) : void ;
5213+ visitForOfStatement ( node : ForOfStatement ) : void ;
5214+ visitFunctionDeclaration ( node : FunctionDeclaration , isDefault ?: boolean ) : void ;
5215+ visitFunctionCommon ( node : FunctionDeclaration ) : void ;
5216+ visitIfStatement ( node : IfStatement ) : void ;
5217+ visitImportDeclaration ( node : ImportDeclaration ) : void ;
5218+ visitImportStatement ( node : ImportStatement ) : void ;
5219+ visitIndexSignatureDeclaration ( node : IndexSignatureDeclaration ) : void ;
5220+ visitInterfaceDeclaration ( node : InterfaceDeclaration , isDefault ?: boolean ) : void ;
5221+ visitMethodDeclaration ( node : MethodDeclaration ) : void ;
5222+ visitNamespaceDeclaration ( node : NamespaceDeclaration , isDefault ?: boolean ) : void ;
5223+ visitReturnStatement ( node : ReturnStatement ) : void ;
5224+ visitSwitchCase ( node : SwitchCase ) : void ;
5225+ visitSwitchStatement ( node : SwitchStatement ) : void ;
5226+ visitThrowStatement ( node : ThrowStatement ) : void ;
5227+ visitTryStatement ( node : TryStatement ) : void ;
5228+ visitTypeDeclaration ( node : TypeDeclaration ) : void ;
5229+ visitVariableDeclaration ( node : VariableDeclaration ) : void ;
5230+ visitVariableStatement ( node : VariableStatement ) : void ;
5231+ visitWhileStatement ( node : WhileStatement ) : void ;
5232+ serializeDecorator ( node : DecoratorNode ) : void ;
5233+ serializeParameter ( node : ParameterNode ) : void ;
5234+ serializeExternalModifiers ( node : DeclarationStatement ) : void ;
5235+ serializeAccessModifiers ( node : DeclarationStatement ) : void ;
5236+ finish ( ) : string ;
5237+ }
5238+ }
51505239declare module "assemblyscript/src/index" {
51515240 /**
51525241 * @license
@@ -5292,99 +5381,11 @@ declare module "assemblyscript/src/index" {
52925381 export * from "assemblyscript/src/resolver" ;
52935382 export * from "assemblyscript/src/tokenizer" ;
52945383 export * from "assemblyscript/src/types" ;
5384+ export * from "assemblyscript/src/extra/ast" ;
52955385 import * as util from "assemblyscript/src/util/index" ;
52965386 export { util } ;
52975387 export * from "assemblyscript/src/util/index" ;
52985388}
5299- declare module "assemblyscript/src/extra/ast" {
5300- /**
5301- * @fileoverview Abstract Syntax Tree extras.
5302- *
5303- * Provides serialization of the AssemblyScript AST back to it source form.
5304- *
5305- * @license Apache-2.0
5306- */
5307- import { Node , Source , TypeNode , NamedTypeNode , FunctionTypeNode , TypeName , TypeParameterNode , IdentifierExpression , LiteralExpression , FloatLiteralExpression , IntegerLiteralExpression , StringLiteralExpression , RegexpLiteralExpression , ArrayLiteralExpression , AssertionExpression , BinaryExpression , CallExpression , CommaExpression , ElementAccessExpression , FunctionExpression , NewExpression , ParenthesizedExpression , PropertyAccessExpression , TernaryExpression , UnaryPostfixExpression , UnaryExpression , UnaryPrefixExpression , ClassExpression , ObjectLiteralExpression , Statement , BlockStatement , BreakStatement , ContinueStatement , DoStatement , EmptyStatement , ExportImportStatement , ExportStatement , ExportDefaultStatement , ExpressionStatement , ForStatement , ForOfStatement , IfStatement , ImportStatement , InstanceOfExpression , ReturnStatement , SwitchStatement , ThrowStatement , TryStatement , VariableStatement , WhileStatement , ClassDeclaration , EnumDeclaration , EnumValueDeclaration , FieldDeclaration , FunctionDeclaration , ImportDeclaration , IndexSignatureDeclaration , InterfaceDeclaration , MethodDeclaration , NamespaceDeclaration , TypeDeclaration , VariableDeclaration , DecoratorNode , ParameterNode , ExportMember , SwitchCase , DeclarationStatement } from "assemblyscript/src/ast" ;
5308- /** An AST builder. */
5309- export class ASTBuilder {
5310- /** Rebuilds the textual source from the specified AST, as far as possible. */
5311- static build ( node : Node ) : string ;
5312- private sb ;
5313- private indentLevel ;
5314- visitNode ( node : Node ) : void ;
5315- visitSource ( source : Source ) : void ;
5316- visitTypeNode ( node : TypeNode ) : void ;
5317- visitTypeName ( node : TypeName ) : void ;
5318- visitNamedTypeNode ( node : NamedTypeNode ) : void ;
5319- visitFunctionTypeNode ( node : FunctionTypeNode ) : void ;
5320- visitTypeParameter ( node : TypeParameterNode ) : void ;
5321- visitIdentifierExpression ( node : IdentifierExpression ) : void ;
5322- visitArrayLiteralExpression ( node : ArrayLiteralExpression ) : void ;
5323- visitObjectLiteralExpression ( node : ObjectLiteralExpression ) : void ;
5324- visitAssertionExpression ( node : AssertionExpression ) : void ;
5325- visitBinaryExpression ( node : BinaryExpression ) : void ;
5326- visitCallExpression ( node : CallExpression ) : void ;
5327- private visitArguments ;
5328- visitClassExpression ( node : ClassExpression ) : void ;
5329- visitCommaExpression ( node : CommaExpression ) : void ;
5330- visitElementAccessExpression ( node : ElementAccessExpression ) : void ;
5331- visitFunctionExpression ( node : FunctionExpression ) : void ;
5332- visitLiteralExpression ( node : LiteralExpression ) : void ;
5333- visitFloatLiteralExpression ( node : FloatLiteralExpression ) : void ;
5334- visitInstanceOfExpression ( node : InstanceOfExpression ) : void ;
5335- visitIntegerLiteralExpression ( node : IntegerLiteralExpression ) : void ;
5336- visitStringLiteral ( str : string , singleQuoted ?: boolean ) : void ;
5337- visitStringLiteralExpression ( node : StringLiteralExpression ) : void ;
5338- visitRegexpLiteralExpression ( node : RegexpLiteralExpression ) : void ;
5339- visitNewExpression ( node : NewExpression ) : void ;
5340- visitParenthesizedExpression ( node : ParenthesizedExpression ) : void ;
5341- visitPropertyAccessExpression ( node : PropertyAccessExpression ) : void ;
5342- visitTernaryExpression ( node : TernaryExpression ) : void ;
5343- visitUnaryExpression ( node : UnaryExpression ) : void ;
5344- visitUnaryPostfixExpression ( node : UnaryPostfixExpression ) : void ;
5345- visitUnaryPrefixExpression ( node : UnaryPrefixExpression ) : void ;
5346- visitNodeAndTerminate ( statement : Statement ) : void ;
5347- visitBlockStatement ( node : BlockStatement ) : void ;
5348- visitBreakStatement ( node : BreakStatement ) : void ;
5349- visitContinueStatement ( node : ContinueStatement ) : void ;
5350- visitClassDeclaration ( node : ClassDeclaration , isDefault ?: boolean ) : void ;
5351- visitDoStatement ( node : DoStatement ) : void ;
5352- visitEmptyStatement ( node : EmptyStatement ) : void ;
5353- visitEnumDeclaration ( node : EnumDeclaration , isDefault ?: boolean ) : void ;
5354- visitEnumValueDeclaration ( node : EnumValueDeclaration ) : void ;
5355- visitExportImportStatement ( node : ExportImportStatement ) : void ;
5356- visitExportMember ( node : ExportMember ) : void ;
5357- visitExportStatement ( node : ExportStatement ) : void ;
5358- visitExportDefaultStatement ( node : ExportDefaultStatement ) : void ;
5359- visitExpressionStatement ( node : ExpressionStatement ) : void ;
5360- visitFieldDeclaration ( node : FieldDeclaration ) : void ;
5361- visitForStatement ( node : ForStatement ) : void ;
5362- visitForOfStatement ( node : ForOfStatement ) : void ;
5363- visitFunctionDeclaration ( node : FunctionDeclaration , isDefault ?: boolean ) : void ;
5364- visitFunctionCommon ( node : FunctionDeclaration ) : void ;
5365- visitIfStatement ( node : IfStatement ) : void ;
5366- visitImportDeclaration ( node : ImportDeclaration ) : void ;
5367- visitImportStatement ( node : ImportStatement ) : void ;
5368- visitIndexSignatureDeclaration ( node : IndexSignatureDeclaration ) : void ;
5369- visitInterfaceDeclaration ( node : InterfaceDeclaration , isDefault ?: boolean ) : void ;
5370- visitMethodDeclaration ( node : MethodDeclaration ) : void ;
5371- visitNamespaceDeclaration ( node : NamespaceDeclaration , isDefault ?: boolean ) : void ;
5372- visitReturnStatement ( node : ReturnStatement ) : void ;
5373- visitSwitchCase ( node : SwitchCase ) : void ;
5374- visitSwitchStatement ( node : SwitchStatement ) : void ;
5375- visitThrowStatement ( node : ThrowStatement ) : void ;
5376- visitTryStatement ( node : TryStatement ) : void ;
5377- visitTypeDeclaration ( node : TypeDeclaration ) : void ;
5378- visitVariableDeclaration ( node : VariableDeclaration ) : void ;
5379- visitVariableStatement ( node : VariableStatement ) : void ;
5380- visitWhileStatement ( node : WhileStatement ) : void ;
5381- serializeDecorator ( node : DecoratorNode ) : void ;
5382- serializeParameter ( node : ParameterNode ) : void ;
5383- serializeExternalModifiers ( node : DeclarationStatement ) : void ;
5384- serializeAccessModifiers ( node : DeclarationStatement ) : void ;
5385- finish ( ) : string ;
5386- }
5387- }
53885389/**
53895390 * @fileoverview Collections glue code for TypeScript.
53905391 * @license Apache-2.0
0 commit comments