How to use AsyncFunctionDeclaration class

Best Mockingbird code snippet using AsyncFunctionDeclaration

JSSyntax.swift

Source:JSSyntax.swift Github

copy

Full Screen

...167 public var loc: SourceLocation? = nil168 public var range: [Int]? = nil169 }170 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)171 public struct AsyncFunctionDeclaration : JSSyntaxNode {172 public init(type: AsyncFunctionDeclarationNodeType = .AsyncFunctionDeclaration, id: Optional<Identifier>, params: [FunctionParameter], body: BlockStatement, generator: Bool, expression: Bool, async: Bool) {173 self.type = type174 self.id = id175 self.params = params176 self.body = body177 self.generator = generator178 self.expression = expression179 self.async = async180 }181 public let type: AsyncFunctionDeclarationNodeType182 public enum AsyncFunctionDeclarationNodeType : String, Codable { case AsyncFunctionDeclaration }183 public var id: Optional<Identifier>184 public var params: [FunctionParameter]185 public var body: BlockStatement186 public var generator: Bool187 public var expression: Bool188 public var async: Bool189 public var loc: SourceLocation? = nil190 public var range: [Int]? = nil191 }192 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)193 public struct AsyncFunctionExpression : JSSyntaxNode {194 public init(type: AsyncFunctionExpressionNodeType = .AsyncFunctionExpression, id: Optional<Identifier>, params: [FunctionParameter], body: BlockStatement, generator: Bool, expression: Bool, async: Bool) {195 self.type = type196 self.id = id197 self.params = params198 self.body = body199 self.generator = generator200 self.expression = expression201 self.async = async202 }203 public let type: AsyncFunctionExpressionNodeType204 public enum AsyncFunctionExpressionNodeType : String, Codable { case AsyncFunctionExpression }205 public var id: Optional<Identifier>206 public var params: [FunctionParameter]207 public var body: BlockStatement208 public var generator: Bool209 public var expression: Bool210 public var async: Bool211 public var loc: SourceLocation? = nil212 public var range: [Int]? = nil213 }214 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)215 public struct AwaitExpression : JSSyntaxNode {216 public init(type: AwaitExpressionNodeType = .AwaitExpression, argument: Expression) {217 self.type = type218 self.argument = argument219 }220 public let type: AwaitExpressionNodeType221 public enum AwaitExpressionNodeType : String, Codable { case AwaitExpression }222 public var argument: Expression223 public var loc: SourceLocation? = nil224 public var range: [Int]? = nil225 }226 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)227 public struct BinaryExpression : JSSyntaxNode {228 public init(type: BinaryExpressionNodeType = .BinaryExpression, `operator`: String, left: Expression, right: Expression) {229 self.type = type230 self.`operator` = `operator`231 self.left = left232 self.right = right233 }234 public let type: BinaryExpressionNodeType235 public enum BinaryExpressionNodeType : String, Codable { case BinaryExpression }236 public var `operator`: String237 public var left: Expression238 public var right: Expression239 public var loc: SourceLocation? = nil240 public var range: [Int]? = nil241 }242 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)243 public struct LogicalExpression : JSSyntaxNode {244 public init(type: LogicalExpressionNodeType = .LogicalExpression, `operator`: String, left: Expression, right: Expression) {245 self.type = type246 self.`operator` = `operator`247 self.left = left248 self.right = right249 }250 public let type: LogicalExpressionNodeType251 public enum LogicalExpressionNodeType : String, Codable { case LogicalExpression }252 public var `operator`: String253 public var left: Expression254 public var right: Expression255 public var loc: SourceLocation? = nil256 public var range: [Int]? = nil257 }258 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)259 public struct BlockStatement : JSSyntaxNode {260 public init(type: BlockStatementNodeType = .BlockStatement, body: [StatementListItem]) {261 self.type = type262 self.body = body263 }264 public let type: BlockStatementNodeType265 public enum BlockStatementNodeType : String, Codable { case BlockStatement }266 public var body: [StatementListItem]267 public var loc: SourceLocation? = nil268 public var range: [Int]? = nil269 }270 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)271 public struct BreakStatement : JSSyntaxNode {272 public init(type: BreakStatementNodeType = .BreakStatement, label: Optional<Identifier>) {273 self.type = type274 self.label = label275 }276 public let type: BreakStatementNodeType277 public enum BreakStatementNodeType : String, Codable { case BreakStatement }278 public var label: Optional<Identifier>279 public var loc: SourceLocation? = nil280 public var range: [Int]? = nil281 }282 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)283 public struct CallExpression : JSSyntaxNode {284 public init(type: CallExpressionNodeType = .CallExpression, callee: OneOf<Expression>.Or<Import>, arguments: [ArgumentListElement]) {285 self.type = type286 self.callee = callee287 self.arguments = arguments288 }289 public let type: CallExpressionNodeType290 public enum CallExpressionNodeType : String, Codable { case CallExpression }291 public var callee: OneOf<Expression>.Or<Import>292 public var arguments: [ArgumentListElement]293 public var loc: SourceLocation? = nil294 public var range: [Int]? = nil295 }296 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)297 public struct CatchClause : JSSyntaxNode {298 public init(type: CatchClauseNodeType = .CatchClause, param: OneOf<BindingIdentifier>.Or<BindingPattern>, body: BlockStatement) {299 self.type = type300 self.param = param301 self.body = body302 }303 public let type: CatchClauseNodeType304 public enum CatchClauseNodeType : String, Codable { case CatchClause }305 public var param: OneOf<BindingIdentifier>.Or<BindingPattern>306 public var body: BlockStatement307 public var loc: SourceLocation? = nil308 public var range: [Int]? = nil309 }310 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)311 public struct ChainExpression : JSSyntaxNode {312 public init(type: ChainExpressionNodeType = .ChainExpression, expression: ChainElement) {313 self.type = type314 self.expression = expression315 }316 public let type: ChainExpressionNodeType317 public enum ChainExpressionNodeType : String, Codable { case ChainExpression }318 public var expression: ChainElement319 public var loc: SourceLocation? = nil320 public var range: [Int]? = nil321 }322 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)323 public struct ClassBody : JSSyntaxNode {324 public init(type: ClassBodyNodeType = .ClassBody, body: [MethodDefinition]) {325 self.type = type326 self.body = body327 }328 public let type: ClassBodyNodeType329 public enum ClassBodyNodeType : String, Codable { case ClassBody }330 public var body: [MethodDefinition]331 public var loc: SourceLocation? = nil332 public var range: [Int]? = nil333 }334 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)335 public struct ClassDeclaration : JSSyntaxNode {336 public init(type: ClassDeclarationNodeType = .ClassDeclaration, id: Optional<Identifier>, superClass: Optional<Identifier>, body: ClassBody) {337 self.type = type338 self.id = id339 self.superClass = superClass340 self.body = body341 }342 public let type: ClassDeclarationNodeType343 public enum ClassDeclarationNodeType : String, Codable { case ClassDeclaration }344 public var id: Optional<Identifier>345 public var superClass: Optional<Identifier>346 public var body: ClassBody347 public var loc: SourceLocation? = nil348 public var range: [Int]? = nil349 }350 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)351 public struct ClassExpression : JSSyntaxNode {352 public init(type: ClassExpressionNodeType = .ClassExpression, id: Optional<Identifier>, superClass: Optional<Identifier>, body: ClassBody) {353 self.type = type354 self.id = id355 self.superClass = superClass356 self.body = body357 }358 public let type: ClassExpressionNodeType359 public enum ClassExpressionNodeType : String, Codable { case ClassExpression }360 public var id: Optional<Identifier>361 public var superClass: Optional<Identifier>362 public var body: ClassBody363 public var loc: SourceLocation? = nil364 public var range: [Int]? = nil365 }366 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)367 public struct ComputedMemberExpression : JSSyntaxNode {368 public init(type: ComputedMemberExpressionNodeType = .ComputedMemberExpression, computed: Bool, object: Expression, property: Expression) {369 self.type = type370 self.computed = computed371 self.object = object372 self.property = property373 }374 public let type: ComputedMemberExpressionNodeType375 public enum ComputedMemberExpressionNodeType : String, Codable { case ComputedMemberExpression }376 public var computed: Bool377 public var object: Expression378 public var property: Expression379 public var loc: SourceLocation? = nil380 public var range: [Int]? = nil381 }382 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)383 public struct ConditionalExpression : JSSyntaxNode {384 public init(type: ConditionalExpressionNodeType = .ConditionalExpression, test: Expression, consequent: Expression, alternate: Expression) {385 self.type = type386 self.test = test387 self.consequent = consequent388 self.alternate = alternate389 }390 public let type: ConditionalExpressionNodeType391 public enum ConditionalExpressionNodeType : String, Codable { case ConditionalExpression }392 public var test: Expression393 public var consequent: Expression394 public var alternate: Expression395 public var loc: SourceLocation? = nil396 public var range: [Int]? = nil397 }398 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)399 public struct ContinueStatement : JSSyntaxNode {400 public init(type: ContinueStatementNodeType = .ContinueStatement, label: Optional<Identifier>) {401 self.type = type402 self.label = label403 }404 public let type: ContinueStatementNodeType405 public enum ContinueStatementNodeType : String, Codable { case ContinueStatement }406 public var label: Optional<Identifier>407 public var loc: SourceLocation? = nil408 public var range: [Int]? = nil409 }410 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)411 public struct DebuggerStatement : JSSyntaxNode {412 public init(type: DebuggerStatementNodeType = .DebuggerStatement) {413 self.type = type414 }415 public let type: DebuggerStatementNodeType416 public enum DebuggerStatementNodeType : String, Codable { case DebuggerStatement }417 public var loc: SourceLocation? = nil418 public var range: [Int]? = nil419 }420 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)421 public struct Directive : JSSyntaxNode {422 public init(type: DirectiveNodeType = .Directive, expression: Expression, directive: String) {423 self.type = type424 self.expression = expression425 self.directive = directive426 }427 public let type: DirectiveNodeType428 public enum DirectiveNodeType : String, Codable { case Directive }429 public var expression: Expression430 public var directive: String431 public var loc: SourceLocation? = nil432 public var range: [Int]? = nil433 }434 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)435 public struct DoWhileStatement : JSSyntaxNode {436 public init(type: DoWhileStatementNodeType = .DoWhileStatement, body: Statement, test: Expression) {437 self.type = type438 self.body = body439 self.test = test440 }441 public let type: DoWhileStatementNodeType442 public enum DoWhileStatementNodeType : String, Codable { case DoWhileStatement }443 public var body: Statement444 public var test: Expression445 public var loc: SourceLocation? = nil446 public var range: [Int]? = nil447 }448 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)449 public struct EmptyStatement : JSSyntaxNode {450 public init(type: EmptyStatementNodeType = .EmptyStatement) {451 self.type = type452 }453 public let type: EmptyStatementNodeType454 public enum EmptyStatementNodeType : String, Codable { case EmptyStatement }455 public var loc: SourceLocation? = nil456 public var range: [Int]? = nil457 }458 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)459 public struct ExportAllDeclaration : JSSyntaxNode {460 public init(type: ExportAllDeclarationNodeType = .ExportAllDeclaration, source: Literal) {461 self.type = type462 self.source = source463 }464 public let type: ExportAllDeclarationNodeType465 public enum ExportAllDeclarationNodeType : String, Codable { case ExportAllDeclaration }466 public var source: Literal467 public var loc: SourceLocation? = nil468 public var range: [Int]? = nil469 }470 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)471 public struct ExportDefaultDeclaration : JSSyntaxNode {472 public init(type: ExportDefaultDeclarationNodeType = .ExportDefaultDeclaration, declaration: ExportableDefaultDeclaration) {473 self.type = type474 self.declaration = declaration475 }476 public let type: ExportDefaultDeclarationNodeType477 public enum ExportDefaultDeclarationNodeType : String, Codable { case ExportDefaultDeclaration }478 public var declaration: ExportableDefaultDeclaration479 public var loc: SourceLocation? = nil480 public var range: [Int]? = nil481 }482 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)483 public struct ExportNamedDeclaration : JSSyntaxNode {484 public init(type: ExportNamedDeclarationNodeType = .ExportNamedDeclaration, declaration: Optional<ExportableNamedDeclaration>, specifiers: [ExportSpecifier], source: Optional<Literal>) {485 self.type = type486 self.declaration = declaration487 self.specifiers = specifiers488 self.source = source489 }490 public let type: ExportNamedDeclarationNodeType491 public enum ExportNamedDeclarationNodeType : String, Codable { case ExportNamedDeclaration }492 public var declaration: Optional<ExportableNamedDeclaration>493 public var specifiers: [ExportSpecifier]494 public var source: Optional<Literal>495 public var loc: SourceLocation? = nil496 public var range: [Int]? = nil497 }498 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)499 public struct ExportSpecifier : JSSyntaxNode {500 public init(type: ExportSpecifierNodeType = .ExportSpecifier, exported: Identifier, local: Identifier) {501 self.type = type502 self.exported = exported503 self.local = local504 }505 public let type: ExportSpecifierNodeType506 public enum ExportSpecifierNodeType : String, Codable { case ExportSpecifier }507 public var exported: Identifier508 public var local: Identifier509 public var loc: SourceLocation? = nil510 public var range: [Int]? = nil511 }512 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)513 public struct ExpressionStatement : JSSyntaxNode {514 public init(type: ExpressionStatementNodeType = .ExpressionStatement, expression: Expression, directive: String?) {515 self.type = type516 self.expression = expression517 self.directive = directive518 }519 public let type: ExpressionStatementNodeType520 public enum ExpressionStatementNodeType : String, Codable { case ExpressionStatement }521 public var expression: Expression522 public var directive: String?523 public var loc: SourceLocation? = nil524 public var range: [Int]? = nil525 }526 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)527 public struct ForInStatement : JSSyntaxNode {528 public init(type: ForInStatementNodeType = .ForInStatement, left: OneOf<VariableDeclaration>.Or<Expression>, right: Expression, body: Statement, each: Bool) {529 self.type = type530 self.left = left531 self.right = right532 self.body = body533 self.each = each534 }535 public let type: ForInStatementNodeType536 public enum ForInStatementNodeType : String, Codable { case ForInStatement }537 public var left: OneOf<VariableDeclaration>.Or<Expression>538 public var right: Expression539 public var body: Statement540 public var each: Bool541 public var loc: SourceLocation? = nil542 public var range: [Int]? = nil543 }544 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)545 public struct ForOfStatement : JSSyntaxNode {546 public init(type: ForOfStatementNodeType = .ForOfStatement, left: OneOf<VariableDeclaration>.Or<Expression>, right: Expression, body: Statement) {547 self.type = type548 self.left = left549 self.right = right550 self.body = body551 }552 public let type: ForOfStatementNodeType553 public enum ForOfStatementNodeType : String, Codable { case ForOfStatement }554 public var left: OneOf<VariableDeclaration>.Or<Expression>555 public var right: Expression556 public var body: Statement557 public var loc: SourceLocation? = nil558 public var range: [Int]? = nil559 }560 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)561 public struct ForStatement : JSSyntaxNode {562 public init(type: ForStatementNodeType = .ForStatement, `init`: Nullable<OneOf<VariableDeclaration>.Or<Expression>>, test: Nullable<Expression>, update: Nullable<Expression>, body: Statement) {563 self.type = type564 self.`init` = `init`565 self.test = test566 self.update = update567 self.body = body568 }569 public let type: ForStatementNodeType570 public enum ForStatementNodeType : String, Codable { case ForStatement }571 public var `init`: Nullable<OneOf<VariableDeclaration>.Or<Expression>>572 public var test: Nullable<Expression>573 public var update: Nullable<Expression>574 public var body: Statement575 public var loc: SourceLocation? = nil576 public var range: [Int]? = nil577 }578 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)579 public struct FunctionDeclaration : JSSyntaxNode {580 public init(type: FunctionDeclarationNodeType = .FunctionDeclaration, id: Optional<Identifier>, params: [FunctionParameter], body: BlockStatement, generator: Bool, expression: Bool, async: Bool) {581 self.type = type582 self.id = id583 self.params = params584 self.body = body585 self.generator = generator586 self.expression = expression587 self.async = async588 }589 public let type: FunctionDeclarationNodeType590 public enum FunctionDeclarationNodeType : String, Codable { case FunctionDeclaration }591 public var id: Optional<Identifier>592 public var params: [FunctionParameter]593 public var body: BlockStatement594 public var generator: Bool595 public var expression: Bool596 public var async: Bool597 public var loc: SourceLocation? = nil598 public var range: [Int]? = nil599 }600 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)601 public struct FunctionExpression : JSSyntaxNode {602 public init(type: FunctionExpressionNodeType = .FunctionExpression, id: Optional<Identifier>, params: [FunctionParameter], body: BlockStatement, generator: Bool, expression: Bool, async: Bool) {603 self.type = type604 self.id = id605 self.params = params606 self.body = body607 self.generator = generator608 self.expression = expression609 self.async = async610 }611 public let type: FunctionExpressionNodeType612 public enum FunctionExpressionNodeType : String, Codable { case FunctionExpression }613 public var id: Optional<Identifier>614 public var params: [FunctionParameter]615 public var body: BlockStatement616 public var generator: Bool617 public var expression: Bool618 public var async: Bool619 public var loc: SourceLocation? = nil620 public var range: [Int]? = nil621 }622 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)623 public struct Identifier : JSSyntaxNode {624 public init(type: IdentifierNodeType = .Identifier, name: String) {625 self.type = type626 self.name = name627 }628 public let type: IdentifierNodeType629 public enum IdentifierNodeType : String, Codable { case Identifier }630 public var name: String631 public var loc: SourceLocation? = nil632 public var range: [Int]? = nil633 }634 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)635 public struct IfStatement : JSSyntaxNode {636 public init(type: IfStatementNodeType = .IfStatement, test: Expression, consequent: Statement, alternate: Optional<Statement>) {637 self.type = type638 self.test = test639 self.consequent = consequent640 self.alternate = alternate641 }642 public let type: IfStatementNodeType643 public enum IfStatementNodeType : String, Codable { case IfStatement }644 public var test: Expression645 public var consequent: Statement646 public var alternate: Optional<Statement>647 public var loc: SourceLocation? = nil648 public var range: [Int]? = nil649 }650 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)651 public struct Import : JSSyntaxNode {652 public init(type: ImportNodeType = .Import) {653 self.type = type654 }655 public let type: ImportNodeType656 public enum ImportNodeType : String, Codable { case Import }657 public var loc: SourceLocation? = nil658 public var range: [Int]? = nil659 }660 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)661 public struct ImportDeclaration : JSSyntaxNode {662 public init(type: ImportDeclarationNodeType = .ImportDeclaration, specifiers: [ImportDeclarationSpecifier], source: Literal) {663 self.type = type664 self.specifiers = specifiers665 self.source = source666 }667 public let type: ImportDeclarationNodeType668 public enum ImportDeclarationNodeType : String, Codable { case ImportDeclaration }669 public var specifiers: [ImportDeclarationSpecifier]670 public var source: Literal671 public var loc: SourceLocation? = nil672 public var range: [Int]? = nil673 }674 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)675 public struct ImportDefaultSpecifier : JSSyntaxNode {676 public init(type: ImportDefaultSpecifierNodeType = .ImportDefaultSpecifier, local: Identifier) {677 self.type = type678 self.local = local679 }680 public let type: ImportDefaultSpecifierNodeType681 public enum ImportDefaultSpecifierNodeType : String, Codable { case ImportDefaultSpecifier }682 public var local: Identifier683 public var loc: SourceLocation? = nil684 public var range: [Int]? = nil685 }686 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)687 public struct ImportNamespaceSpecifier : JSSyntaxNode {688 public init(type: ImportNamespaceSpecifierNodeType = .ImportNamespaceSpecifier, local: Identifier) {689 self.type = type690 self.local = local691 }692 public let type: ImportNamespaceSpecifierNodeType693 public enum ImportNamespaceSpecifierNodeType : String, Codable { case ImportNamespaceSpecifier }694 public var local: Identifier695 public var loc: SourceLocation? = nil696 public var range: [Int]? = nil697 }698 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)699 public struct ImportSpecifier : JSSyntaxNode {700 public init(type: ImportSpecifierNodeType = .ImportSpecifier, local: Identifier, imported: Identifier) {701 self.type = type702 self.local = local703 self.imported = imported704 }705 public let type: ImportSpecifierNodeType706 public enum ImportSpecifierNodeType : String, Codable { case ImportSpecifier }707 public var local: Identifier708 public var imported: Identifier709 public var loc: SourceLocation? = nil710 public var range: [Int]? = nil711 }712 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)713 public struct LabeledStatement : JSSyntaxNode {714 public init(type: LabeledStatementNodeType = .LabeledStatement, label: Identifier, body: Statement) {715 self.type = type716 self.label = label717 self.body = body718 }719 public let type: LabeledStatementNodeType720 public enum LabeledStatementNodeType : String, Codable { case LabeledStatement }721 public var label: Identifier722 public var body: Statement723 public var loc: SourceLocation? = nil724 public var range: [Int]? = nil725 }726 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)727 public struct Literal : JSSyntaxNode {728 public init(type: LiteralNodeType = .Literal, value: Optional<OneOf<Bool>.Or<Double>.Or<String>.Or<RegExp>>, raw: String, regex: Optional<Regex>) {729 self.type = type730 self.value = value731 self.raw = raw732 self.regex = regex733 }734 public let type: LiteralNodeType735 public enum LiteralNodeType : String, Codable { case Literal }736 public var value: Optional<OneOf<Bool>.Or<Double>.Or<String>.Or<RegExp>>737 public var raw: String738 public var regex: Optional<Regex>739 public var loc: SourceLocation? = nil740 public var range: [Int]? = nil741 /// Hollow object signifying a regexp742 public struct RegExp : Codable, Hashable {743 public init() { }744 }745 }746 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)747 public struct MemberExpression : JSSyntaxNode {748 public init(type: MemberExpressionNodeType = .MemberExpression, computed: Bool, object: Expression, property: Expression) {749 self.type = type750 self.computed = computed751 self.object = object752 self.property = property753 }754 public let type: MemberExpressionNodeType755 public enum MemberExpressionNodeType : String, Codable { case MemberExpression }756 public var computed: Bool757 public var object: Expression758 public var property: Expression759 public var loc: SourceLocation? = nil760 public var range: [Int]? = nil761 }762 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)763 public struct MetaProperty : JSSyntaxNode {764 public init(type: MetaPropertyNodeType = .MetaProperty, meta: Identifier, property: Identifier) {765 self.type = type766 self.meta = meta767 self.property = property768 }769 public let type: MetaPropertyNodeType770 public enum MetaPropertyNodeType : String, Codable { case MetaProperty }771 public var meta: Identifier772 public var property: Identifier773 public var loc: SourceLocation? = nil774 public var range: [Int]? = nil775 }776 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)777 public struct MethodDefinition : JSSyntaxNode {778 public init(type: MethodDefinitionNodeType = .MethodDefinition, key: Optional<Expression>, computed: Bool, value: Optional<OneOf<AsyncFunctionExpression>.Or<FunctionExpression>>, kind: MethodDefinitionKind, `static`: Bool) {779 self.type = type780 self.key = key781 self.computed = computed782 self.value = value783 self.kind = kind784 self.`static` = `static`785 }786 public let type: MethodDefinitionNodeType787 public enum MethodDefinitionNodeType : String, Codable { case MethodDefinition }788 public var key: Optional<Expression>789 public var computed: Bool790 public var value: Optional<OneOf<AsyncFunctionExpression>.Or<FunctionExpression>>791 public var kind: MethodDefinitionKind792 public enum MethodDefinitionKind : String, Codable { case method, constructor }793 public var `static`: Bool794 public var loc: SourceLocation? = nil795 public var range: [Int]? = nil796 }797 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)798 public struct NewExpression : JSSyntaxNode {799 public init(type: NewExpressionNodeType = .NewExpression, callee: Expression, arguments: [ArgumentListElement]) {800 self.type = type801 self.callee = callee802 self.arguments = arguments803 }804 public let type: NewExpressionNodeType805 public enum NewExpressionNodeType : String, Codable { case NewExpression }806 public var callee: Expression807 public var arguments: [ArgumentListElement]808 public var loc: SourceLocation? = nil809 public var range: [Int]? = nil810 }811 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)812 public struct ObjectExpression : JSSyntaxNode {813 public init(type: ObjectExpressionNodeType = .ObjectExpression, properties: [ObjectExpressionProperty]) {814 self.type = type815 self.properties = properties816 }817 public let type: ObjectExpressionNodeType818 public enum ObjectExpressionNodeType : String, Codable { case ObjectExpression }819 public var properties: [ObjectExpressionProperty]820 public var loc: SourceLocation? = nil821 public var range: [Int]? = nil822 }823 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)824 public struct ObjectPattern : JSSyntaxNode {825 public init(type: ObjectPatternNodeType = .ObjectPattern, properties: [ObjectPatternProperty]) {826 self.type = type827 self.properties = properties828 }829 public let type: ObjectPatternNodeType830 public enum ObjectPatternNodeType : String, Codable { case ObjectPattern }831 public var properties: [ObjectPatternProperty]832 public var loc: SourceLocation? = nil833 public var range: [Int]? = nil834 }835 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)836 public struct Property : JSSyntaxNode {837 public init(type: PropertyNodeType = .Property, key: PropertyKey, computed: Bool, value: Optional<Expression>, kind: String, method: Bool, shorthand: Bool) {838 self.type = type839 self.key = key840 self.computed = computed841 self.value = value842 self.kind = kind843 self.method = method844 self.shorthand = shorthand845 }846 public let type: PropertyNodeType847 public enum PropertyNodeType : String, Codable { case Property }848 public var key: PropertyKey849 public var computed: Bool850 public var value: Optional<Expression>851 public var kind: String852 public var method: Bool853 public var shorthand: Bool854 public var loc: SourceLocation? = nil855 public var range: [Int]? = nil856 }857 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)858 public struct RegexLiteral : JSSyntaxNode {859 public init(type: RegexLiteralNodeType = .RegexLiteral, value: Bric, raw: String, regex: Regex) {860 self.type = type861 self.value = value862 self.raw = raw863 self.regex = regex864 }865 public let type: RegexLiteralNodeType866 public enum RegexLiteralNodeType : String, Codable { case RegexLiteral }867 public var value: Bric; // RegExp868 public var raw: String869 public var regex: Regex870 public var loc: SourceLocation? = nil871 public var range: [Int]? = nil872 }873 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)874 public struct RestElement : JSSyntaxNode {875 public init(type: RestElementNodeType = .RestElement, argument: OneOf<BindingIdentifier>.Or<BindingPattern>) {876 self.type = type877 self.argument = argument878 }879 public let type: RestElementNodeType880 public enum RestElementNodeType : String, Codable { case RestElement }881 public var argument: OneOf<BindingIdentifier>.Or<BindingPattern>882 public var loc: SourceLocation? = nil883 public var range: [Int]? = nil884 }885 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)886 public struct ReturnStatement : JSSyntaxNode {887 public init(type: ReturnStatementNodeType = .ReturnStatement, argument: Optional<Expression>) {888 self.type = type889 self.argument = argument890 }891 public let type: ReturnStatementNodeType892 public enum ReturnStatementNodeType : String, Codable { case ReturnStatement }893 public var argument: Optional<Expression>894 public var loc: SourceLocation? = nil895 public var range: [Int]? = nil896 }897 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)898 public struct SequenceExpression : JSSyntaxNode {899 public init(type: SequenceExpressionNodeType = .SequenceExpression, expressions: [Expression]) {900 self.type = type901 self.expressions = expressions902 }903 public let type: SequenceExpressionNodeType904 public enum SequenceExpressionNodeType : String, Codable { case SequenceExpression }905 public var expressions: [Expression]906 public var loc: SourceLocation? = nil907 public var range: [Int]? = nil908 }909 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)910 public struct SpreadElement : JSSyntaxNode {911 public init(type: SpreadElementNodeType = .SpreadElement, argument: Expression) {912 self.type = type913 self.argument = argument914 }915 public let type: SpreadElementNodeType916 public enum SpreadElementNodeType : String, Codable { case SpreadElement }917 public var argument: Expression918 public var loc: SourceLocation? = nil919 public var range: [Int]? = nil920 }921 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)922 public struct StaticMemberExpression : JSSyntaxNode {923 public init(type: StaticMemberExpressionNodeType = .StaticMemberExpression, computed: Bool, object: Expression, property: Expression) {924 self.type = type925 self.computed = computed926 self.object = object927 self.property = property928 }929 public let type: StaticMemberExpressionNodeType930 public enum StaticMemberExpressionNodeType : String, Codable { case StaticMemberExpression }931 public var computed: Bool932 public var object: Expression933 public var property: Expression934 public var loc: SourceLocation? = nil935 public var range: [Int]? = nil936 }937 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)938 public struct Super : JSSyntaxNode {939 public init(type: SuperNodeType = .Super) {940 self.type = type941 }942 public let type: SuperNodeType943 public enum SuperNodeType : String, Codable { case Super }944 public var loc: SourceLocation? = nil945 public var range: [Int]? = nil946 }947 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)948 public struct SwitchCase : JSSyntaxNode {949 public init(type: SwitchCaseNodeType = .SwitchCase, test: Optional<Expression>, consequent: [Statement]) {950 self.type = type951 self.test = test952 self.consequent = consequent953 }954 public let type: SwitchCaseNodeType955 public enum SwitchCaseNodeType : String, Codable { case SwitchCase }956 public var test: Optional<Expression>957 public var consequent: [Statement]958 public var loc: SourceLocation? = nil959 public var range: [Int]? = nil960 }961 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)962 public struct SwitchStatement : JSSyntaxNode {963 public init(type: SwitchStatementNodeType = .SwitchStatement, discriminant: Expression, cases: [SwitchCase]) {964 self.type = type965 self.discriminant = discriminant966 self.cases = cases967 }968 public let type: SwitchStatementNodeType969 public enum SwitchStatementNodeType : String, Codable { case SwitchStatement }970 public var discriminant: Expression971 public var cases: [SwitchCase]972 public var loc: SourceLocation? = nil973 public var range: [Int]? = nil974 }975 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)976 public struct TaggedTemplateExpression : JSSyntaxNode {977 public init(type: TaggedTemplateExpressionNodeType = .TaggedTemplateExpression, tag: Expression, quasi: TemplateLiteral) {978 self.type = type979 self.tag = tag980 self.quasi = quasi981 }982 public let type: TaggedTemplateExpressionNodeType983 public enum TaggedTemplateExpressionNodeType : String, Codable { case TaggedTemplateExpression }984 public var tag: Expression985 public var quasi: TemplateLiteral986 public var loc: SourceLocation? = nil987 public var range: [Int]? = nil988 }989 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)990 public struct TemplateElementValue : Hashable, Codable {991 public var cooked: String992 public var raw: String993 }994 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)995 public struct TemplateElement : JSSyntaxNode {996 public init(type: TemplateElementValueNodeType = .TemplateElement, value: TemplateElementValue, tail: Bool) {997 self.type = type998 self.value = value999 self.tail = tail1000 }1001 public let type: TemplateElementValueNodeType1002 public enum TemplateElementValueNodeType : String, Codable { case TemplateElement }1003 public var value: TemplateElementValue1004 public var tail: Bool1005 public var loc: SourceLocation? = nil1006 public var range: [Int]? = nil1007 }1008 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)1009 public struct TemplateLiteral : JSSyntaxNode {1010 public init(type: TemplateLiteralNodeType = .TemplateLiteral, quasis: [TemplateElement], expressions: [Expression]) {1011 self.type = type1012 self.quasis = quasis1013 self.expressions = expressions1014 }1015 public let type: TemplateLiteralNodeType1016 public enum TemplateLiteralNodeType : String, Codable { case TemplateLiteral }1017 public var quasis: [TemplateElement]1018 public var expressions: [Expression]1019 public var loc: SourceLocation? = nil1020 public var range: [Int]? = nil1021 }1022 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)1023 public struct ThisExpression : JSSyntaxNode {1024 public init(type: ThisExpressionNodeType = .ThisExpression) {1025 self.type = type1026 }1027 public let type: ThisExpressionNodeType1028 public enum ThisExpressionNodeType : String, Codable { case ThisExpression }1029 public var loc: SourceLocation? = nil1030 public var range: [Int]? = nil1031 }1032 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)1033 public struct ThrowStatement : JSSyntaxNode {1034 public init(type: ThrowStatementNodeType = .ThrowStatement, argument: Expression) {1035 self.type = type1036 self.argument = argument1037 }1038 public let type: ThrowStatementNodeType1039 public enum ThrowStatementNodeType : String, Codable { case ThrowStatement }1040 public var argument: Expression1041 public var loc: SourceLocation? = nil1042 public var range: [Int]? = nil1043 }1044 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)1045 public struct TryStatement : JSSyntaxNode {1046 public init(type: TryStatementNodeType = .TryStatement, block: BlockStatement, handler: Optional<CatchClause>, finalizer: Optional<BlockStatement>) {1047 self.type = type1048 self.block = block1049 self.handler = handler1050 self.finalizer = finalizer1051 }1052 public let type: TryStatementNodeType1053 public enum TryStatementNodeType : String, Codable { case TryStatement }1054 public var block: BlockStatement1055 public var handler: Optional<CatchClause>1056 public var finalizer: Optional<BlockStatement>1057 public var loc: SourceLocation? = nil1058 public var range: [Int]? = nil1059 }1060 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)1061 public struct UnaryExpression : JSSyntaxNode {1062 public init(type: UnaryExpressionNodeType = .UnaryExpression, `operator`: String, argument: Expression, prefix: Bool) {1063 self.type = type1064 self.`operator` = `operator`1065 self.argument = argument1066 self.prefix = prefix1067 }1068 public let type: UnaryExpressionNodeType1069 public enum UnaryExpressionNodeType : String, Codable { case UnaryExpression }1070 public var `operator`: String1071 public var argument: Expression1072 public var prefix: Bool1073 public var loc: SourceLocation? = nil1074 public var range: [Int]? = nil1075 }1076 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)1077 public struct UpdateExpression : JSSyntaxNode {1078 public init(type: UpdateExpressionNodeType = .UpdateExpression, `operator`: String, argument: Expression, prefix: Bool) {1079 self.type = type1080 self.`operator` = `operator`1081 self.argument = argument1082 self.prefix = prefix1083 }1084 public let type: UpdateExpressionNodeType1085 public enum UpdateExpressionNodeType : String, Codable { case UpdateExpression }1086 public var `operator`: String1087 public var argument: Expression1088 public var prefix: Bool1089 public var loc: SourceLocation? = nil1090 public var range: [Int]? = nil1091 }1092 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)1093 public struct VariableDeclaration : JSSyntaxNode {1094 public init(type: VariableDeclarationNodeType = .VariableDeclaration, declarations: [VariableDeclarator], kind: String) {1095 self.type = type1096 self.declarations = declarations1097 self.kind = kind1098 }1099 public let type: VariableDeclarationNodeType1100 public enum VariableDeclarationNodeType : String, Codable { case VariableDeclaration }1101 public var declarations: [VariableDeclarator]1102 public var kind: String1103 public var loc: SourceLocation? = nil1104 public var range: [Int]? = nil1105 }1106 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)1107 public struct VariableDeclarator : JSSyntaxNode {1108 public init(type: VariableDeclaratorNodeType = .VariableDeclarator, id: OneOf<BindingIdentifier>.Or<BindingPattern>, `init`: Optional<Expression>) {1109 self.type = type1110 self.id = id1111 self.`init` = `init`1112 }1113 public let type: VariableDeclaratorNodeType1114 public enum VariableDeclaratorNodeType : String, Codable { case VariableDeclarator }1115 public var id: OneOf<BindingIdentifier>.Or<BindingPattern>1116 public var `init`: Optional<Expression>1117 public var loc: SourceLocation? = nil1118 public var range: [Int]? = nil1119 }1120 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)1121 public struct WhileStatement : JSSyntaxNode {1122 public init(type: WhileStatementNodeType = .WhileStatement, test: Expression, body: Statement) {1123 self.type = type1124 self.test = test1125 self.body = body1126 }1127 public let type: WhileStatementNodeType1128 public enum WhileStatementNodeType : String, Codable { case WhileStatement }1129 public var test: Expression1130 public var body: Statement1131 public var loc: SourceLocation? = nil1132 public var range: [Int]? = nil1133 }1134 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)1135 public struct WithStatement : JSSyntaxNode {1136 public init(type: WithStatementNodeType = .WithStatement, object: Expression, body: Statement) {1137 self.type = type1138 self.object = object1139 self.body = body1140 }1141 public let type: WithStatementNodeType1142 public enum WithStatementNodeType : String, Codable { case WithStatement }1143 public var object: Expression1144 public var body: Statement1145 public var loc: SourceLocation? = nil1146 public var range: [Int]? = nil1147 }1148 /// See: [Syntax Tree Format](https://esprima.readthedocs.io/en/4.0/syntax-tree-format.html)1149 public struct YieldExpression : JSSyntaxNode {1150 public init(type: YieldExpressionNodeType = .YieldExpression, argument: Optional<Expression>, delegate: Bool) {1151 self.type = type1152 self.argument = argument1153 self.delegate = delegate1154 }1155 public let type: YieldExpressionNodeType1156 public enum YieldExpressionNodeType : String, Codable { case YieldExpression }1157 public var argument: Optional<Expression>1158 public var delegate: Bool1159 public var loc: SourceLocation? = nil1160 public var range: [Int]? = nil1161 }1162}1163/// - TODO: @available(*, deprecated, renamed: "ESTree")1164extension JSSyntax {1165 public indirect enum Expression : Hashable, Codable {1166 case ThisExpression(ThisExpression)1167 case Identifier(Identifier)1168 case Literal(Literal)1169 case SequenceExpression(SequenceExpression)1170 case ArrayExpression(ArrayExpression)1171 case MemberExpression(MemberExpression)1172 case MetaProperty(MetaProperty)1173 case CallExpression(CallExpression)1174 case ObjectExpression(ObjectExpression)1175 case FunctionExpression(FunctionExpression)1176 case ArrowFunctionExpression(ArrowFunctionExpression)1177 case ClassExpression(ClassExpression)1178 case TaggedTemplateExpression(TaggedTemplateExpression)1179 case Super(Super)1180 case NewExpression(NewExpression)1181 case UpdateExpression(UpdateExpression)1182 case AwaitExpression(AwaitExpression)1183 case UnaryExpression(UnaryExpression)1184 case BinaryExpression(BinaryExpression)1185 case LogicalExpression(LogicalExpression)1186 case ConditionalExpression(ConditionalExpression)1187 case YieldExpression(YieldExpression)1188 case AssignmentExpression(AssignmentExpression)1189 case AsyncArrowFunctionExpression(AsyncArrowFunctionExpression)1190 case AsyncFunctionExpression(AsyncFunctionExpression)1191 case ChainExpression(ChainExpression)1192 case RegexLiteral(RegexLiteral)1193 public init(from decoder: Decoder) throws {1194 let typeName = try decoder1195 .container(keyedBy: CodingKeys.self)1196 .decode(String.self, forKey: .type)1197 switch typeName {1198 case JSSyntax.ThisExpression.NodeType.ThisExpression.rawValue:1199 self = .ThisExpression(try .init(from: decoder))1200 case JSSyntax.Identifier.NodeType.Identifier.rawValue:1201 self = .Identifier(try .init(from: decoder))1202 case JSSyntax.Literal.NodeType.Literal.rawValue:1203 self = .Literal(try .init(from: decoder))1204 case JSSyntax.SequenceExpression.NodeType.SequenceExpression.rawValue:1205 self = .SequenceExpression(try .init(from: decoder))1206 case JSSyntax.ArrayExpression.NodeType.ArrayExpression.rawValue:1207 self = .ArrayExpression(try .init(from: decoder))1208 case JSSyntax.MemberExpression.NodeType.MemberExpression.rawValue:1209 self = .MemberExpression(try .init(from: decoder))1210 case JSSyntax.MetaProperty.NodeType.MetaProperty.rawValue:1211 self = .MetaProperty(try .init(from: decoder))1212 case JSSyntax.CallExpression.NodeType.CallExpression.rawValue:1213 self = .CallExpression(try .init(from: decoder))1214 case JSSyntax.ObjectExpression.NodeType.ObjectExpression.rawValue:1215 self = .ObjectExpression(try .init(from: decoder))1216 case JSSyntax.FunctionExpression.NodeType.FunctionExpression.rawValue:1217 self = .FunctionExpression(try .init(from: decoder))1218 case JSSyntax.ArrowFunctionExpression.NodeType.ArrowFunctionExpression.rawValue:1219 self = .ArrowFunctionExpression(try .init(from: decoder))1220 case JSSyntax.ClassExpression.NodeType.ClassExpression.rawValue:1221 self = .ClassExpression(try .init(from: decoder))1222 case JSSyntax.TaggedTemplateExpression.NodeType.TaggedTemplateExpression.rawValue:1223 self = .TaggedTemplateExpression(try .init(from: decoder))1224 case JSSyntax.Super.NodeType.Super.rawValue:1225 self = .Super(try .init(from: decoder))1226 case JSSyntax.NewExpression.NodeType.NewExpression.rawValue:1227 self = .NewExpression(try .init(from: decoder))1228 case JSSyntax.UpdateExpression.NodeType.UpdateExpression.rawValue:1229 self = .UpdateExpression(try .init(from: decoder))1230 case JSSyntax.AwaitExpression.NodeType.AwaitExpression.rawValue:1231 self = .AwaitExpression(try .init(from: decoder))1232 case JSSyntax.UnaryExpression.NodeType.UnaryExpression.rawValue:1233 self = .UnaryExpression(try .init(from: decoder))1234 case JSSyntax.BinaryExpression.NodeType.BinaryExpression.rawValue:1235 self = .BinaryExpression(try .init(from: decoder))1236 case JSSyntax.LogicalExpression.NodeType.LogicalExpression.rawValue:1237 self = .LogicalExpression(try .init(from: decoder))1238 case JSSyntax.ConditionalExpression.NodeType.ConditionalExpression.rawValue:1239 self = .ConditionalExpression(try .init(from: decoder))1240 case JSSyntax.YieldExpression.NodeType.YieldExpression.rawValue:1241 self = .YieldExpression(try .init(from: decoder))1242 case JSSyntax.AssignmentExpression.NodeType.AssignmentExpression.rawValue:1243 self = .AssignmentExpression(try .init(from: decoder))1244 case JSSyntax.AsyncArrowFunctionExpression.NodeType.AsyncArrowFunctionExpression.rawValue:1245 self = .AsyncArrowFunctionExpression(try .init(from: decoder))1246 case JSSyntax.AsyncFunctionExpression.NodeType.AsyncFunctionExpression.rawValue:1247 self = .AsyncFunctionExpression(try .init(from: decoder))1248 case JSSyntax.ChainExpression.NodeType.ChainExpression.rawValue:1249 self = .ChainExpression(try .init(from: decoder))1250 case JSSyntax.RegexLiteral.NodeType.RegexLiteral.rawValue:1251 self = .RegexLiteral(try .init(from: decoder))1252 default:1253 throw DecodingError.keyNotFound(CodingKeys.type, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Bad value for type: \(typeName)"))1254 }1255 }1256 public func encode(to encoder: Encoder) throws {1257 switch self {1258 case .ThisExpression(let x): return try x.encode(to: encoder)1259 case .Identifier(let x): return try x.encode(to: encoder)1260 case .Literal(let x): return try x.encode(to: encoder)1261 case .SequenceExpression(let x): return try x.encode(to: encoder)1262 case .ArrayExpression(let x): return try x.encode(to: encoder)1263 case .MemberExpression(let x): return try x.encode(to: encoder)1264 case .MetaProperty(let x): return try x.encode(to: encoder)1265 case .CallExpression(let x): return try x.encode(to: encoder)1266 case .ObjectExpression(let x): return try x.encode(to: encoder)1267 case .FunctionExpression(let x): return try x.encode(to: encoder)1268 case .ArrowFunctionExpression(let x): return try x.encode(to: encoder)1269 case .ClassExpression(let x): return try x.encode(to: encoder)1270 case .TaggedTemplateExpression(let x): return try x.encode(to: encoder)1271 case .Super(let x): return try x.encode(to: encoder)1272 case .NewExpression(let x): return try x.encode(to: encoder)1273 case .UpdateExpression(let x): return try x.encode(to: encoder)1274 case .AwaitExpression(let x): return try x.encode(to: encoder)1275 case .UnaryExpression(let x): return try x.encode(to: encoder)1276 case .BinaryExpression(let x): return try x.encode(to: encoder)1277 case .LogicalExpression(let x): return try x.encode(to: encoder)1278 case .ConditionalExpression(let x): return try x.encode(to: encoder)1279 case .YieldExpression(let x): return try x.encode(to: encoder)1280 case .AssignmentExpression(let x): return try x.encode(to: encoder)1281 case .AsyncArrowFunctionExpression(let x): return try x.encode(to: encoder)1282 case .AsyncFunctionExpression(let x): return try x.encode(to: encoder)1283 case .ChainExpression(let x): return try x.encode(to: encoder)1284 case .RegexLiteral(let x): return try x.encode(to: encoder)1285 }1286 }1287 enum CodingKeys : String, CodingKey {1288 case type1289 }1290 }1291 public indirect enum Statement : Hashable, Codable {1292 case BlockStatement(BlockStatement)1293 case AsyncFunctionDeclaration(AsyncFunctionDeclaration)1294 case BreakStatement(BreakStatement)1295 case ContinueStatement(ContinueStatement)1296 case DebuggerStatement(DebuggerStatement)1297 case DoWhileStatement(DoWhileStatement)1298 case EmptyStatement(EmptyStatement)1299 case ExpressionStatement(ExpressionStatement)1300 case Directive(Directive)1301 case ForStatement(ForStatement)1302 case ForInStatement(ForInStatement)1303 case ForOfStatement(ForOfStatement)1304 case FunctionDeclaration(FunctionDeclaration)1305 case IfStatement(IfStatement)1306 case LabeledStatement(LabeledStatement)1307 case ReturnStatement(ReturnStatement)1308 case SwitchStatement(SwitchStatement)1309 case ThrowStatement(ThrowStatement)1310 case TryStatement(TryStatement)1311 case VariableDeclaration(VariableDeclaration)1312 case WhileStatement(WhileStatement)1313 case WithStatement(WithStatement)1314 public init(from decoder: Decoder) throws {1315 let typeName = try decoder1316 .container(keyedBy: CodingKeys.self)1317 .decode(String.self, forKey: .type)1318 switch typeName {1319 case JSSyntax.BlockStatement.NodeType.BlockStatement.rawValue:1320 self = .BlockStatement(try .init(from: decoder))1321 case JSSyntax.AsyncFunctionDeclaration.NodeType.AsyncFunctionDeclaration.rawValue:1322 self = .AsyncFunctionDeclaration(try .init(from: decoder))1323 case JSSyntax.BreakStatement.NodeType.BreakStatement.rawValue:1324 self = .BreakStatement(try .init(from: decoder))1325 case JSSyntax.ContinueStatement.NodeType.ContinueStatement.rawValue:1326 self = .ContinueStatement(try .init(from: decoder))1327 case JSSyntax.DebuggerStatement.NodeType.DebuggerStatement.rawValue:1328 self = .DebuggerStatement(try .init(from: decoder))1329 case JSSyntax.DoWhileStatement.NodeType.DoWhileStatement.rawValue:1330 self = .DoWhileStatement(try .init(from: decoder))1331 case JSSyntax.EmptyStatement.NodeType.EmptyStatement.rawValue:1332 self = .EmptyStatement(try .init(from: decoder))1333 case JSSyntax.ExpressionStatement.NodeType.ExpressionStatement.rawValue:1334 self = .ExpressionStatement(try .init(from: decoder))1335 case JSSyntax.Directive.NodeType.Directive.rawValue:1336 self = .Directive(try .init(from: decoder))1337 case JSSyntax.ForStatement.NodeType.ForStatement.rawValue:1338 self = .ForStatement(try .init(from: decoder))1339 case JSSyntax.ForInStatement.NodeType.ForInStatement.rawValue:1340 self = .ForInStatement(try .init(from: decoder))1341 case JSSyntax.ForOfStatement.NodeType.ForOfStatement.rawValue:1342 self = .ForOfStatement(try .init(from: decoder))1343 case JSSyntax.FunctionDeclaration.NodeType.FunctionDeclaration.rawValue:1344 self = .FunctionDeclaration(try .init(from: decoder))1345 case JSSyntax.IfStatement.NodeType.IfStatement.rawValue:1346 self = .IfStatement(try .init(from: decoder))1347 case JSSyntax.LabeledStatement.NodeType.LabeledStatement.rawValue:1348 self = .LabeledStatement(try .init(from: decoder))1349 case JSSyntax.ReturnStatement.NodeType.ReturnStatement.rawValue:1350 self = .ReturnStatement(try .init(from: decoder))1351 case JSSyntax.SwitchStatement.NodeType.SwitchStatement.rawValue:1352 self = .SwitchStatement(try .init(from: decoder))1353 case JSSyntax.ThrowStatement.NodeType.ThrowStatement.rawValue:1354 self = .ThrowStatement(try .init(from: decoder))1355 case JSSyntax.TryStatement.NodeType.TryStatement.rawValue:1356 self = .TryStatement(try .init(from: decoder))1357 case JSSyntax.VariableDeclaration.NodeType.VariableDeclaration.rawValue:1358 self = .VariableDeclaration(try .init(from: decoder))1359 case JSSyntax.WhileStatement.NodeType.WhileStatement.rawValue:1360 self = .WhileStatement(try .init(from: decoder))1361 case JSSyntax.WithStatement.NodeType.WithStatement.rawValue:1362 self = .WithStatement(try .init(from: decoder))1363 default:1364 throw DecodingError.keyNotFound(CodingKeys.type, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Bad value for type: \(typeName)"))1365 }1366 }1367 public func encode(to encoder: Encoder) throws {1368 switch self {1369 case .BlockStatement(let x): return try x.encode(to: encoder)1370 case .AsyncFunctionDeclaration(let x): return try x.encode(to: encoder)1371 case .BreakStatement(let x): return try x.encode(to: encoder)1372 case .ContinueStatement(let x): return try x.encode(to: encoder)1373 case .DebuggerStatement(let x): return try x.encode(to: encoder)1374 case .DoWhileStatement(let x): return try x.encode(to: encoder)1375 case .EmptyStatement(let x): return try x.encode(to: encoder)1376 case .ExpressionStatement(let x): return try x.encode(to: encoder)1377 case .Directive(let x): return try x.encode(to: encoder)1378 case .ForStatement(let x): return try x.encode(to: encoder)1379 case .ForInStatement(let x): return try x.encode(to: encoder)1380 case .ForOfStatement(let x): return try x.encode(to: encoder)1381 case .FunctionDeclaration(let x): return try x.encode(to: encoder)1382 case .IfStatement(let x): return try x.encode(to: encoder)1383 case .LabeledStatement(let x): return try x.encode(to: encoder)1384 case .ReturnStatement(let x): return try x.encode(to: encoder)1385 case .SwitchStatement(let x): return try x.encode(to: encoder)1386 case .ThrowStatement(let x): return try x.encode(to: encoder)1387 case .TryStatement(let x): return try x.encode(to: encoder)1388 case .VariableDeclaration(let x): return try x.encode(to: encoder)1389 case .WhileStatement(let x): return try x.encode(to: encoder)1390 case .WithStatement(let x): return try x.encode(to: encoder)1391 }1392 }1393 enum CodingKeys : String, CodingKey {1394 case type1395 }1396 }1397 public indirect enum Declaration : Hashable, Codable {1398 case AsyncFunctionDeclaration(AsyncFunctionDeclaration)1399 case ClassDeclaration(ClassDeclaration)1400 case ExportAllDeclaration(ExportAllDeclaration)1401 case ExportDefaultDeclaration(ExportDefaultDeclaration)1402 case ExportNamedDeclaration(ExportNamedDeclaration)1403 case FunctionDeclaration(FunctionDeclaration)1404 case ImportDeclaration(ImportDeclaration)1405 case VariableDeclaration(VariableDeclaration)1406 public init(from decoder: Decoder) throws {1407 let typeName = try decoder1408 .container(keyedBy: CodingKeys.self)1409 .decode(String.self, forKey: .type)1410 switch typeName {1411 case JSSyntax.AsyncFunctionDeclaration.NodeType.AsyncFunctionDeclaration.rawValue:1412 self = .AsyncFunctionDeclaration(try .init(from: decoder))1413 case JSSyntax.ClassDeclaration.NodeType.ClassDeclaration.rawValue:1414 self = .ClassDeclaration(try .init(from: decoder))1415 case JSSyntax.ExportAllDeclaration.NodeType.ExportAllDeclaration.rawValue:1416 self = .ExportAllDeclaration(try .init(from: decoder))1417 case JSSyntax.ExportDefaultDeclaration.NodeType.ExportDefaultDeclaration.rawValue:1418 self = .ExportDefaultDeclaration(try .init(from: decoder))1419 case JSSyntax.ExportNamedDeclaration.NodeType.ExportNamedDeclaration.rawValue:1420 self = .ExportNamedDeclaration(try .init(from: decoder))1421 case JSSyntax.FunctionDeclaration.NodeType.FunctionDeclaration.rawValue:1422 self = .FunctionDeclaration(try .init(from: decoder))1423 case JSSyntax.ImportDeclaration.NodeType.ImportDeclaration.rawValue:1424 self = .ImportDeclaration(try .init(from: decoder))1425 case JSSyntax.VariableDeclaration.NodeType.VariableDeclaration.rawValue:1426 self = .VariableDeclaration(try .init(from: decoder))1427 default:1428 throw DecodingError.keyNotFound(CodingKeys.type, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Bad value for type: \(typeName)"))1429 }1430 }1431 public func encode(to encoder: Encoder) throws {1432 switch self {1433 case .AsyncFunctionDeclaration(let x): return try x.encode(to: encoder)1434 case .ClassDeclaration(let x): return try x.encode(to: encoder)1435 case .ExportAllDeclaration(let x): return try x.encode(to: encoder)1436 case .ExportDefaultDeclaration(let x): return try x.encode(to: encoder)1437 case .ExportNamedDeclaration(let x): return try x.encode(to: encoder)1438 case .FunctionDeclaration(let x): return try x.encode(to: encoder)1439 case .ImportDeclaration(let x): return try x.encode(to: encoder)1440 case .VariableDeclaration(let x): return try x.encode(to: encoder)1441 }1442 }1443 enum CodingKeys : String, CodingKey {1444 case type1445 }1446 }1447 public typealias ArgumentListElementOneOf = OneOf<Expression>1448 .Or<SpreadElement>1449 public indirect enum ArgumentListElement : Hashable, Codable {1450 case Expression(Expression)1451 case SpreadElement(SpreadElement)1452 public init(from decoder: Decoder) throws {1453 let typeName = try decoder1454 .container(keyedBy: CodingKeys.self)1455 .decode(String.self, forKey: .type)1456 switch typeName {1457 case JSSyntax.SpreadElement.NodeType.SpreadElement.rawValue:1458 self = .SpreadElement(try .init(from: decoder))1459 default:1460 self = .Expression(try .init(from: decoder))1461 }1462 }1463 public func encode(to encoder: Encoder) throws {1464 switch self {1465 case .Expression(let x): return try x.encode(to: encoder)1466 case .SpreadElement(let x): return try x.encode(to: encoder)1467 }1468 }1469 enum CodingKeys : String, CodingKey {1470 case type1471 }1472 }1473 public typealias ArrayExpressionElementOneOf = Nullable<OneOf<Expression>1474 .Or<SpreadElement>>1475 public indirect enum ArrayExpressionElement : Hashable, Codable {1476 case Expression(Expression)1477 case SpreadElement(SpreadElement)1478 public init(from decoder: Decoder) throws {1479 let typeName = try decoder1480 .container(keyedBy: CodingKeys.self)1481 .decode(String.self, forKey: .type)1482 switch typeName {1483 case JSSyntax.SpreadElement.NodeType.SpreadElement.rawValue:1484 self = .SpreadElement(try .init(from: decoder))1485 default:1486 self = .Expression(try .init(from: decoder))1487 }1488 }1489 public func encode(to encoder: Encoder) throws {1490 switch self {1491 case .Expression(let x): return try x.encode(to: encoder)1492 case .SpreadElement(let x): return try x.encode(to: encoder)1493 }1494 }1495 enum CodingKeys : String, CodingKey {1496 case type1497 }1498 }1499 public typealias ArrayPatternElement = OneOf<AssignmentPattern>1500 .Or<BindingIdentifier>1501 .Or<BindingPattern>1502 .Or<RestElement>1503// public indirect enum ArrayPatternElement : Hashable, Codable {1504// case AssignmentPattern(AssignmentPattern)1505// case BindingIdentifier(BindingIdentifier)1506// case BindingPattern(BindingPattern)1507// case RestElement(RestElement)1508//1509// public init(from decoder: Decoder) throws {1510// let typeName = try decoder1511// .container(keyedBy: CodingKeys.self)1512// .decode(String.self, forKey: .type)1513//1514// switch typeName {1515// case JSSyntax.AssignmentPattern.NodeType.AssignmentPattern.rawValue:1516// self = .AssignmentPattern(try .init(from: decoder))1517// case JSSyntax.BindingIdentifier.NodeType.BindingIdentifier.rawValue:1518// self = .BindingIdentifier(try .init(from: decoder))1519// case JSSyntax.BindingPattern.NodeType.BindingPattern.rawValue:1520// self = .BindingPattern(try .init(from: decoder))1521// case JSSyntax.RestElement.NodeType.RestElement.rawValue:1522// self = .RestElement(try .init(from: decoder))1523// default:1524// throw DecodingError.keyNotFound(CodingKeys.type, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Bad value for type: \(typeName)"))1525// }1526// }1527//1528// public func encode(to encoder: Encoder) throws {1529// switch self {1530// case .AssignmentPattern(let x): return try x.encode(to: encoder)1531// case .BindingIdentifier(let x): return try x.encode(to: encoder)1532// case .BindingPattern(let x): return try x.encode(to: encoder)1533// case .RestElement(let x): return try x.encode(to: encoder)1534// }1535// }1536//1537// enum CodingKeys : String, CodingKey {1538// case type1539// }1540// }1541 public typealias BindingPatternOneOf = OneOf<ArrayPattern>1542 .Or<ObjectPattern>1543 public indirect enum BindingPattern : Hashable, Codable {1544 case ArrayPattern(ArrayPattern)1545 case ObjectPattern(ObjectPattern)1546 public init(from decoder: Decoder) throws {1547 let typeName = try decoder1548 .container(keyedBy: CodingKeys.self)1549 .decode(String.self, forKey: .type)1550 switch typeName {1551 case JSSyntax.ArrayPattern.NodeType.ArrayPattern.rawValue:1552 self = .ArrayPattern(try .init(from: decoder))1553 case JSSyntax.ObjectPattern.NodeType.ObjectPattern.rawValue:1554 self = .ObjectPattern(try .init(from: decoder))1555 default:1556 throw DecodingError.keyNotFound(CodingKeys.type, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Bad value for type: \(typeName)"))1557 }1558 }1559 public func encode(to encoder: Encoder) throws {1560 switch self {1561 case .ArrayPattern(let x): return try x.encode(to: encoder)1562 case .ObjectPattern(let x): return try x.encode(to: encoder)1563 }1564 }1565 enum CodingKeys : String, CodingKey {1566 case type1567 }1568 }1569 public typealias BindingIdentifier = Identifier1570 public typealias ChainElementOneOf = OneOf<CallExpression>1571 .Or<ComputedMemberExpression>1572 .Or<StaticMemberExpression>1573 public indirect enum ChainElement : Hashable, Codable {1574 case CallExpression(CallExpression)1575 case ComputedMemberExpression(ComputedMemberExpression)1576 case StaticMemberExpression(StaticMemberExpression)1577 public init(from decoder: Decoder) throws {1578 let typeName = try decoder1579 .container(keyedBy: CodingKeys.self)1580 .decode(String.self, forKey: .type)1581 switch typeName {1582 case JSSyntax.CallExpression.NodeType.CallExpression.rawValue:1583 self = .CallExpression(try .init(from: decoder))1584 case JSSyntax.ComputedMemberExpression.NodeType.ComputedMemberExpression.rawValue:1585 self = .ComputedMemberExpression(try .init(from: decoder))1586 case JSSyntax.StaticMemberExpression.NodeType.StaticMemberExpression.rawValue:1587 self = .StaticMemberExpression(try .init(from: decoder))1588 default:1589 throw DecodingError.keyNotFound(CodingKeys.type, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Bad value for type: \(typeName)"))1590 }1591 }1592 public func encode(to encoder: Encoder) throws {1593 switch self {1594 case .CallExpression(let x): return try x.encode(to: encoder)1595 case .ComputedMemberExpression(let x): return try x.encode(to: encoder)1596 case .StaticMemberExpression(let x): return try x.encode(to: encoder)1597 }1598 }1599 enum CodingKeys : String, CodingKey {1600 case type1601 }1602 }1603 public typealias ExportableDefaultDeclaration = OneOf<BindingIdentifier>1604 .Or<BindingPattern>1605 .Or<ClassDeclaration>1606 .Or<Expression>1607 .Or<FunctionDeclaration>1608// public indirect enum ExportableDefaultDeclaration : Hashable, Codable {1609// case BindingIdentifier(BindingIdentifier)1610// case BindingPattern(BindingPattern)1611// case ClassDeclaration(ClassDeclaration)1612// case Expression(Expression)1613// case FunctionDeclaration(FunctionDeclaration)1614//1615// public init(from decoder: Decoder) throws {1616// let typeName = try decoder1617// .container(keyedBy: CodingKeys.self)1618// .decode(String.self, forKey: .type)1619//1620// switch typeName {1621// case JSSyntax.BindingIdentifier.NodeType.BindingIdentifier.rawValue:1622// self = .BindingIdentifier(try .init(from: decoder))1623// case JSSyntax.BindingPattern.NodeType.BindingPattern.rawValue:1624// self = .BindingPattern(try .init(from: decoder))1625// case JSSyntax.ClassDeclaration.NodeType.ClassDeclaration.rawValue:1626// self = .ClassDeclaration(try .init(from: decoder))1627// case JSSyntax.Expression.NodeType.Expression.rawValue:1628// self = .Expression(try .init(from: decoder))1629// case JSSyntax.FunctionDeclaration.NodeType.FunctionDeclaration.rawValue:1630// self = .FunctionDeclaration(try .init(from: decoder))1631// default:1632// throw DecodingError.keyNotFound(CodingKeys.type, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Bad value for type: \(typeName)"))1633// }1634// }1635//1636// public func encode(to encoder: Encoder) throws {1637// switch self {1638// case .BindingIdentifier(let x): return try x.encode(to: encoder)1639// case .BindingPattern(let x): return try x.encode(to: encoder)1640// case .ClassDeclaration(let x): return try x.encode(to: encoder)1641// case .Expression(let x): return try x.encode(to: encoder)1642// case .FunctionDeclaration(let x): return try x.encode(to: encoder)1643// }1644// }1645//1646// enum CodingKeys : String, CodingKey {1647// case type1648// }1649// }1650 public typealias ExportableNamedDeclarationOneOf = OneOf<AsyncFunctionDeclaration>1651 .Or<ClassDeclaration>1652 .Or<FunctionDeclaration>1653 .Or<VariableDeclaration>1654 public indirect enum ExportableNamedDeclaration : Hashable, Codable {1655 case AsyncFunctionDeclaration(AsyncFunctionDeclaration)1656 case ClassDeclaration(ClassDeclaration)1657 case FunctionDeclaration(FunctionDeclaration)1658 case VariableDeclaration(VariableDeclaration)1659 public init(from decoder: Decoder) throws {1660 let typeName = try decoder1661 .container(keyedBy: CodingKeys.self)1662 .decode(String.self, forKey: .type)1663 switch typeName {1664 case JSSyntax.AsyncFunctionDeclaration.NodeType.AsyncFunctionDeclaration.rawValue:1665 self = .AsyncFunctionDeclaration(try .init(from: decoder))1666 case JSSyntax.ClassDeclaration.NodeType.ClassDeclaration.rawValue:1667 self = .ClassDeclaration(try .init(from: decoder))1668 case JSSyntax.FunctionDeclaration.NodeType.FunctionDeclaration.rawValue:1669 self = .FunctionDeclaration(try .init(from: decoder))1670 case JSSyntax.VariableDeclaration.NodeType.VariableDeclaration.rawValue:1671 self = .VariableDeclaration(try .init(from: decoder))1672 default:1673 throw DecodingError.keyNotFound(CodingKeys.type, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Bad value for type: \(typeName)"))1674 }1675 }1676 public func encode(to encoder: Encoder) throws {1677 switch self {1678 case .AsyncFunctionDeclaration(let x): return try x.encode(to: encoder)1679 case .ClassDeclaration(let x): return try x.encode(to: encoder)1680 case .FunctionDeclaration(let x): return try x.encode(to: encoder)1681 case .VariableDeclaration(let x): return try x.encode(to: encoder)1682 }1683 }1684 enum CodingKeys : String, CodingKey {1685 case type1686 }1687 }1688 public typealias ExportDeclarationOneOf = OneOf<ExportAllDeclaration>1689 .Or<ExportDefaultDeclaration>1690 .Or<ExportNamedDeclaration>1691 public indirect enum ExportDeclaration : Hashable, Codable {1692 case ExportAllDeclaration(ExportAllDeclaration)1693 case ExportDefaultDeclaration(ExportDefaultDeclaration)1694 case ExportNamedDeclaration(ExportNamedDeclaration)1695 public init(from decoder: Decoder) throws {1696 let typeName = try decoder1697 .container(keyedBy: CodingKeys.self)1698 .decode(String.self, forKey: .type)1699 switch typeName {1700 case JSSyntax.ExportAllDeclaration.NodeType.ExportAllDeclaration.rawValue:1701 self = .ExportAllDeclaration(try .init(from: decoder))1702 case JSSyntax.ExportDefaultDeclaration.NodeType.ExportDefaultDeclaration.rawValue:1703 self = .ExportDefaultDeclaration(try .init(from: decoder))1704 case JSSyntax.ExportNamedDeclaration.NodeType.ExportNamedDeclaration.rawValue:1705 self = .ExportNamedDeclaration(try .init(from: decoder))1706 default:1707 throw DecodingError.keyNotFound(CodingKeys.type, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Bad value for type: \(typeName)"))1708 }1709 }1710 public func encode(to encoder: Encoder) throws {1711 switch self {1712 case .ExportAllDeclaration(let x): return try x.encode(to: encoder)1713 case .ExportDefaultDeclaration(let x): return try x.encode(to: encoder)1714 case .ExportNamedDeclaration(let x): return try x.encode(to: encoder)1715 }1716 }1717 enum CodingKeys : String, CodingKey {1718 case type1719 }1720 }1721 public typealias FunctionParameter = OneOf<AssignmentPattern>1722 .Or<BindingIdentifier>1723 .Or<BindingPattern>1724// public indirect enum FunctionParameter : Hashable, Codable {1725// case AssignmentPattern(AssignmentPattern)1726// case BindingIdentifier(BindingIdentifier)1727// case BindingPattern(BindingPattern)1728//1729// public init(from decoder: Decoder) throws {1730// let typeName = try decoder1731// .container(keyedBy: CodingKeys.self)1732// .decode(String.self, forKey: .type)1733//1734// switch typeName {1735// case JSSyntax.AssignmentPattern.NodeType.AssignmentPattern.rawValue:1736// self = .AssignmentPattern(try .init(from: decoder))1737// case JSSyntax.BindingIdentifier.NodeType.BindingIdentifier.rawValue:1738// self = .BindingIdentifier(try .init(from: decoder))1739// case JSSyntax.BindingPattern.NodeType.BindingPattern.rawValue:1740// self = .BindingPattern(try .init(from: decoder))1741// default:1742// throw DecodingError.keyNotFound(CodingKeys.type, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Bad value for type: \(typeName)"))1743// }1744// }1745//1746// public func encode(to encoder: Encoder) throws {1747// switch self {1748// case .AssignmentPattern(let x): return try x.encode(to: encoder)1749// case .BindingIdentifier(let x): return try x.encode(to: encoder)1750// case .BindingPattern(let x): return try x.encode(to: encoder)1751// }1752// }1753//1754// enum CodingKeys : String, CodingKey {1755// case type1756// }1757// }1758 public typealias ImportDeclarationSpecifierOneOf = OneOf<ImportDefaultSpecifier>1759 .Or<ImportNamespaceSpecifier>1760 .Or<ImportSpecifier>1761 public indirect enum ImportDeclarationSpecifier : Hashable, Codable {1762 case ImportDefaultSpecifier(ImportDefaultSpecifier)1763 case ImportNamespaceSpecifier(ImportNamespaceSpecifier)1764 case ImportSpecifier(ImportSpecifier)1765 public init(from decoder: Decoder) throws {1766 let typeName = try decoder1767 .container(keyedBy: CodingKeys.self)1768 .decode(String.self, forKey: .type)1769 switch typeName {1770 case JSSyntax.ImportDefaultSpecifier.NodeType.ImportDefaultSpecifier.rawValue:1771 self = .ImportDefaultSpecifier(try .init(from: decoder))1772 case JSSyntax.ImportNamespaceSpecifier.NodeType.ImportNamespaceSpecifier.rawValue:1773 self = .ImportNamespaceSpecifier(try .init(from: decoder))1774 case JSSyntax.ImportSpecifier.NodeType.ImportSpecifier.rawValue:1775 self = .ImportSpecifier(try .init(from: decoder))1776 default:1777 throw DecodingError.keyNotFound(CodingKeys.type, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Bad value for type: \(typeName)"))1778 }1779 }1780 public func encode(to encoder: Encoder) throws {1781 switch self {1782 case .ImportDefaultSpecifier(let x): return try x.encode(to: encoder)1783 case .ImportNamespaceSpecifier(let x): return try x.encode(to: encoder)1784 case .ImportSpecifier(let x): return try x.encode(to: encoder)1785 }1786 }1787 enum CodingKeys : String, CodingKey {1788 case type1789 }1790 }1791 public typealias ObjectExpressionPropertyOneOf = OneOf<Property>1792 .Or<SpreadElement>1793 public indirect enum ObjectExpressionProperty : Hashable, Codable {1794 case Property(Property)1795 case SpreadElement(SpreadElement)1796 public init(from decoder: Decoder) throws {1797 let typeName = try decoder1798 .container(keyedBy: CodingKeys.self)1799 .decode(String.self, forKey: .type)1800 switch typeName {1801 case JSSyntax.Property.NodeType.Property.rawValue:1802 self = .Property(try .init(from: decoder))1803 case JSSyntax.SpreadElement.NodeType.SpreadElement.rawValue:1804 self = .SpreadElement(try .init(from: decoder))1805 default:1806 throw DecodingError.keyNotFound(CodingKeys.type, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Bad value for type: \(typeName)"))1807 }1808 }1809 public func encode(to encoder: Encoder) throws {1810 switch self {1811 case .Property(let x): return try x.encode(to: encoder)1812 case .SpreadElement(let x): return try x.encode(to: encoder)1813 }1814 }1815 enum CodingKeys : String, CodingKey {1816 case type1817 }1818 }1819 public typealias ObjectPatternPropertyOneOf = OneOf<Property>1820 .Or<RestElement>1821 public indirect enum ObjectPatternProperty : Hashable, Codable {1822 case Property(Property)1823 case RestElement(RestElement)1824 public init(from decoder: Decoder) throws {1825 let typeName = try decoder1826 .container(keyedBy: CodingKeys.self)1827 .decode(String.self, forKey: .type)1828 switch typeName {1829 case JSSyntax.Property.NodeType.Property.rawValue:1830 self = .Property(try .init(from: decoder))1831 case JSSyntax.RestElement.NodeType.RestElement.rawValue:1832 self = .RestElement(try .init(from: decoder))1833 default:1834 throw DecodingError.keyNotFound(CodingKeys.type, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Bad value for type: \(typeName)"))1835 }1836 }1837 public func encode(to encoder: Encoder) throws {1838 switch self {1839 case .Property(let x): return try x.encode(to: encoder)1840 case .RestElement(let x): return try x.encode(to: encoder)1841 }1842 }1843 enum CodingKeys : String, CodingKey {1844 case type1845 }1846 }1847 public typealias PropertyKeyOneOf = OneOf<Identifier>1848 .Or<Literal>1849 public indirect enum PropertyKey : Hashable, Codable {1850 case Identifier(Identifier)1851 case Literal(Literal)1852 public init(from decoder: Decoder) throws {1853 let typeName = try decoder1854 .container(keyedBy: CodingKeys.self)1855 .decode(String.self, forKey: .type)1856 switch typeName {1857 case JSSyntax.Identifier.NodeType.Identifier.rawValue:1858 self = .Identifier(try .init(from: decoder))1859 case JSSyntax.Literal.NodeType.Literal.rawValue:1860 self = .Literal(try .init(from: decoder))1861 default:1862 throw DecodingError.keyNotFound(CodingKeys.type, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Bad value for type: \(typeName)"))1863 }1864 }1865 public func encode(to encoder: Encoder) throws {1866 switch self {1867 case .Identifier(let x): return try x.encode(to: encoder)1868 case .Literal(let x): return try x.encode(to: encoder)1869 }1870 }1871 enum CodingKeys : String, CodingKey {1872 case type1873 }1874 }1875 public typealias StatementListItem = OneOf<Declaration>1876 .Or<Statement>1877// public indirect enum StatementListItem : Hashable, Codable {1878// case Declaration(Declaration)1879// case Statement(Statement)1880//1881// public init(from decoder: Decoder) throws {1882// let typeName = try decoder1883// .container(keyedBy: CodingKeys.self)1884// .decode(String.self, forKey: .type)1885//1886// switch typeName {1887// case JSSyntax.Declaration.NodeType.Declaration.rawValue:1888// self = .Declaration(try .init(from: decoder))1889// case JSSyntax.Statement.NodeType.Statement.rawValue:1890// self = .Statement(try .init(from: decoder))1891// default:1892// throw DecodingError.keyNotFound(CodingKeys.type, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Bad value for type: \(typeName)"))1893// }1894// }1895//1896// public func encode(to encoder: Encoder) throws {1897// switch self {1898// case .Declaration(let x): return try x.encode(to: encoder)1899// case .Statement(let x): return try x.encode(to: encoder)1900// }1901// }1902//1903// enum CodingKeys : String, CodingKey {1904// case type1905// }1906// }1907 public typealias ModuleItem = OneOf<ImportDeclaration>1908 .Or<ExportDeclaration>1909 .Or<StatementListItem>1910// public indirect enum ModuleItem : Hashable, Codable {1911// case ImportDeclaration(ImportDeclaration)1912// case ExportDeclaration(ExportDeclaration)1913// case StatementListItem(StatementListItem)1914//1915// public init(from decoder: Decoder) throws {1916// let typeName = try decoder1917// .container(keyedBy: CodingKeys.self)1918// .decode(String.self, forKey: .type)1919//1920// switch typeName {1921// case JSSyntax.ImportDeclaration.NodeType.ImportDeclaration.rawValue:1922// self = .ImportDeclaration(try .init(from: decoder))1923// case JSSyntax.ExportDeclaration.NodeType.ExportDeclaration.rawValue:1924// self = .ExportDeclaration(try .init(from: decoder))1925// case JSSyntax.StatementListItem.NodeType.StatementListItem.rawValue:1926// self = .StatementListItem(try .init(from: decoder))1927// default:1928// throw DecodingError.keyNotFound(CodingKeys.type, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Bad value for type: \(typeName)"))1929// }1930// }1931//1932// public func encode(to encoder: Encoder) throws {1933// switch self {1934// case .ImportDeclaration(let x): return try x.encode(to: encoder)1935// case .ExportDeclaration(let x): return try x.encode(to: encoder)1936// case .StatementListItem(let x): return try x.encode(to: encoder)1937// }1938// }1939//1940// enum CodingKeys : String, CodingKey {1941// case type1942// }1943// }1944}1945@available(*, deprecated, message: "Prefer custom enums over OneOf for performance")1946extension JSSyntax {1947 public typealias StatementOneOf = OneOf<BlockStatement>1948 .Or<AsyncFunctionDeclaration>1949 .Or<BreakStatement>1950 .Or<ContinueStatement>1951 .Or<DebuggerStatement>1952 .Or<DoWhileStatement>1953 .Or<EmptyStatement>1954 .Or<ExpressionStatement>1955 .Or<Directive>1956 .Or<ForStatement>1957 .Or<ForInStatement>1958 .Or<ForOfStatement>1959 .Or<FunctionDeclaration>1960 .Or<IfStatement>1961 .Or<LabeledStatement>1962 .Or<ReturnStatement>1963 .Or<SwitchStatement>1964 .Or<ThrowStatement>1965 .Or<TryStatement>1966 .Or<VariableDeclaration>1967 .Or<WhileStatement>1968 .Or<WithStatement>1969 public typealias ExpressionOneOf = OneOf<ThisExpression>1970 .Or<Identifier>1971 .Or<Literal>1972 .Or<SequenceExpression>1973 .Or<ArrayExpression>1974 .Or<MemberExpression>1975 .Or<MetaProperty>1976 .Or<CallExpression>1977 .Or<ObjectExpression>1978 .Or<FunctionExpression>1979 .Or<ArrowFunctionExpression>1980 .Or<ClassExpression>1981 .Or<TaggedTemplateExpression>1982 .Or<Super>1983 .Or<NewExpression>1984 .Or<UpdateExpression>1985 .Or<AwaitExpression>1986 .Or<UnaryExpression>1987 .Or<BinaryExpression>1988 .Or<LogicalExpression>1989 .Or<ConditionalExpression>1990 .Or<YieldExpression>1991 .Or<AssignmentExpression>1992 .Or<AsyncArrowFunctionExpression>1993 .Or<AsyncFunctionExpression>1994 .Or<ChainExpression>1995 .Or<RegexLiteral>1996 public typealias DeclarationOneOf = OneOf<AsyncFunctionDeclaration>1997 .Or<ClassDeclaration>1998 .Or<ExportDeclaration>1999 .Or<FunctionDeclaration>2000 .Or<ImportDeclaration>2001 .Or<VariableDeclaration>2002}2003// - MARK: messages.ts2004public enum Messages {2005 case BadImportCallArity2006 case BadGetterArity2007 case BadSetterArity2008 case BadSetterRestParameter2009 case ConstructorIsAsync2010 case ConstructorSpecialMethod...

Full Screen

Full Screen

MockableTypeTemplate.swift

Source:MockableTypeTemplate.swift Github

copy

Full Screen

2import Foundation3import MockingbirdCommon4enum Declaration: String, CustomStringConvertible {5 case functionDeclaration = "Mockingbird.FunctionDeclaration"6 case asyncFunctionDeclaration = "Mockingbird.AsyncFunctionDeclaration"7 case throwingFunctionDeclaration = "Mockingbird.ThrowingFunctionDeclaration"8 case throwingAsyncFunctionDeclaration = "Mockingbird.ThrowingAsyncFunctionDeclaration"9 10 case propertyGetterDeclaration = "Mockingbird.PropertyGetterDeclaration"11 case propertySetterDeclaration = "Mockingbird.PropertySetterDeclaration"12 13 case subscriptGetterDeclaration = "Mockingbird.SubscriptGetterDeclaration"14 case subscriptSetterDeclaration = "Mockingbird.SubscriptSetterDeclaration"15 16 var description: String { return rawValue }17}18extension GenericType {19 var flattenedDeclaration: String {20 guard !constraints.isEmpty else { return name }21 let flattenedInheritedTypes = String(list: constraints.sorted(), separator: " & ")22 return "\(name): \(flattenedInheritedTypes)"...

Full Screen

Full Screen

Declaration.swift

Source:Declaration.swift Github

copy

Full Screen

...11public class PropertySetterDeclaration: VariableDeclaration {}12/// Mockable function declarations.13public class FunctionDeclaration: Declaration {}14/// Mockable async function declarations.15public class AsyncFunctionDeclaration: FunctionDeclaration {}16/// Mockable throwing function declarations.17public class ThrowingFunctionDeclaration: FunctionDeclaration {}18/// Mockable throwing async function declarations.19public class ThrowingAsyncFunctionDeclaration: AsyncFunctionDeclaration {}20/// Mockable subscript declarations.21public class SubscriptDeclaration: Declaration {}22/// Mockable subscript getter declarations.23public class SubscriptGetterDeclaration: SubscriptDeclaration {}24/// Mockable subscript setter declarations.25public class SubscriptSetterDeclaration: SubscriptDeclaration {}26/// All mockable declarations conform to this protocol.27public protocol AnyMockable {}28/// Represents a mocked declaration that can be stubbed or verified.29public struct Mockable<DeclarationType: Declaration, InvocationType, ReturnType>: AnyMockable {30 let context: Context31 let invocation: Invocation32}...

Full Screen

Full Screen

AsyncFunctionDeclaration

Using AI Code Generation

copy

Full Screen

1import Mockingbird2let asyncFunctionDeclaration = AsyncFunctionDeclaration()3asyncFunctionDeclaration.asyncFunction()4import Mockingbird5let asyncFunctionDeclaration = AsyncFunctionDeclaration()6asyncFunctionDeclaration.asyncFunction()7import Mockingbird8let asyncFunctionDeclaration = AsyncFunctionDeclaration()9asyncFunctionDeclaration.asyncFunction()10import Mockingbird11let asyncFunctionDeclaration = AsyncFunctionDeclaration()12asyncFunctionDeclaration.asyncFunction()13import Mockingbird14let asyncFunctionDeclaration = AsyncFunctionDeclaration()15asyncFunctionDeclaration.asyncFunction()16import Mockingbird17let asyncFunctionDeclaration = AsyncFunctionDeclaration()18asyncFunctionDeclaration.asyncFunction()19import Mockingbird20let asyncFunctionDeclaration = AsyncFunctionDeclaration()21asyncFunctionDeclaration.asyncFunction()22import Mockingbird23let asyncFunctionDeclaration = AsyncFunctionDeclaration()24asyncFunctionDeclaration.asyncFunction()25import Mockingbird26let asyncFunctionDeclaration = AsyncFunctionDeclaration()27asyncFunctionDeclaration.asyncFunction()28import Mockingbird29let asyncFunctionDeclaration = AsyncFunctionDeclaration()30asyncFunctionDeclaration.asyncFunction()31import Mockingbird32let asyncFunctionDeclaration = AsyncFunctionDeclaration()33asyncFunctionDeclaration.asyncFunction()34import Mockingbird35let asyncFunctionDeclaration = AsyncFunctionDeclaration()36asyncFunctionDeclaration.asyncFunction()37import Mockingbird38let asyncFunctionDeclaration = AsyncFunctionDeclaration()

Full Screen

Full Screen

AsyncFunctionDeclaration

Using AI Code Generation

copy

Full Screen

1import Mockingbird2import XCTest3class AsyncFunctionDeclarationTests: XCTestCase {4 func testAsyncFunctionDeclaration() {5 let asyncFunctionDeclaration = AsyncFunctionDeclaration()6 asyncFunctionDeclaration.asyncFunction()7 }8}9import Mockingbird10import XCTest11class AsyncFunctionDeclarationTests: XCTestCase {12 func testAsyncFunctionDeclaration() {13 let asyncFunctionDeclaration = AsyncFunctionDeclaration()14 asyncFunctionDeclaration.asyncFunction()15 }16}17import Mockingbird18import XCTest19class AsyncFunctionDeclarationTests: XCTestCase {20 func testAsyncFunctionDeclaration() {21 let asyncFunctionDeclaration = AsyncFunctionDeclaration()22 asyncFunctionDeclaration.asyncFunction()23 }24}25import Mockingbird26import XCTest27class AsyncFunctionDeclarationTests: XCTestCase {28 func testAsyncFunctionDeclaration() {29 let asyncFunctionDeclaration = AsyncFunctionDeclaration()30 asyncFunctionDeclaration.asyncFunction()31 }32}33import Mockingbird34import XCTest35class AsyncFunctionDeclarationTests: XCTestCase {36 func testAsyncFunctionDeclaration() {37 let asyncFunctionDeclaration = AsyncFunctionDeclaration()38 asyncFunctionDeclaration.asyncFunction()39 }40}41import Mockingbird42import XCTest43class AsyncFunctionDeclarationTests: XCTestCase {44 func testAsyncFunctionDeclaration() {45 let asyncFunctionDeclaration = AsyncFunctionDeclaration()46 asyncFunctionDeclaration.asyncFunction()47 }48}49import Mockingbird50import XCTest51class AsyncFunctionDeclarationTests: XCTestCase {52 func testAsyncFunctionDeclaration() {53 let asyncFunctionDeclaration = AsyncFunctionDeclaration()54 asyncFunctionDeclaration.asyncFunction()55 }56}57import Mockingbird58import XCTest59class AsyncFunctionDeclarationTests: XCTestCase {60 func testAsyncFunctionDeclaration() {61 let asyncFunctionDeclaration = AsyncFunctionDeclaration()62 asyncFunctionDeclaration.asyncFunction()63 }64}

Full Screen

Full Screen

AsyncFunctionDeclaration

Using AI Code Generation

copy

Full Screen

1import Mockingbird2let asyncFunctionDeclaration = AsyncFunctionDeclaration()3asyncFunctionDeclaration.asyncFunctionDeclaration { (result) in4 print(result)5}6import Mockingbird7let asyncFunctionDeclaration = AsyncFunctionDeclaration()8asyncFunctionDeclaration.asyncFunctionDeclaration { (result) in9 print(result)10}11import Mockingbird12let asyncFunctionDeclaration = AsyncFunctionDeclaration()13asyncFunctionDeclaration.asyncFunctionDeclaration { (result) in14 print(result)15}16import Mockingbird17let asyncFunctionDeclaration = AsyncFunctionDeclaration()18asyncFunctionDeclaration.asyncFunctionDeclaration { (result) in19 print(result)20}21import Mockingbird22let asyncFunctionDeclaration = AsyncFunctionDeclaration()23asyncFunctionDeclaration.asyncFunctionDeclaration { (result) in24 print(result)25}26import Mockingbird27let asyncFunctionDeclaration = AsyncFunctionDeclaration()28asyncFunctionDeclaration.asyncFunctionDeclaration { (result) in29 print(result)30}31import Mockingbird32let asyncFunctionDeclaration = AsyncFunctionDeclaration()33asyncFunctionDeclaration.asyncFunctionDeclaration { (result) in34 print(result)35}36import Mockingbird37let asyncFunctionDeclaration = AsyncFunctionDeclaration()38asyncFunctionDeclaration.asyncFunctionDeclaration { (result) in39 print(result)40}41import Mockingbird42let asyncFunctionDeclaration = AsyncFunctionDeclaration()43asyncFunctionDeclaration.asyncFunctionDeclaration { (result) in44 print(result)45}46import Mockingbird47let asyncFunctionDeclaration = AsyncFunctionDeclaration()48asyncFunctionDeclaration.asyncFunctionDeclaration { (result) in49 print(result)50}

Full Screen

Full Screen

AsyncFunctionDeclaration

Using AI Code Generation

copy

Full Screen

1import Mockingbird2class AsyncFunctionDeclaration {3 func testAsyncFunctionDeclaration() async { }4}5import Mockingbird6class AsyncFunctionDeclaration {7 func testAsyncFunctionDeclaration() async { }8}9import Mockingbird10class AsyncFunctionDeclaration {11 func testAsyncFunctionDeclaration() async { }12}13import Mockingbird14class AsyncFunctionDeclaration {15 func testAsyncFunctionDeclaration() async { }16}17import Mockingbird18class AsyncFunctionDeclaration {19 func testAsyncFunctionDeclaration() async { }20}21import Mockingbird22class AsyncFunctionDeclaration {23 func testAsyncFunctionDeclaration() async { }24}25import Mockingbird26class AsyncFunctionDeclaration {27 func testAsyncFunctionDeclaration() async { }28}29import Mockingbird30class AsyncFunctionDeclaration {31 func testAsyncFunctionDeclaration() async { }32}33import Mockingbird34class AsyncFunctionDeclaration {35 func testAsyncFunctionDeclaration() async { }36}37import Mockingbird38class AsyncFunctionDeclaration {39 func testAsyncFunctionDeclaration() async { }40}41import Mockingbird42class AsyncFunctionDeclaration {43 func testAsyncFunctionDeclaration() async { }44}

Full Screen

Full Screen

AsyncFunctionDeclaration

Using AI Code Generation

copy

Full Screen

1let asyncFunctionDeclaration = try AsyncFunctionDeclaration(path: "/path/to/file.swift", name: "myFunction")2let asyncFunction = try asyncFunctionDeclaration.declaration()3let asyncFunctionDeclaration = try AsyncFunctionDeclaration(path: "/path/to/file.swift", name: "myFunction")4let asyncFunction = try asyncFunctionDeclaration.declaration()5let asyncFunctionDeclaration = try AsyncFunctionDeclaration(path: "/path/to/file.swift", name: "myFunction")6let asyncFunction = try asyncFunctionDeclaration.declaration()7let asyncFunctionDeclaration = try AsyncFunctionDeclaration(path: "/path/to/file.swift", name: "myFunction")8let asyncFunction = try asyncFunctionDeclaration.declaration()9let asyncFunctionDeclaration = try AsyncFunctionDeclaration(path: "/path/to/file.swift", name: "myFunction")10let asyncFunction = try asyncFunctionDeclaration.declaration()11let asyncFunctionDeclaration = try AsyncFunctionDeclaration(path: "/path/to/file.swift", name: "myFunction")12let asyncFunction = try asyncFunctionDeclaration.declaration()13let asyncFunctionDeclaration = try AsyncFunctionDeclaration(path: "/path/to/file.swift", name: "myFunction")14let asyncFunction = try asyncFunctionDeclaration.declaration()15let asyncFunctionDeclaration = try AsyncFunctionDeclaration(path: "/path/to/file.swift", name: "myFunction")16let asyncFunction = try asyncFunctionDeclaration.declaration()17let asyncFunctionDeclaration = try AsyncFunctionDeclaration(path: "/path/to/file.swift", name: "myFunction")18let asyncFunction = try asyncFunctionDeclaration.declaration()19let asyncFunctionDeclaration = try AsyncFunctionDeclaration(path: "/

Full Screen

Full Screen

AsyncFunctionDeclaration

Using AI Code Generation

copy

Full Screen

1import AsyncFunctionDeclaration2import Foundation3func asyncFunction() async -> String {4}5func asyncThrowsFunction() async throws -> String {6}7func asyncFunctionWithArgument(arg: String) async -> String {8}9func asyncFunctionWithArgument(arg: String) async throws -> String {10}11func asyncFunctionWithMultipleArguments(arg1: String, arg2: String) async -> String {12}13func asyncFunctionWithMultipleArguments(arg1: String, arg2: String) async throws -> String {14}15func asyncFunctionWithMultipleArgumentsAndClosure(arg1: String, arg2: String, closure: () async -> Void) async -> String {16}17func asyncFunctionWithMultipleArgumentsAndClosure(arg1: String, arg2: String, closure: () async throws -> Void) async throws -> String {18}19func asyncFunctionWithMultipleArgumentsAndClosure(arg1: String, arg2: String, closure: (String) async -> Void) async -> String {20}21func asyncFunctionWithMultipleArgumentsAndClosure(arg1: String, arg2: String, closure: (String) async throws -> Void) async throws -> String {22}23func asyncFunctionWithMultipleArgumentsAndClosure(arg1: String, arg2: String, closure: (String, String) async -> Void) async -> String {24}25func asyncFunctionWithMultipleArgumentsAndClosure(arg1: String, arg2: String, closure: (String, String) async throws -> Void) async throws -> String {26}27func asyncFunctionWithMultipleArgumentsAndClosure(arg1: String, arg2: String, closure: (String, String, String) async -> Void) async -> String {28}29func asyncFunctionWithMultipleArgumentsAndClosure(arg1: String, arg2: String, closure: (String, String, String) async throws -> Void) async throws -> String {30}31func asyncFunctionWithMultipleArgumentsAndClosure(arg1: String, arg2: String, closure: (String, String, String, String

Full Screen

Full Screen

AsyncFunctionDeclaration

Using AI Code Generation

copy

Full Screen

1import AsyncFunctionDeclaration2var asyncFunction = AsyncFunctionDeclaration()3asyncFunction.asyncFunctionDeclaration { (result) in4 print(result)5}6import AsyncFunctionDeclaration7var asyncFunction = AsyncFunctionDeclaration()8asyncFunction.asyncFunctionDeclaration { (result) in9 print(result)10}11import AsyncFunctionDeclaration12var asyncFunction = AsyncFunctionDeclaration()13asyncFunction.asyncFunctionDeclaration { (result) in14 print(result)15}16import AsyncFunctionDeclaration17var asyncFunction = AsyncFunctionDeclaration()18asyncFunction.asyncFunctionDeclaration { (result) in19 print(result)20}21import AsyncFunctionDeclaration22var asyncFunction = AsyncFunctionDeclaration()23asyncFunction.asyncFunctionDeclaration { (result) in24 print(result)25}26import AsyncFunctionDeclaration27var asyncFunction = AsyncFunctionDeclaration()28asyncFunction.asyncFunctionDeclaration { (result) in29 print(result)30}31import AsyncFunctionDeclaration32var asyncFunction = AsyncFunctionDeclaration()33asyncFunction.asyncFunctionDeclaration { (result) in34 print(result)35}36import AsyncFunctionDeclaration37var asyncFunction = AsyncFunctionDeclaration()38asyncFunction.asyncFunctionDeclaration { (result) in39 print(result)40}41import AsyncFunctionDeclaration42var asyncFunction = AsyncFunctionDeclaration()

Full Screen

Full Screen

AsyncFunctionDeclaration

Using AI Code Generation

copy

Full Screen

1import Mockingbird2let asyncFunctionDeclaration = AsyncFunctionDeclaration()3asyncFunctionDeclaration.asyncFunctionDeclaration { (result) in4 print(result)5}6import Mockingbird7let asyncFunctionDeclaration = AsyncFunctionDeclaration()8asyncFunctionDeclaration.asyncFunctionDeclaration { (result) in9 print(result)10}11import Mockingbird12let asyncFunctionDeclaration = AsyncFunctionDeclaration()13asyncFunctionDeclaration.asyncFunctionDeclaration { (result) in14 print(result)15}16import Mockingbird17let asyncFunctionDeclaration = AsyncFunctionDeclaration()18asyncFunctionDeclaration.asyncFunctionDeclaration { (result) in19 print(result)20}21import Mockingbird22let asyncFunctionDeclaration = AsyncFunctionDeclaration()23asyncFunctionDeclaration.asyncFunctionDeclaration { (result) in24 print(result)25}26import Mockingbird27let asyncFunctionDeclaration = AsyncFunctionDeclaration()28asyncFunctionDeclaration.asyncFunctionDeclaration { (result) in29 print(result)30}31import Mockingbird32let asyncFunctionDeclaration = AsyncFunctionDeclaration()33asyncFunctionDeclaration.asyncFunctionDeclaration { (result) in34 print(result)35}36import Mockingbird37let asyncFunctionDeclaration = AsyncFunctionDeclaration()38asyncFunctionDeclaration.asyncFunctionDeclaration { (result) in39 print(result)40}41import Mockingbird42let asyncFunctionDeclaration = AsyncFunctionDeclaration()43asyncFunctionDeclaration.asyncFunctionDeclaration { (result) in44 print(result)45}

Full Screen

Full Screen

AsyncFunctionDeclaration

Using AI Code Generation

copy

Full Screen

1import AsyncFunctionDeclaration2import Foundation3func asyncFunction() async -> String {4}5func asyncThrowsFunction() async throws -> String {6}7func asyncFunctionWithArgument(arg: String) async -> String {8}9func asyncFunctionWithArgument(arg: String) async throws -> String {10}11func asyncFunctionWithMultipleArguments(arg1: String, arg2: String) async -> String {12}13func asyncFunctionWithMultipleArguments(arg1: String, arg2: String) async throws -> String {14}15func asyncFunctionWithMultipleArgumentsAndClosure(arg1: String, arg2: String, closure: () async -> Void) async -> String {16}17func asyncFunctionWithMultipleArgumentsAndClosure(arg1: String, arg2: String, closure: () async throws -> Void) async throws -> String {18}19func asyncFunctionWithMultipleArgumentsAndClosure(arg1: String, arg2: String, closure: (String) async -> Void) async -> String {20}21func asyncFunctionWithMultipleArgumentsAndClosure(arg1: String, arg2: String, closure: (String) async throws -> Void) async throws -> String {22}23func asyncFunctionWithMultipleArgumentsAndClosure(arg1: String, arg2: String, closure: (String, String) async -> Void) async -> String {24}25func asyncFunctionWithMultipleArgumentsAndClosure(arg1: String, arg2: String, closure: (String, String) async throws -> Void) async throws -> String {26}27func asyncFunctionWithMultipleArgumentsAndClosure(arg1: String, arg2: String, closure: (String, String, String) async -> Void) async -> String {28}29func asyncFunctionWithMultipleArgumentsAndClosure(arg1: String, arg2: String, closure: (String, String, String) async throws -> Void) async throws -> String {30}31func asyncFunctionWithMultipleArgumentsAndClosure(arg1: String, arg2: String, closure: (String, String, String, String

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Mockingbird automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful