@idlizer/arktscgen 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/libarkts-copy/generator/options.json5 +155 -0
- package/build/libarkts-copy/native/meson.build +62 -0
- package/build/libarkts-copy/native/meson_options.txt +24 -0
- package/build/libarkts-copy/native/src/bridges.cc +265 -0
- package/build/libarkts-copy/native/src/common.cc +231 -0
- package/build/libarkts-copy/native/src/common.h +39 -0
- package/build/libarkts-copy/native/src/generated/bridges.cc +11979 -0
- package/build/libarkts-copy/package.json +51 -0
- package/build/libarkts-copy/src/Es2pandaEnums.ts +183 -0
- package/build/libarkts-copy/src/Es2pandaNativeModule.ts +123 -0
- package/build/libarkts-copy/src/InteropNativeModule.ts +50 -0
- package/build/libarkts-copy/src/arkts-api/class-by-peer.ts +31 -0
- package/build/libarkts-copy/src/arkts-api/factory/nodeFactory.ts +147 -0
- package/build/libarkts-copy/src/arkts-api/index.ts +28 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/createCallExpression.ts +40 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/createNumberLiteral.ts +28 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/createScriptFunction.ts +55 -0
- package/build/libarkts-copy/src/arkts-api/peers/ArktsObject.ts +45 -0
- package/build/libarkts-copy/src/arkts-api/peers/AstNode.ts +121 -0
- package/build/libarkts-copy/src/arkts-api/peers/Config.ts +52 -0
- package/build/libarkts-copy/src/arkts-api/peers/Context.ts +46 -0
- package/build/libarkts-copy/src/arkts-api/peers/Program.ts +55 -0
- package/build/libarkts-copy/src/arkts-api/static/global.ts +67 -0
- package/build/libarkts-copy/src/arkts-api/utilities/nativePtrDecoder.ts +69 -0
- package/build/libarkts-copy/src/arkts-api/utilities/private.ts +156 -0
- package/build/libarkts-copy/src/arkts-api/utilities/public.ts +135 -0
- package/build/libarkts-copy/src/arkts-api/visitor.ts +297 -0
- package/build/libarkts-copy/src/es2panda.ts +277 -0
- package/build/libarkts-copy/src/generated/Es2pandaEnums.ts +1266 -0
- package/build/libarkts-copy/src/generated/Es2pandaNativeModule.ts +3745 -0
- package/build/libarkts-copy/src/generated/factory.ts +1299 -0
- package/build/libarkts-copy/src/generated/index.ts +191 -0
- package/build/libarkts-copy/src/generated/node-map.ts +182 -0
- package/build/libarkts-copy/src/generated/peers/AnnotatedAstNode.ts +39 -0
- package/build/libarkts-copy/src/generated/peers/AnnotatedExpression.ts +49 -0
- package/build/libarkts-copy/src/generated/peers/AnnotatedStatement.ts +40 -0
- package/build/libarkts-copy/src/generated/peers/AnnotationDeclaration.ts +110 -0
- package/build/libarkts-copy/src/generated/peers/AnnotationUsage.ts +74 -0
- package/build/libarkts-copy/src/generated/peers/ArrayExpression.ts +98 -0
- package/build/libarkts-copy/src/generated/peers/ArrowFunctionExpression.ts +70 -0
- package/build/libarkts-copy/src/generated/peers/AssertStatement.ts +57 -0
- package/build/libarkts-copy/src/generated/peers/AssignmentExpression.ts +95 -0
- package/build/libarkts-copy/src/generated/peers/AstDumper.ts +42 -0
- package/build/libarkts-copy/src/generated/peers/AwaitExpression.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/BigIntLiteral.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/BinaryExpression.ts +95 -0
- package/build/libarkts-copy/src/generated/peers/BlockExpression.ts +64 -0
- package/build/libarkts-copy/src/generated/peers/BlockStatement.ts +63 -0
- package/build/libarkts-copy/src/generated/peers/BooleanLiteral.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/BreakStatement.ts +65 -0
- package/build/libarkts-copy/src/generated/peers/CallExpression.ts +97 -0
- package/build/libarkts-copy/src/generated/peers/CatchClause.ts +64 -0
- package/build/libarkts-copy/src/generated/peers/ChainExpression.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/CharLiteral.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/ClassDeclaration.ts +58 -0
- package/build/libarkts-copy/src/generated/peers/ClassDefinition.ts +233 -0
- package/build/libarkts-copy/src/generated/peers/ClassElement.ts +80 -0
- package/build/libarkts-copy/src/generated/peers/ClassExpression.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/ClassProperty.ts +70 -0
- package/build/libarkts-copy/src/generated/peers/ClassStaticBlock.ts +58 -0
- package/build/libarkts-copy/src/generated/peers/ConditionalExpression.ts +74 -0
- package/build/libarkts-copy/src/generated/peers/ContinueStatement.ts +65 -0
- package/build/libarkts-copy/src/generated/peers/DebuggerStatement.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/Decorator.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/DirectEvalExpression.ts +52 -0
- package/build/libarkts-copy/src/generated/peers/DoWhileStatement.ts +58 -0
- package/build/libarkts-copy/src/generated/peers/ETSClassLiteral.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/ETSDynamicFunctionType.ts +40 -0
- package/build/libarkts-copy/src/generated/peers/ETSFunctionType.ts +84 -0
- package/build/libarkts-copy/src/generated/peers/ETSImportDeclaration.ts +68 -0
- package/build/libarkts-copy/src/generated/peers/ETSLaunchExpression.ts +57 -0
- package/build/libarkts-copy/src/generated/peers/ETSModule.ts +71 -0
- package/build/libarkts-copy/src/generated/peers/ETSNewArrayInstanceExpression.ts +62 -0
- package/build/libarkts-copy/src/generated/peers/ETSNewClassInstanceExpression.ts +69 -0
- package/build/libarkts-copy/src/generated/peers/ETSNewMultiDimArrayInstanceExpression.ts +60 -0
- package/build/libarkts-copy/src/generated/peers/ETSNullType.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/ETSPackageDeclaration.ts +51 -0
- package/build/libarkts-copy/src/generated/peers/ETSParameterExpression.ts +126 -0
- package/build/libarkts-copy/src/generated/peers/ETSPrimitiveType.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/ETSReExportDeclaration.ts +51 -0
- package/build/libarkts-copy/src/generated/peers/ETSStructDeclaration.ts +51 -0
- package/build/libarkts-copy/src/generated/peers/ETSTuple.ts +73 -0
- package/build/libarkts-copy/src/generated/peers/ETSTypeReference.ts +58 -0
- package/build/libarkts-copy/src/generated/peers/ETSTypeReferencePart.ts +68 -0
- package/build/libarkts-copy/src/generated/peers/ETSUndefinedType.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/ETSUnionType.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/ETSWildcardType.ts +55 -0
- package/build/libarkts-copy/src/generated/peers/EmptyStatement.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/ExportAllDeclaration.ts +58 -0
- package/build/libarkts-copy/src/generated/peers/ExportDefaultDeclaration.ts +56 -0
- package/build/libarkts-copy/src/generated/peers/ExportNamedDeclaration.ts +73 -0
- package/build/libarkts-copy/src/generated/peers/ExportSpecifier.ts +57 -0
- package/build/libarkts-copy/src/generated/peers/Expression.ts +75 -0
- package/build/libarkts-copy/src/generated/peers/ExpressionStatement.ts +59 -0
- package/build/libarkts-copy/src/generated/peers/ForInStatement.ts +61 -0
- package/build/libarkts-copy/src/generated/peers/ForOfStatement.ts +64 -0
- package/build/libarkts-copy/src/generated/peers/ForUpdateStatement.ts +61 -0
- package/build/libarkts-copy/src/generated/peers/FunctionDecl.ts +40 -0
- package/build/libarkts-copy/src/generated/peers/FunctionDeclaration.ts +69 -0
- package/build/libarkts-copy/src/generated/peers/FunctionExpression.ts +64 -0
- package/build/libarkts-copy/src/generated/peers/FunctionSignature.ts +62 -0
- package/build/libarkts-copy/src/generated/peers/Identifier.ts +154 -0
- package/build/libarkts-copy/src/generated/peers/IfStatement.ts +65 -0
- package/build/libarkts-copy/src/generated/peers/ImportDeclaration.ts +61 -0
- package/build/libarkts-copy/src/generated/peers/ImportDefaultSpecifier.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/ImportExpression.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/ImportNamespaceSpecifier.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/ImportSource.ts +49 -0
- package/build/libarkts-copy/src/generated/peers/ImportSpecifier.ts +57 -0
- package/build/libarkts-copy/src/generated/peers/InterfaceDecl.ts +40 -0
- package/build/libarkts-copy/src/generated/peers/LabelledStatement.ts +60 -0
- package/build/libarkts-copy/src/generated/peers/Literal.ts +40 -0
- package/build/libarkts-copy/src/generated/peers/LoopStatement.ts +40 -0
- package/build/libarkts-copy/src/generated/peers/MaybeOptionalExpression.ts +48 -0
- package/build/libarkts-copy/src/generated/peers/MemberExpression.ts +95 -0
- package/build/libarkts-copy/src/generated/peers/MetaProperty.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/MethodDefinition.ts +105 -0
- package/build/libarkts-copy/src/generated/peers/NamedType.ts +76 -0
- package/build/libarkts-copy/src/generated/peers/NewExpression.ts +56 -0
- package/build/libarkts-copy/src/generated/peers/NullLiteral.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/NumberLiteral.ts +47 -0
- package/build/libarkts-copy/src/generated/peers/ObjectExpression.ts +90 -0
- package/build/libarkts-copy/src/generated/peers/OmittedExpression.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/OpaqueTypeNode.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/PrefixAssertionExpression.ts +57 -0
- package/build/libarkts-copy/src/generated/peers/Property.ts +82 -0
- package/build/libarkts-copy/src/generated/peers/RegExpLiteral.ts +57 -0
- package/build/libarkts-copy/src/generated/peers/ReturnStatement.ts +62 -0
- package/build/libarkts-copy/src/generated/peers/ScriptFunction.ts +201 -0
- package/build/libarkts-copy/src/generated/peers/SequenceExpression.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/SpreadElement.ts +79 -0
- package/build/libarkts-copy/src/generated/peers/SrcDumper.ts +82 -0
- package/build/libarkts-copy/src/generated/peers/Statement.ts +39 -0
- package/build/libarkts-copy/src/generated/peers/StringLiteral.ts +56 -0
- package/build/libarkts-copy/src/generated/peers/SuperExpression.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/SwitchCaseStatement.ts +62 -0
- package/build/libarkts-copy/src/generated/peers/SwitchStatement.ts +63 -0
- package/build/libarkts-copy/src/generated/peers/TSAnyKeyword.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/TSArrayType.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/TSAsExpression.ts +76 -0
- package/build/libarkts-copy/src/generated/peers/TSBigintKeyword.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/TSBooleanKeyword.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/TSClassImplements.ts +60 -0
- package/build/libarkts-copy/src/generated/peers/TSConditionalType.ts +63 -0
- package/build/libarkts-copy/src/generated/peers/TSConstructorType.ts +65 -0
- package/build/libarkts-copy/src/generated/peers/TSEnumDeclaration.ts +81 -0
- package/build/libarkts-copy/src/generated/peers/TSEnumMember.ts +66 -0
- package/build/libarkts-copy/src/generated/peers/TSExternalModuleReference.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/TSFunctionType.ts +67 -0
- package/build/libarkts-copy/src/generated/peers/TSImportEqualsDeclaration.ts +61 -0
- package/build/libarkts-copy/src/generated/peers/TSImportType.ts +64 -0
- package/build/libarkts-copy/src/generated/peers/TSIndexSignature.ts +65 -0
- package/build/libarkts-copy/src/generated/peers/TSIndexedAccessType.ts +56 -0
- package/build/libarkts-copy/src/generated/peers/TSInferType.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/TSInterfaceBody.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/TSInterfaceDeclaration.ts +102 -0
- package/build/libarkts-copy/src/generated/peers/TSInterfaceHeritage.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/TSIntersectionType.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/TSLiteralType.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/TSMappedType.ts +64 -0
- package/build/libarkts-copy/src/generated/peers/TSMethodSignature.ts +71 -0
- package/build/libarkts-copy/src/generated/peers/TSModuleBlock.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/TSModuleDeclaration.ts +63 -0
- package/build/libarkts-copy/src/generated/peers/TSNamedTupleMember.ts +60 -0
- package/build/libarkts-copy/src/generated/peers/TSNeverKeyword.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/TSNonNullExpression.ts +58 -0
- package/build/libarkts-copy/src/generated/peers/TSNullKeyword.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/TSNumberKeyword.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/TSObjectKeyword.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/TSParameterProperty.ts +66 -0
- package/build/libarkts-copy/src/generated/peers/TSParenthesizedType.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/TSPropertySignature.ts +72 -0
- package/build/libarkts-copy/src/generated/peers/TSQualifiedName.ts +63 -0
- package/build/libarkts-copy/src/generated/peers/TSSignatureDeclaration.ts +67 -0
- package/build/libarkts-copy/src/generated/peers/TSStringKeyword.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/TSThisType.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/TSTupleType.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/TSTypeAliasDeclaration.ts +88 -0
- package/build/libarkts-copy/src/generated/peers/TSTypeAssertion.ts +63 -0
- package/build/libarkts-copy/src/generated/peers/TSTypeLiteral.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/TSTypeOperator.ts +63 -0
- package/build/libarkts-copy/src/generated/peers/TSTypeParameter.ts +84 -0
- package/build/libarkts-copy/src/generated/peers/TSTypeParameterDeclaration.ts +62 -0
- package/build/libarkts-copy/src/generated/peers/TSTypeParameterInstantiation.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/TSTypePredicate.ts +60 -0
- package/build/libarkts-copy/src/generated/peers/TSTypeQuery.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/TSTypeReference.ts +62 -0
- package/build/libarkts-copy/src/generated/peers/TSUndefinedKeyword.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/TSUnionType.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/TSUnknownKeyword.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/TSVoidKeyword.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/TaggedTemplateExpression.ts +61 -0
- package/build/libarkts-copy/src/generated/peers/TemplateElement.ts +59 -0
- package/build/libarkts-copy/src/generated/peers/TemplateLiteral.ts +60 -0
- package/build/libarkts-copy/src/generated/peers/ThisExpression.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/ThrowStatement.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/TryStatement.ts +75 -0
- package/build/libarkts-copy/src/generated/peers/TypeNode.ts +49 -0
- package/build/libarkts-copy/src/generated/peers/TypedAstNode.ts +39 -0
- package/build/libarkts-copy/src/generated/peers/TypedStatement.ts +40 -0
- package/build/libarkts-copy/src/generated/peers/TypeofExpression.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/UnaryExpression.ts +57 -0
- package/build/libarkts-copy/src/generated/peers/UndefinedLiteral.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/UpdateExpression.ts +60 -0
- package/build/libarkts-copy/src/generated/peers/ValidationInfo.ts +42 -0
- package/build/libarkts-copy/src/generated/peers/VariableDeclaration.ts +71 -0
- package/build/libarkts-copy/src/generated/peers/VariableDeclarator.ts +69 -0
- package/build/libarkts-copy/src/generated/peers/WhileStatement.ts +58 -0
- package/build/libarkts-copy/src/generated/peers/YieldExpression.ts +56 -0
- package/build/libarkts-copy/src/reexport-for-generated.ts +33 -0
- package/build/libarkts-copy/src/ts-api/factory/nodeFactory.ts +1375 -0
- package/build/libarkts-copy/src/ts-api/factory/nodeTests.ts +110 -0
- package/build/libarkts-copy/src/ts-api/index.ts +35 -0
- package/build/libarkts-copy/src/ts-api/static/enums.ts +18 -0
- package/build/libarkts-copy/src/ts-api/types.ts +920 -0
- package/build/libarkts-copy/src/ts-api/utilities/private.ts +289 -0
- package/build/libarkts-copy/src/ts-api/utilities/public.ts +55 -0
- package/build/libarkts-copy/src/ts-api/visitor/visitor.ts +155 -0
- package/build/libarkts-copy/src/utils.ts +89 -0
- package/build/libarkts-copy/tsconfig.json +15 -0
- package/lib/index.js +11858 -0
- package/package.json +54 -0
- package/templates/Es2pandaEnums.ts +16 -0
- package/templates/Es2pandaNativeModule.ts +32 -0
- package/templates/bridges.cc +18 -0
- package/templates/factory.ts +34 -0
- package/templates/index.ts +16 -0
- package/templates/node-map.ts +31 -0
- package/templates/peer.ts +32 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License.
|
|
5
|
+
* You may obtain a copy of the License at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
* See the License for the specific language governing permissions and
|
|
13
|
+
* limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import {
|
|
17
|
+
global,
|
|
18
|
+
passNode,
|
|
19
|
+
passNodeArray,
|
|
20
|
+
unpackNonNullableNode,
|
|
21
|
+
unpackNode,
|
|
22
|
+
unpackNodeArray,
|
|
23
|
+
assertValidPeer,
|
|
24
|
+
AstNode,
|
|
25
|
+
Es2pandaAstNodeType,
|
|
26
|
+
KNativePointer,
|
|
27
|
+
nodeByType,
|
|
28
|
+
ArktsObject,
|
|
29
|
+
unpackString
|
|
30
|
+
} from "../../reexport-for-generated"
|
|
31
|
+
|
|
32
|
+
import { Expression } from "./Expression"
|
|
33
|
+
import { LoopStatement } from "./LoopStatement"
|
|
34
|
+
import { Statement } from "./Statement"
|
|
35
|
+
export class ForInStatement extends LoopStatement {
|
|
36
|
+
constructor(pointer: KNativePointer) {
|
|
37
|
+
assertValidPeer(pointer, 31)
|
|
38
|
+
super(pointer)
|
|
39
|
+
}
|
|
40
|
+
static createForInStatement(left?: AstNode, right?: Expression, body?: Statement): ForInStatement {
|
|
41
|
+
return new ForInStatement(global.generatedEs2panda._CreateForInStatement(global.context, passNode(left), passNode(right), passNode(body)))
|
|
42
|
+
}
|
|
43
|
+
static updateForInStatement(original?: ForInStatement, left?: AstNode, right?: Expression, body?: Statement): ForInStatement {
|
|
44
|
+
return new ForInStatement(global.generatedEs2panda._UpdateForInStatement(global.context, passNode(original), passNode(left), passNode(right), passNode(body)))
|
|
45
|
+
}
|
|
46
|
+
get left(): AstNode | undefined {
|
|
47
|
+
return unpackNode(global.generatedEs2panda._ForInStatementLeftConst(global.context, this.peer))
|
|
48
|
+
}
|
|
49
|
+
get right(): Expression | undefined {
|
|
50
|
+
return unpackNode(global.generatedEs2panda._ForInStatementRightConst(global.context, this.peer))
|
|
51
|
+
}
|
|
52
|
+
get body(): Statement | undefined {
|
|
53
|
+
return unpackNode(global.generatedEs2panda._ForInStatementBodyConst(global.context, this.peer))
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export function isForInStatement(node: object | undefined): node is ForInStatement {
|
|
57
|
+
return node instanceof ForInStatement
|
|
58
|
+
}
|
|
59
|
+
if (!nodeByType.has(31)) {
|
|
60
|
+
nodeByType.set(31, ForInStatement)
|
|
61
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License.
|
|
5
|
+
* You may obtain a copy of the License at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
* See the License for the specific language governing permissions and
|
|
13
|
+
* limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import {
|
|
17
|
+
global,
|
|
18
|
+
passNode,
|
|
19
|
+
passNodeArray,
|
|
20
|
+
unpackNonNullableNode,
|
|
21
|
+
unpackNode,
|
|
22
|
+
unpackNodeArray,
|
|
23
|
+
assertValidPeer,
|
|
24
|
+
AstNode,
|
|
25
|
+
Es2pandaAstNodeType,
|
|
26
|
+
KNativePointer,
|
|
27
|
+
nodeByType,
|
|
28
|
+
ArktsObject,
|
|
29
|
+
unpackString
|
|
30
|
+
} from "../../reexport-for-generated"
|
|
31
|
+
|
|
32
|
+
import { Expression } from "./Expression"
|
|
33
|
+
import { LoopStatement } from "./LoopStatement"
|
|
34
|
+
import { Statement } from "./Statement"
|
|
35
|
+
export class ForOfStatement extends LoopStatement {
|
|
36
|
+
constructor(pointer: KNativePointer) {
|
|
37
|
+
assertValidPeer(pointer, 32)
|
|
38
|
+
super(pointer)
|
|
39
|
+
}
|
|
40
|
+
static createForOfStatement(left: AstNode | undefined, right: Expression | undefined, body: Statement | undefined, isAwait: boolean): ForOfStatement {
|
|
41
|
+
return new ForOfStatement(global.generatedEs2panda._CreateForOfStatement(global.context, passNode(left), passNode(right), passNode(body), isAwait))
|
|
42
|
+
}
|
|
43
|
+
static updateForOfStatement(original: ForOfStatement | undefined, left: AstNode | undefined, right: Expression | undefined, body: Statement | undefined, isAwait: boolean): ForOfStatement {
|
|
44
|
+
return new ForOfStatement(global.generatedEs2panda._UpdateForOfStatement(global.context, passNode(original), passNode(left), passNode(right), passNode(body), isAwait))
|
|
45
|
+
}
|
|
46
|
+
get left(): AstNode | undefined {
|
|
47
|
+
return unpackNode(global.generatedEs2panda._ForOfStatementLeftConst(global.context, this.peer))
|
|
48
|
+
}
|
|
49
|
+
get right(): Expression | undefined {
|
|
50
|
+
return unpackNode(global.generatedEs2panda._ForOfStatementRightConst(global.context, this.peer))
|
|
51
|
+
}
|
|
52
|
+
get body(): Statement | undefined {
|
|
53
|
+
return unpackNode(global.generatedEs2panda._ForOfStatementBodyConst(global.context, this.peer))
|
|
54
|
+
}
|
|
55
|
+
get isAwait(): boolean {
|
|
56
|
+
return global.generatedEs2panda._ForOfStatementIsAwaitConst(global.context, this.peer)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
export function isForOfStatement(node: object | undefined): node is ForOfStatement {
|
|
60
|
+
return node instanceof ForOfStatement
|
|
61
|
+
}
|
|
62
|
+
if (!nodeByType.has(32)) {
|
|
63
|
+
nodeByType.set(32, ForOfStatement)
|
|
64
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License.
|
|
5
|
+
* You may obtain a copy of the License at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
* See the License for the specific language governing permissions and
|
|
13
|
+
* limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import {
|
|
17
|
+
global,
|
|
18
|
+
passNode,
|
|
19
|
+
passNodeArray,
|
|
20
|
+
unpackNonNullableNode,
|
|
21
|
+
unpackNode,
|
|
22
|
+
unpackNodeArray,
|
|
23
|
+
assertValidPeer,
|
|
24
|
+
AstNode,
|
|
25
|
+
Es2pandaAstNodeType,
|
|
26
|
+
KNativePointer,
|
|
27
|
+
nodeByType,
|
|
28
|
+
ArktsObject,
|
|
29
|
+
unpackString
|
|
30
|
+
} from "../../reexport-for-generated"
|
|
31
|
+
|
|
32
|
+
import { Expression } from "./Expression"
|
|
33
|
+
import { LoopStatement } from "./LoopStatement"
|
|
34
|
+
import { Statement } from "./Statement"
|
|
35
|
+
export class ForUpdateStatement extends LoopStatement {
|
|
36
|
+
constructor(pointer: KNativePointer) {
|
|
37
|
+
assertValidPeer(pointer, 33)
|
|
38
|
+
super(pointer)
|
|
39
|
+
}
|
|
40
|
+
static createForUpdateStatement(init?: AstNode, test?: Expression, update?: Expression, body?: Statement): ForUpdateStatement {
|
|
41
|
+
return new ForUpdateStatement(global.generatedEs2panda._CreateForUpdateStatement(global.context, passNode(init), passNode(test), passNode(update), passNode(body)))
|
|
42
|
+
}
|
|
43
|
+
get init(): AstNode | undefined {
|
|
44
|
+
return unpackNode(global.generatedEs2panda._ForUpdateStatementInitConst(global.context, this.peer))
|
|
45
|
+
}
|
|
46
|
+
get test(): Expression | undefined {
|
|
47
|
+
return unpackNode(global.generatedEs2panda._ForUpdateStatementTestConst(global.context, this.peer))
|
|
48
|
+
}
|
|
49
|
+
get update(): Expression | undefined {
|
|
50
|
+
return unpackNode(global.generatedEs2panda._ForUpdateStatementUpdateConst(global.context, this.peer))
|
|
51
|
+
}
|
|
52
|
+
get body(): Statement | undefined {
|
|
53
|
+
return unpackNode(global.generatedEs2panda._ForUpdateStatementBodyConst(global.context, this.peer))
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export function isForUpdateStatement(node: object | undefined): node is ForUpdateStatement {
|
|
57
|
+
return node instanceof ForUpdateStatement
|
|
58
|
+
}
|
|
59
|
+
if (!nodeByType.has(33)) {
|
|
60
|
+
nodeByType.set(33, ForUpdateStatement)
|
|
61
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License.
|
|
5
|
+
* You may obtain a copy of the License at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
* See the License for the specific language governing permissions and
|
|
13
|
+
* limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import {
|
|
17
|
+
global,
|
|
18
|
+
passNode,
|
|
19
|
+
passNodeArray,
|
|
20
|
+
unpackNonNullableNode,
|
|
21
|
+
unpackNode,
|
|
22
|
+
unpackNodeArray,
|
|
23
|
+
assertValidPeer,
|
|
24
|
+
AstNode,
|
|
25
|
+
Es2pandaAstNodeType,
|
|
26
|
+
KNativePointer,
|
|
27
|
+
nodeByType,
|
|
28
|
+
ArktsObject,
|
|
29
|
+
unpackString
|
|
30
|
+
} from "../../reexport-for-generated"
|
|
31
|
+
|
|
32
|
+
import { ScriptFunction } from "./ScriptFunction"
|
|
33
|
+
export class FunctionDecl extends ScriptFunction {
|
|
34
|
+
constructor(pointer: KNativePointer) {
|
|
35
|
+
super(pointer)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export function isFunctionDecl(node: object | undefined): node is FunctionDecl {
|
|
39
|
+
return node instanceof FunctionDecl
|
|
40
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License.
|
|
5
|
+
* You may obtain a copy of the License at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
* See the License for the specific language governing permissions and
|
|
13
|
+
* limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import {
|
|
17
|
+
global,
|
|
18
|
+
passNode,
|
|
19
|
+
passNodeArray,
|
|
20
|
+
unpackNonNullableNode,
|
|
21
|
+
unpackNode,
|
|
22
|
+
unpackNodeArray,
|
|
23
|
+
assertValidPeer,
|
|
24
|
+
AstNode,
|
|
25
|
+
Es2pandaAstNodeType,
|
|
26
|
+
KNativePointer,
|
|
27
|
+
nodeByType,
|
|
28
|
+
ArktsObject,
|
|
29
|
+
unpackString
|
|
30
|
+
} from "../../reexport-for-generated"
|
|
31
|
+
|
|
32
|
+
import { AnnotationUsage } from "./AnnotationUsage"
|
|
33
|
+
import { ScriptFunction } from "./ScriptFunction"
|
|
34
|
+
import { Statement } from "./Statement"
|
|
35
|
+
export class FunctionDeclaration extends Statement {
|
|
36
|
+
constructor(pointer: KNativePointer) {
|
|
37
|
+
assertValidPeer(pointer, 34)
|
|
38
|
+
super(pointer)
|
|
39
|
+
}
|
|
40
|
+
static createFunctionDeclaration(func: ScriptFunction | undefined, annotations: readonly AnnotationUsage[], isAnonymous: boolean): FunctionDeclaration {
|
|
41
|
+
return new FunctionDeclaration(global.generatedEs2panda._CreateFunctionDeclaration(global.context, passNode(func), passNodeArray(annotations), annotations.length, isAnonymous))
|
|
42
|
+
}
|
|
43
|
+
static updateFunctionDeclaration(original: FunctionDeclaration | undefined, func: ScriptFunction | undefined, annotations: readonly AnnotationUsage[], isAnonymous: boolean): FunctionDeclaration {
|
|
44
|
+
return new FunctionDeclaration(global.generatedEs2panda._UpdateFunctionDeclaration(global.context, passNode(original), passNode(func), passNodeArray(annotations), annotations.length, isAnonymous))
|
|
45
|
+
}
|
|
46
|
+
static update1FunctionDeclaration(original: FunctionDeclaration | undefined, func: ScriptFunction | undefined, isAnonymous: boolean): FunctionDeclaration {
|
|
47
|
+
return new FunctionDeclaration(global.generatedEs2panda._UpdateFunctionDeclaration1(global.context, passNode(original), passNode(func), isAnonymous))
|
|
48
|
+
}
|
|
49
|
+
get isAnonymous(): boolean {
|
|
50
|
+
return global.generatedEs2panda._FunctionDeclarationIsAnonymousConst(global.context, this.peer)
|
|
51
|
+
}
|
|
52
|
+
get function(): ScriptFunction {
|
|
53
|
+
return unpackNonNullableNode(global.generatedEs2panda._FunctionDeclarationFunctionConst(global.context, this.peer))
|
|
54
|
+
}
|
|
55
|
+
get annotations(): readonly AnnotationUsage[] {
|
|
56
|
+
return unpackNodeArray(global.generatedEs2panda._FunctionDeclarationAnnotationsConst(global.context, this.peer))
|
|
57
|
+
}
|
|
58
|
+
/** @deprecated */
|
|
59
|
+
setAnnotations(annotations: readonly AnnotationUsage[]): this {
|
|
60
|
+
global.generatedEs2panda._FunctionDeclarationSetAnnotations(global.context, this.peer, passNodeArray(annotations), annotations.length)
|
|
61
|
+
return this
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export function isFunctionDeclaration(node: object | undefined): node is FunctionDeclaration {
|
|
65
|
+
return node instanceof FunctionDeclaration
|
|
66
|
+
}
|
|
67
|
+
if (!nodeByType.has(34)) {
|
|
68
|
+
nodeByType.set(34, FunctionDeclaration)
|
|
69
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License.
|
|
5
|
+
* You may obtain a copy of the License at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
* See the License for the specific language governing permissions and
|
|
13
|
+
* limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import {
|
|
17
|
+
global,
|
|
18
|
+
passNode,
|
|
19
|
+
passNodeArray,
|
|
20
|
+
unpackNonNullableNode,
|
|
21
|
+
unpackNode,
|
|
22
|
+
unpackNodeArray,
|
|
23
|
+
assertValidPeer,
|
|
24
|
+
AstNode,
|
|
25
|
+
Es2pandaAstNodeType,
|
|
26
|
+
KNativePointer,
|
|
27
|
+
nodeByType,
|
|
28
|
+
ArktsObject,
|
|
29
|
+
unpackString
|
|
30
|
+
} from "../../reexport-for-generated"
|
|
31
|
+
|
|
32
|
+
import { Expression } from "./Expression"
|
|
33
|
+
import { Identifier } from "./Identifier"
|
|
34
|
+
import { ScriptFunction } from "./ScriptFunction"
|
|
35
|
+
export class FunctionExpression extends Expression {
|
|
36
|
+
constructor(pointer: KNativePointer) {
|
|
37
|
+
assertValidPeer(pointer, 35)
|
|
38
|
+
super(pointer)
|
|
39
|
+
}
|
|
40
|
+
static create1FunctionExpression(namedExpr?: Identifier, func?: ScriptFunction): FunctionExpression {
|
|
41
|
+
return new FunctionExpression(global.generatedEs2panda._CreateFunctionExpression1(global.context, passNode(namedExpr), passNode(func)))
|
|
42
|
+
}
|
|
43
|
+
static updateFunctionExpression(original?: FunctionExpression, func?: ScriptFunction): FunctionExpression {
|
|
44
|
+
return new FunctionExpression(global.generatedEs2panda._UpdateFunctionExpression(global.context, passNode(original), passNode(func)))
|
|
45
|
+
}
|
|
46
|
+
static update1FunctionExpression(original?: FunctionExpression, namedExpr?: Identifier, func?: ScriptFunction): FunctionExpression {
|
|
47
|
+
return new FunctionExpression(global.generatedEs2panda._UpdateFunctionExpression1(global.context, passNode(original), passNode(namedExpr), passNode(func)))
|
|
48
|
+
}
|
|
49
|
+
get function(): ScriptFunction | undefined {
|
|
50
|
+
return unpackNode(global.generatedEs2panda._FunctionExpressionFunctionConst(global.context, this.peer))
|
|
51
|
+
}
|
|
52
|
+
get isAnonymous(): boolean {
|
|
53
|
+
return global.generatedEs2panda._FunctionExpressionIsAnonymousConst(global.context, this.peer)
|
|
54
|
+
}
|
|
55
|
+
get id(): Identifier | undefined {
|
|
56
|
+
return unpackNode(global.generatedEs2panda._FunctionExpressionId(global.context, this.peer))
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
export function isFunctionExpression(node: object | undefined): node is FunctionExpression {
|
|
60
|
+
return node instanceof FunctionExpression
|
|
61
|
+
}
|
|
62
|
+
if (!nodeByType.has(35)) {
|
|
63
|
+
nodeByType.set(35, FunctionExpression)
|
|
64
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License.
|
|
5
|
+
* You may obtain a copy of the License at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
* See the License for the specific language governing permissions and
|
|
13
|
+
* limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import {
|
|
17
|
+
global,
|
|
18
|
+
passNode,
|
|
19
|
+
passNodeArray,
|
|
20
|
+
unpackNonNullableNode,
|
|
21
|
+
unpackNode,
|
|
22
|
+
unpackNodeArray,
|
|
23
|
+
assertValidPeer,
|
|
24
|
+
AstNode,
|
|
25
|
+
Es2pandaAstNodeType,
|
|
26
|
+
KNativePointer,
|
|
27
|
+
nodeByType,
|
|
28
|
+
ArktsObject,
|
|
29
|
+
unpackString
|
|
30
|
+
} from "../../reexport-for-generated"
|
|
31
|
+
|
|
32
|
+
import { Expression } from "./Expression"
|
|
33
|
+
import { TSTypeParameterDeclaration } from "./TSTypeParameterDeclaration"
|
|
34
|
+
import { TypeNode } from "./TypeNode"
|
|
35
|
+
export class FunctionSignature extends ArktsObject {
|
|
36
|
+
constructor(pointer: KNativePointer) {
|
|
37
|
+
super(pointer)
|
|
38
|
+
}
|
|
39
|
+
static createFunctionSignature(typeParams: TSTypeParameterDeclaration | undefined, params: readonly Expression[], returnTypeAnnotation: TypeNode | undefined, hasReceiver: boolean): FunctionSignature {
|
|
40
|
+
return new FunctionSignature(global.generatedEs2panda._CreateFunctionSignature(global.context, passNode(typeParams), passNodeArray(params), params.length, passNode(returnTypeAnnotation), hasReceiver))
|
|
41
|
+
}
|
|
42
|
+
get params(): readonly Expression[] {
|
|
43
|
+
return unpackNodeArray(global.generatedEs2panda._FunctionSignatureParamsConst(global.context, this.peer))
|
|
44
|
+
}
|
|
45
|
+
get typeParams(): TSTypeParameterDeclaration | undefined {
|
|
46
|
+
return unpackNode(global.generatedEs2panda._FunctionSignatureTypeParamsConst(global.context, this.peer))
|
|
47
|
+
}
|
|
48
|
+
/** @deprecated */
|
|
49
|
+
setReturnType(type?: TypeNode): this {
|
|
50
|
+
global.generatedEs2panda._FunctionSignatureSetReturnType(global.context, this.peer, passNode(type))
|
|
51
|
+
return this
|
|
52
|
+
}
|
|
53
|
+
get returnType(): TypeNode | undefined {
|
|
54
|
+
return unpackNode(global.generatedEs2panda._FunctionSignatureReturnTypeConst(global.context, this.peer))
|
|
55
|
+
}
|
|
56
|
+
get clone(): FunctionSignature | undefined {
|
|
57
|
+
return new FunctionSignature(global.generatedEs2panda._FunctionSignatureClone(global.context, this.peer))
|
|
58
|
+
}
|
|
59
|
+
get hasReceiver(): boolean {
|
|
60
|
+
return global.generatedEs2panda._FunctionSignatureHasReceiverConst(global.context, this.peer)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License.
|
|
5
|
+
* You may obtain a copy of the License at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
* See the License for the specific language governing permissions and
|
|
13
|
+
* limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import {
|
|
17
|
+
global,
|
|
18
|
+
passNode,
|
|
19
|
+
passNodeArray,
|
|
20
|
+
unpackNonNullableNode,
|
|
21
|
+
unpackNode,
|
|
22
|
+
unpackNodeArray,
|
|
23
|
+
assertValidPeer,
|
|
24
|
+
AstNode,
|
|
25
|
+
Es2pandaAstNodeType,
|
|
26
|
+
KNativePointer,
|
|
27
|
+
nodeByType,
|
|
28
|
+
ArktsObject,
|
|
29
|
+
unpackString
|
|
30
|
+
} from "../../reexport-for-generated"
|
|
31
|
+
|
|
32
|
+
import { AnnotatedExpression } from "./AnnotatedExpression"
|
|
33
|
+
import { Decorator } from "./Decorator"
|
|
34
|
+
import { TypeNode } from "./TypeNode"
|
|
35
|
+
import { ValidationInfo } from "./ValidationInfo"
|
|
36
|
+
export class Identifier extends AnnotatedExpression {
|
|
37
|
+
constructor(pointer: KNativePointer) {
|
|
38
|
+
assertValidPeer(pointer, 36)
|
|
39
|
+
super(pointer)
|
|
40
|
+
}
|
|
41
|
+
static create2Identifier(name: string, typeAnnotation?: TypeNode): Identifier {
|
|
42
|
+
return new Identifier(global.generatedEs2panda._CreateIdentifier2(global.context, name, passNode(typeAnnotation)))
|
|
43
|
+
}
|
|
44
|
+
static updateIdentifier(original?: Identifier): Identifier {
|
|
45
|
+
return new Identifier(global.generatedEs2panda._UpdateIdentifier(global.context, passNode(original)))
|
|
46
|
+
}
|
|
47
|
+
static update1Identifier(original: Identifier | undefined, name: string): Identifier {
|
|
48
|
+
return new Identifier(global.generatedEs2panda._UpdateIdentifier1(global.context, passNode(original), name))
|
|
49
|
+
}
|
|
50
|
+
static update2Identifier(original: Identifier | undefined, name: string, typeAnnotation?: TypeNode): Identifier {
|
|
51
|
+
return new Identifier(global.generatedEs2panda._UpdateIdentifier2(global.context, passNode(original), name, passNode(typeAnnotation)))
|
|
52
|
+
}
|
|
53
|
+
get name(): string {
|
|
54
|
+
return unpackString(global.generatedEs2panda._IdentifierNameConst(global.context, this.peer))
|
|
55
|
+
}
|
|
56
|
+
/** @deprecated */
|
|
57
|
+
setName(newName: string): this {
|
|
58
|
+
global.generatedEs2panda._IdentifierSetName(global.context, this.peer, newName)
|
|
59
|
+
return this
|
|
60
|
+
}
|
|
61
|
+
get decorators(): readonly Decorator[] {
|
|
62
|
+
return unpackNodeArray(global.generatedEs2panda._IdentifierDecoratorsConst(global.context, this.peer))
|
|
63
|
+
}
|
|
64
|
+
get isErrorPlaceHolder(): boolean {
|
|
65
|
+
return global.generatedEs2panda._IdentifierIsErrorPlaceHolderConst(global.context, this.peer)
|
|
66
|
+
}
|
|
67
|
+
get isOptional(): boolean {
|
|
68
|
+
return global.generatedEs2panda._IdentifierIsOptionalConst(global.context, this.peer)
|
|
69
|
+
}
|
|
70
|
+
/** @deprecated */
|
|
71
|
+
setOptional(optional_arg: boolean): this {
|
|
72
|
+
global.generatedEs2panda._IdentifierSetOptional(global.context, this.peer, optional_arg)
|
|
73
|
+
return this
|
|
74
|
+
}
|
|
75
|
+
get isReference(): boolean {
|
|
76
|
+
return global.generatedEs2panda._IdentifierIsReferenceConst(global.context, this.peer)
|
|
77
|
+
}
|
|
78
|
+
get isTdz(): boolean {
|
|
79
|
+
return global.generatedEs2panda._IdentifierIsTdzConst(global.context, this.peer)
|
|
80
|
+
}
|
|
81
|
+
/** @deprecated */
|
|
82
|
+
setTdz(): this {
|
|
83
|
+
global.generatedEs2panda._IdentifierSetTdz(global.context, this.peer)
|
|
84
|
+
return this
|
|
85
|
+
}
|
|
86
|
+
/** @deprecated */
|
|
87
|
+
setAccessor(): this {
|
|
88
|
+
global.generatedEs2panda._IdentifierSetAccessor(global.context, this.peer)
|
|
89
|
+
return this
|
|
90
|
+
}
|
|
91
|
+
get isAccessor(): boolean {
|
|
92
|
+
return global.generatedEs2panda._IdentifierIsAccessorConst(global.context, this.peer)
|
|
93
|
+
}
|
|
94
|
+
/** @deprecated */
|
|
95
|
+
setMutator(): this {
|
|
96
|
+
global.generatedEs2panda._IdentifierSetMutator(global.context, this.peer)
|
|
97
|
+
return this
|
|
98
|
+
}
|
|
99
|
+
get isMutator(): boolean {
|
|
100
|
+
return global.generatedEs2panda._IdentifierIsMutatorConst(global.context, this.peer)
|
|
101
|
+
}
|
|
102
|
+
get isReceiver(): boolean {
|
|
103
|
+
return global.generatedEs2panda._IdentifierIsReceiverConst(global.context, this.peer)
|
|
104
|
+
}
|
|
105
|
+
get isPrivateIdent(): boolean {
|
|
106
|
+
return global.generatedEs2panda._IdentifierIsPrivateIdentConst(global.context, this.peer)
|
|
107
|
+
}
|
|
108
|
+
/** @deprecated */
|
|
109
|
+
setPrivate(isPrivate: boolean): this {
|
|
110
|
+
global.generatedEs2panda._IdentifierSetPrivate(global.context, this.peer, isPrivate)
|
|
111
|
+
return this
|
|
112
|
+
}
|
|
113
|
+
get isIgnoreBox(): boolean {
|
|
114
|
+
return global.generatedEs2panda._IdentifierIsIgnoreBoxConst(global.context, this.peer)
|
|
115
|
+
}
|
|
116
|
+
/** @deprecated */
|
|
117
|
+
setIgnoreBox(): this {
|
|
118
|
+
global.generatedEs2panda._IdentifierSetIgnoreBox(global.context, this.peer)
|
|
119
|
+
return this
|
|
120
|
+
}
|
|
121
|
+
get isAnnotationDecl(): boolean {
|
|
122
|
+
return global.generatedEs2panda._IdentifierIsAnnotationDeclConst(global.context, this.peer)
|
|
123
|
+
}
|
|
124
|
+
/** @deprecated */
|
|
125
|
+
setAnnotationDecl(): this {
|
|
126
|
+
global.generatedEs2panda._IdentifierSetAnnotationDecl(global.context, this.peer)
|
|
127
|
+
return this
|
|
128
|
+
}
|
|
129
|
+
get isAnnotationUsage(): boolean {
|
|
130
|
+
return global.generatedEs2panda._IdentifierIsAnnotationUsageConst(global.context, this.peer)
|
|
131
|
+
}
|
|
132
|
+
/** @deprecated */
|
|
133
|
+
setAnnotationUsage(): this {
|
|
134
|
+
global.generatedEs2panda._IdentifierSetAnnotationUsage(global.context, this.peer)
|
|
135
|
+
return this
|
|
136
|
+
}
|
|
137
|
+
get validateExpression(): ValidationInfo | undefined {
|
|
138
|
+
return new ValidationInfo(global.generatedEs2panda._IdentifierValidateExpression(global.context, this.peer))
|
|
139
|
+
}
|
|
140
|
+
get typeAnnotation(): TypeNode | undefined {
|
|
141
|
+
return unpackNode(global.generatedEs2panda._IdentifierTypeAnnotationConst(global.context, this.peer))
|
|
142
|
+
}
|
|
143
|
+
/** @deprecated */
|
|
144
|
+
setTsTypeAnnotation(typeAnnotation?: TypeNode): this {
|
|
145
|
+
global.generatedEs2panda._IdentifierSetTsTypeAnnotation(global.context, this.peer, passNode(typeAnnotation))
|
|
146
|
+
return this
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
export function isIdentifier(node: object | undefined): node is Identifier {
|
|
150
|
+
return node instanceof Identifier
|
|
151
|
+
}
|
|
152
|
+
if (!nodeByType.has(36)) {
|
|
153
|
+
nodeByType.set(36, Identifier)
|
|
154
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License.
|
|
5
|
+
* You may obtain a copy of the License at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
* See the License for the specific language governing permissions and
|
|
13
|
+
* limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import {
|
|
17
|
+
global,
|
|
18
|
+
passNode,
|
|
19
|
+
passNodeArray,
|
|
20
|
+
unpackNonNullableNode,
|
|
21
|
+
unpackNode,
|
|
22
|
+
unpackNodeArray,
|
|
23
|
+
assertValidPeer,
|
|
24
|
+
AstNode,
|
|
25
|
+
Es2pandaAstNodeType,
|
|
26
|
+
KNativePointer,
|
|
27
|
+
nodeByType,
|
|
28
|
+
ArktsObject,
|
|
29
|
+
unpackString
|
|
30
|
+
} from "../../reexport-for-generated"
|
|
31
|
+
|
|
32
|
+
import { Expression } from "./Expression"
|
|
33
|
+
import { Statement } from "./Statement"
|
|
34
|
+
export class IfStatement extends Statement {
|
|
35
|
+
constructor(pointer: KNativePointer) {
|
|
36
|
+
assertValidPeer(pointer, 38)
|
|
37
|
+
super(pointer)
|
|
38
|
+
}
|
|
39
|
+
static createIfStatement(test?: Expression, consequent?: Statement, alternate?: Statement): IfStatement {
|
|
40
|
+
return new IfStatement(global.generatedEs2panda._CreateIfStatement(global.context, passNode(test), passNode(consequent), passNode(alternate)))
|
|
41
|
+
}
|
|
42
|
+
static updateIfStatement(original?: IfStatement, test?: Expression, consequent?: Statement, alternate?: Statement): IfStatement {
|
|
43
|
+
return new IfStatement(global.generatedEs2panda._UpdateIfStatement(global.context, passNode(original), passNode(test), passNode(consequent), passNode(alternate)))
|
|
44
|
+
}
|
|
45
|
+
get test(): Expression {
|
|
46
|
+
return unpackNonNullableNode(global.generatedEs2panda._IfStatementTestConst(global.context, this.peer))
|
|
47
|
+
}
|
|
48
|
+
get consequent(): Statement {
|
|
49
|
+
return unpackNonNullableNode(global.generatedEs2panda._IfStatementConsequentConst(global.context, this.peer))
|
|
50
|
+
}
|
|
51
|
+
get alternate(): Statement | undefined {
|
|
52
|
+
return unpackNode(global.generatedEs2panda._IfStatementAlternateConst(global.context, this.peer))
|
|
53
|
+
}
|
|
54
|
+
/** @deprecated */
|
|
55
|
+
setAlternate(alternate?: Statement): this {
|
|
56
|
+
global.generatedEs2panda._IfStatementSetAlternate(global.context, this.peer, passNode(alternate))
|
|
57
|
+
return this
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
export function isIfStatement(node: object | undefined): node is IfStatement {
|
|
61
|
+
return node instanceof IfStatement
|
|
62
|
+
}
|
|
63
|
+
if (!nodeByType.has(38)) {
|
|
64
|
+
nodeByType.set(38, IfStatement)
|
|
65
|
+
}
|