@idlizer/arktscgen 2.1.9-arktscgen-6 → 2.1.9-arktscgen-9
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 +165 -3
- package/build/libarkts-copy/native/meson.build +11 -12
- package/build/libarkts-copy/native/meson_options.txt +1 -1
- package/build/libarkts-copy/native/mingw.cross +14 -0
- package/build/libarkts-copy/native/src/bridges.cc +105 -15
- package/build/libarkts-copy/native/src/common.cc +11 -7
- package/build/libarkts-copy/native/src/common.h +1 -0
- package/build/libarkts-copy/native/src/generated/bridges.cc +318 -35
- package/build/libarkts-copy/package.json +24 -21
- package/build/libarkts-copy/src/Es2pandaNativeModule.ts +33 -6
- package/build/libarkts-copy/src/arkts-api/ChainExpressionFilter.ts +2 -1
- package/build/libarkts-copy/src/arkts-api/ImportStorage.ts +18 -12
- package/build/libarkts-copy/src/arkts-api/ProgramProvider.ts +1 -1
- package/build/libarkts-copy/src/arkts-api/factory/nodeFactory.ts +15 -26
- package/build/libarkts-copy/src/arkts-api/index.ts +2 -4
- package/build/libarkts-copy/src/arkts-api/node-utilities/BlockStatement.ts +0 -4
- package/build/libarkts-copy/src/arkts-api/node-utilities/CallExpression.ts +1 -22
- package/build/libarkts-copy/src/arkts-api/node-utilities/ClassDefinition.ts +7 -8
- package/build/libarkts-copy/src/arkts-api/node-utilities/ClassProperty.ts +1 -22
- package/build/libarkts-copy/src/arkts-api/node-utilities/ETSFunctionType.ts +2 -5
- package/build/libarkts-copy/src/arkts-api/node-utilities/ETSImportDeclaration.ts +1 -1
- package/build/libarkts-copy/src/arkts-api/node-utilities/ETSModule.ts +44 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/ETSParameterExpression.ts +1 -4
- package/build/libarkts-copy/src/arkts-api/node-utilities/MethodDefinition.ts +3 -12
- package/build/libarkts-copy/src/arkts-api/node-utilities/ObjectExpression.ts +1 -1
- package/build/libarkts-copy/src/arkts-api/node-utilities/Program.ts +10 -11
- package/build/libarkts-copy/src/arkts-api/node-utilities/ScriptFunction.ts +17 -6
- package/build/libarkts-copy/src/arkts-api/node-utilities/TSInterfaceDeclaration.ts +3 -6
- package/build/libarkts-copy/src/arkts-api/peers/AstNode.ts +3 -3
- package/build/libarkts-copy/src/arkts-api/peers/Config.ts +1 -1
- package/build/libarkts-copy/src/arkts-api/peers/Context.ts +26 -5
- package/build/libarkts-copy/src/arkts-api/peers/ExternalSource.ts +4 -0
- package/build/libarkts-copy/src/arkts-api/plugins.ts +15 -7
- package/build/libarkts-copy/src/arkts-api/static/global.ts +3 -2
- package/build/libarkts-copy/src/{wrapper-compat/arkts-api → arkts-api}/static/globalUtils.ts +4 -4
- package/build/libarkts-copy/src/arkts-api/static/profiler.ts +0 -8
- package/build/libarkts-copy/src/arkts-api/utilities/extensions.ts +80 -0
- package/build/libarkts-copy/src/arkts-api/utilities/nativePtrDecoder.ts +1 -1
- package/build/libarkts-copy/src/arkts-api/utilities/private.ts +5 -5
- package/build/libarkts-copy/src/arkts-api/utilities/public.ts +217 -29
- package/build/libarkts-copy/src/arkts-api/visitor.ts +17 -10
- package/build/libarkts-copy/src/checkSdk.ts +15 -0
- package/build/libarkts-copy/src/generated/Es2pandaEnums.ts +343 -321
- package/build/libarkts-copy/src/generated/Es2pandaNativeModule.ts +97 -14
- package/build/libarkts-copy/src/generated/factory.ts +40 -27
- package/build/libarkts-copy/src/generated/index.ts +4 -2
- package/build/libarkts-copy/src/generated/peers/AnnotatedAstNode.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/AnnotatedExpression.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/AnnotatedStatement.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/AnnotationDeclaration.ts +11 -5
- package/build/libarkts-copy/src/generated/peers/AnnotationUsage.ts +11 -5
- package/build/libarkts-copy/src/generated/peers/ArkTsConfig.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/ArrayExpression.ts +12 -6
- package/build/libarkts-copy/src/generated/peers/ArrowFunctionExpression.ts +26 -8
- package/build/libarkts-copy/src/generated/peers/AssertStatement.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/AssignmentExpression.ts +12 -6
- package/build/libarkts-copy/src/generated/peers/AstDumper.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/AstVerifier.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/AstVisitor.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/AwaitExpression.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/BigIntLiteral.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/BinaryExpression.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/BindingProps.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/BlockExpression.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/BlockStatement.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/BooleanLiteral.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/BreakStatement.ts +11 -5
- package/build/libarkts-copy/src/generated/peers/CallExpression.ts +19 -7
- package/build/libarkts-copy/src/generated/peers/CatchClause.ts +11 -5
- package/build/libarkts-copy/src/generated/peers/ChainExpression.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/CharLiteral.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/ClassDeclaration.ts +21 -8
- package/build/libarkts-copy/src/generated/peers/ClassDefinition.ts +37 -13
- package/build/libarkts-copy/src/generated/peers/ClassElement.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/ClassExpression.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/ClassProperty.ts +19 -7
- package/build/libarkts-copy/src/generated/peers/ClassStaticBlock.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/CodeGen.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/ConditionalExpression.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/ContinueStatement.ts +11 -5
- package/build/libarkts-copy/src/generated/peers/DebuggerStatement.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/Declaration.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/Decorator.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/DiagnosticInfo.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/DirectEvalExpression.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/DoWhileStatement.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/DynamicImportData.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/ETSClassLiteral.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/ETSFunctionType.ts +20 -13
- package/build/libarkts-copy/src/generated/peers/ETSImportDeclaration.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/ETSIntrinsicNode.ts +77 -0
- package/build/libarkts-copy/src/generated/peers/ETSKeyofType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/ETSModule.ts +11 -5
- package/build/libarkts-copy/src/generated/peers/ETSNewArrayInstanceExpression.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/ETSNewClassInstanceExpression.ts +12 -6
- package/build/libarkts-copy/src/generated/peers/ETSNewMultiDimArrayInstanceExpression.ts +12 -6
- package/build/libarkts-copy/src/generated/peers/ETSNullType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/ETSPackageDeclaration.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/ETSParameterExpression.ts +46 -14
- package/build/libarkts-copy/src/generated/peers/ETSPrimitiveType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/ETSReExportDeclaration.ts +3 -3
- package/build/libarkts-copy/src/generated/peers/ETSStringLiteralType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/ETSStructDeclaration.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/ETSTuple.ts +21 -9
- package/build/libarkts-copy/src/generated/peers/ETSTypeReference.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/ETSTypeReferencePart.ts +12 -6
- package/build/libarkts-copy/src/generated/peers/ETSUndefinedType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/ETSUnionType.ts +20 -7
- package/build/libarkts-copy/src/generated/peers/ETSWildcardType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/EmptyStatement.ts +11 -5
- package/build/libarkts-copy/src/generated/peers/ErrorLogger.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/ExportAllDeclaration.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/ExportDefaultDeclaration.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/ExportNamedDeclaration.ts +20 -8
- package/build/libarkts-copy/src/generated/peers/ExportSpecifier.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/Expression.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/ExpressionStatement.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/ForInStatement.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/ForOfStatement.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/ForUpdateStatement.ts +5 -3
- package/build/libarkts-copy/src/generated/peers/FunctionDecl.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/FunctionDeclaration.ts +11 -5
- package/build/libarkts-copy/src/generated/peers/FunctionExpression.ts +11 -5
- package/build/libarkts-copy/src/generated/peers/FunctionSignature.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/IRNode.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/Identifier.ts +14 -6
- package/build/libarkts-copy/src/generated/peers/IfStatement.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/ImportDeclaration.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/ImportDefaultSpecifier.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/ImportExpression.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/ImportNamespaceSpecifier.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/ImportSource.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/ImportSpecifier.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/IndexInfo.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/InterfaceDecl.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/LabelPair.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/LabelledStatement.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/Literal.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/LoopStatement.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/MaybeOptionalExpression.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/MemberExpression.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/MetaProperty.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/MethodDefinition.ts +23 -7
- package/build/libarkts-copy/src/generated/peers/NamedType.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/NewExpression.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/NullLiteral.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/NumberLiteral.ts +17 -7
- package/build/libarkts-copy/src/generated/peers/ObjectDescriptor.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/ObjectExpression.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/OmittedExpression.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/OpaqueTypeNode.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/OverloadDeclaration.ts +103 -0
- package/build/libarkts-copy/src/generated/peers/PrefixAssertionExpression.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/Program.ts +4 -2
- package/build/libarkts-copy/src/generated/peers/Property.ts +12 -6
- package/build/libarkts-copy/src/generated/peers/RegExpLiteral.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/ReturnStatement.ts +12 -6
- package/build/libarkts-copy/src/generated/peers/ScopeFindResult.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/ScriptFunction.ts +47 -14
- package/build/libarkts-copy/src/generated/peers/ScriptFunctionData.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/SequenceExpression.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/SignatureInfo.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/SourcePosition.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/SourceRange.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/SpreadElement.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/SrcDumper.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/Statement.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/StringLiteral.ts +12 -6
- package/build/libarkts-copy/src/generated/peers/SuggestionInfo.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/SuperExpression.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/SwitchCaseStatement.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/SwitchStatement.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSAnyKeyword.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSArrayType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSAsExpression.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSBigintKeyword.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSBooleanKeyword.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSClassImplements.ts +12 -6
- package/build/libarkts-copy/src/generated/peers/TSConditionalType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSConstructorType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSEnumDeclaration.ts +19 -6
- package/build/libarkts-copy/src/generated/peers/TSEnumMember.ts +12 -6
- package/build/libarkts-copy/src/generated/peers/TSExternalModuleReference.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSFunctionType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSImportEqualsDeclaration.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSImportType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSIndexSignature.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSIndexedAccessType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSInferType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSInterfaceBody.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSInterfaceDeclaration.ts +21 -8
- package/build/libarkts-copy/src/generated/peers/TSInterfaceHeritage.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSIntersectionType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSLiteralType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSMappedType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSMethodSignature.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSModuleBlock.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSModuleDeclaration.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSNamedTupleMember.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSNeverKeyword.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSNonNullExpression.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSNullKeyword.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSNumberKeyword.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSObjectKeyword.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSParameterProperty.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSParenthesizedType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSPropertySignature.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSQualifiedName.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSSignatureDeclaration.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSStringKeyword.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSThisType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSTupleType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSTypeAliasDeclaration.ts +42 -11
- package/build/libarkts-copy/src/generated/peers/TSTypeAssertion.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSTypeLiteral.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSTypeOperator.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSTypeParameter.ts +12 -6
- package/build/libarkts-copy/src/generated/peers/TSTypeParameterDeclaration.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSTypeParameterInstantiation.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSTypePredicate.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSTypeQuery.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSTypeReference.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSUndefinedKeyword.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSUnionType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSUnknownKeyword.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSVoidKeyword.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TaggedTemplateExpression.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TemplateElement.ts +12 -6
- package/build/libarkts-copy/src/generated/peers/TemplateLiteral.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/ThisExpression.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/ThrowStatement.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TryStatement.ts +12 -6
- package/build/libarkts-copy/src/generated/peers/TypeNode.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/TypedAstNode.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/TypedStatement.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/TypeofExpression.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/UnaryExpression.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/UndefinedLiteral.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/UpdateExpression.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/VReg.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/ValidationInfo.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/VariableDeclaration.ts +20 -8
- package/build/libarkts-copy/src/generated/peers/VariableDeclarator.ts +12 -6
- package/build/libarkts-copy/src/generated/peers/VerificationContext.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/VerifierMessage.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/WhileStatement.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/YieldExpression.ts +9 -5
- package/build/libarkts-copy/src/index.ts +1 -4
- package/build/libarkts-copy/src/plugin-utils.ts +45 -32
- package/build/libarkts-copy/src/reexport-for-generated.ts +10 -1
- package/build/libarkts-copy/src/ts-api/factory/nodeFactory.ts +14 -14
- package/build/libarkts-copy/src/ts-api/index.ts +1 -1
- package/build/libarkts-copy/src/ts-api/types.ts +56 -56
- package/build/libarkts-copy/src/ts-api/utilities/private.ts +6 -6
- package/build/libarkts-copy/src/ts-api/utilities/public.ts +3 -3
- package/build/libarkts-copy/src/ts-api/visitor/visitor.ts +4 -4
- package/build/libarkts-copy/src/utils.ts +13 -159
- package/build/libarkts-copy/src/wrapper-compat/README.md +4 -0
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/index.ts +5 -5
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ArrayExpression.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ArrowFunctionExpression.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/AssignmentExpression.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/BlockStatement.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/CallExpression.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ClassDeclaration.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ClassDefinition.ts +2 -2
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ClassProperty.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ETSFunctionType.ts +2 -2
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ETSImportDeclaration.ts +2 -2
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ETSParameterExpression.ts +2 -2
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ExpressionStatement.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/FunctionDeclaration.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/FunctionExpression.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/IfStatement.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/MemberExpression.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/MethodDefinition.ts +2 -2
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/NumberLiteral.ts +2 -2
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ObjectExpression.ts +3 -3
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/Property.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ScriptFunction.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/StructDeclaration.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/TSInterfaceDeclaration.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/TSTypeAliasDeclaration.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/TSTypeParameter.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/TryStatement.ts +3 -3
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/VariableDeclaration.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/VariableDeclarator.ts +2 -2
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/Diagnostic.ts +4 -5
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/DiagnosticInfo.ts +4 -3
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/DiagnosticKind.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/ImportPathManager.ts +2 -2
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/Program.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/SourcePosition.ts +2 -2
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/SourceRange.ts +2 -2
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/SuggestionInfo.ts +4 -3
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/to-be-generated/MemberExpression.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/types.ts +12 -30
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/utilities/nativePtrDecoder.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/utilities/private.ts +4 -4
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/utilities/public.ts +10 -8
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/visitor.ts +10 -10
- package/lib/index.js +2799 -2665
- package/package.json +2 -2
- package/templates/Es2pandaEnums.ts +1 -2
- package/templates/Es2pandaNativeModule.ts +2 -3
- package/templates/factory.ts +1 -2
- package/templates/index.ts +1 -2
- package/templates/node-map.ts +1 -2
- package/templates/peer.ts +1 -2
- package/build/libarkts-copy/src/arkts-api/CheckedBackFilter.ts +0 -131
- package/build/libarkts-copy/src/arkts-api/CompileWithCache.ts +0 -193
- package/build/libarkts-copy/src/arkts-api/InferVoidReturnType.ts +0 -89
- package/build/libarkts-copy/src/arkts-api/SetBaseOverloads.ts +0 -44
- package/build/libarkts-copy/src/arkts-api/node-utilities/AnnotationUsage.ts +0 -29
- package/build/libarkts-copy/src/arkts-api/node-utilities/ArrowFunctionExpression.ts +0 -49
- package/build/libarkts-copy/src/arkts-api/node-utilities/ClassDeclaration.ts +0 -54
- package/build/libarkts-copy/src/arkts-api/node-utilities/TSTypeAliasDeclaration.ts +0 -68
- package/build/libarkts-copy/src/arkts-api/node-utilities/VariableDeclaration.ts +0 -54
- package/build/libarkts-copy/src/arkts-api/utilities/method-definition.ts +0 -38
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/ArktsObject.ts +0 -45
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/Config.ts +0 -53
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/Context.ts +0 -60
package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/TSInterfaceDeclaration.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
import { TSInterfaceDeclaration, TSInterfaceHeritage } from '../../../generated';
|
|
17
|
-
import { isSameNativeObject } from '
|
|
17
|
+
import { isSameNativeObject } from '../../../arkts-api/peers/ArktsObject';
|
|
18
18
|
import { AstNode } from '../peers/AstNode';
|
|
19
19
|
import { attachModifiers, updateThenAttach } from '../utilities/private';
|
|
20
20
|
|
package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/TSTypeAliasDeclaration.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
import { Identifier, TSTypeAliasDeclaration, TSTypeParameterDeclaration, TypeNode } from '../../../generated';
|
|
17
|
-
import { isSameNativeObject } from '
|
|
17
|
+
import { isSameNativeObject } from '../../../arkts-api/peers/ArktsObject';
|
|
18
18
|
import { attachModifiers, updateThenAttach } from '../utilities/private';
|
|
19
19
|
|
|
20
20
|
export function updateTSTypeAliasDeclaration(
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
import { Identifier, TSTypeParameter, TypeNode } from '../../../generated';
|
|
17
|
-
import { isSameNativeObject } from '
|
|
17
|
+
import { isSameNativeObject } from '../../../arkts-api/peers/ArktsObject';
|
|
18
18
|
import { attachModifiers, updateThenAttach } from '../utilities/private';
|
|
19
19
|
|
|
20
20
|
export function updateTSTypeParameter(
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
import { LabelPair } from '../../../generated/peers/LabelPair';
|
|
17
17
|
import { BlockStatement, CatchClause, Statement, TryStatement } from '../../../generated';
|
|
18
|
-
import { isSameNativeObject } from '
|
|
18
|
+
import { isSameNativeObject } from '../../../arkts-api/peers/ArktsObject';
|
|
19
19
|
import { attachModifiers, updateThenAttach } from '../utilities/private';
|
|
20
20
|
|
|
21
21
|
export function updateTryStatement(
|
|
@@ -30,8 +30,8 @@ export function updateTryStatement(
|
|
|
30
30
|
isSameNativeObject(block, original.block) &&
|
|
31
31
|
isSameNativeObject(catchClauses, original.catchClauses) &&
|
|
32
32
|
isSameNativeObject(finalizer, original.finallyBlock)
|
|
33
|
-
/*
|
|
34
|
-
/*
|
|
33
|
+
/* Improve: no getter for finalizerInsertionsLabelPair */
|
|
34
|
+
/* Improve: no getter for finalizerInsertionsStatement */
|
|
35
35
|
) {
|
|
36
36
|
return original;
|
|
37
37
|
}
|
package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/VariableDeclaration.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
import { KInt } from '@koalaui/interop';
|
|
17
|
-
import { isSameNativeObject } from '
|
|
17
|
+
import { isSameNativeObject } from '../../../arkts-api/peers/ArktsObject';
|
|
18
18
|
import { VariableDeclaration, VariableDeclarator } from '../types';
|
|
19
19
|
import { attachModifiers, updateThenAttach } from '../utilities/private';
|
|
20
20
|
import { Es2pandaVariableDeclarationKind } from '../../../generated/Es2pandaEnums';
|
package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/VariableDeclarator.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
import { Identifier } from '../../../generated';
|
|
17
|
-
import { isSameNativeObject } from '
|
|
17
|
+
import { isSameNativeObject } from '../../../arkts-api/peers/ArktsObject';
|
|
18
18
|
import { VariableDeclarator } from '../types';
|
|
19
19
|
import { attachModifiers, updateThenAttach } from '../utilities/private';
|
|
20
20
|
import { Es2pandaVariableDeclaratorFlag } from '../../../generated/Es2pandaEnums';
|
|
@@ -29,7 +29,7 @@ export function updateVariableDeclarator(
|
|
|
29
29
|
if (
|
|
30
30
|
isSameNativeObject(name, original.name) &&
|
|
31
31
|
isSameNativeObject(initializer, original.initializer)
|
|
32
|
-
/*
|
|
32
|
+
/* Improve: no getter for flag */
|
|
33
33
|
) {
|
|
34
34
|
return original;
|
|
35
35
|
}
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
* limitations under the License.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import { ArktsObject } from '
|
|
16
|
+
import { ArktsObject } from '../../../arkts-api/peers/ArktsObject';
|
|
17
17
|
import { global } from '../static/global';
|
|
18
18
|
import { KNativePointer } from '@koalaui/interop';
|
|
19
19
|
import { DiagnosticKind } from './DiagnosticKind';
|
|
20
20
|
import { passStringArray } from '../utilities/private';
|
|
21
|
-
import { SourcePosition } from '
|
|
21
|
+
import { SourcePosition } from '../../../arkts-api/peers/SourcePosition';
|
|
22
22
|
import { SourceRange } from './SourceRange';
|
|
23
23
|
import { DiagnosticInfo } from './DiagnosticInfo';
|
|
24
24
|
import { SuggestionInfo } from './SuggestionInfo';
|
|
@@ -31,9 +31,8 @@ export class Diagnostic extends ArktsObject {
|
|
|
31
31
|
global.es2panda._LogDiagnostic(global.context, kind.peer, passStringArray(args), args.length, pos.peer);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
static logDiagnosticWithSuggestion(diagnosticInfo: DiagnosticInfo, suggestionInfo: SuggestionInfo
|
|
35
|
-
|
|
36
|
-
global.es2panda._LogDiagnosticWithSuggestion(global.context, diagnosticInfo.peer, suggestionInfo.peer, range.peer);
|
|
34
|
+
static logDiagnosticWithSuggestion(diagnosticInfo: DiagnosticInfo, suggestionInfo: SuggestionInfo): void {
|
|
35
|
+
global.es2panda._LogDiagnosticWithSuggestion(global.context, diagnosticInfo.peer, suggestionInfo.peer);
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
}
|
|
@@ -13,10 +13,11 @@
|
|
|
13
13
|
* limitations under the License.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import { ArktsObject } from '
|
|
16
|
+
import { ArktsObject } from '../../../arkts-api/peers/ArktsObject';
|
|
17
17
|
import { global } from '../static/global';
|
|
18
18
|
import { KNativePointer } from '@koalaui/interop';
|
|
19
19
|
import { DiagnosticKind } from './DiagnosticKind';
|
|
20
|
+
import { SourcePosition } from "./SourcePosition";
|
|
20
21
|
import { passStringArray } from '../utilities/private';
|
|
21
22
|
|
|
22
23
|
export class DiagnosticInfo extends ArktsObject {
|
|
@@ -24,9 +25,9 @@ export class DiagnosticInfo extends ArktsObject {
|
|
|
24
25
|
super(peer);
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
static create(kind: DiagnosticKind, ...args: string[]): DiagnosticInfo {
|
|
28
|
+
static create(kind: DiagnosticKind, pos: SourcePosition, ...args: string[]): DiagnosticInfo {
|
|
28
29
|
return new DiagnosticInfo(
|
|
29
|
-
global.es2panda._CreateDiagnosticInfo(global.context, kind.peer, passStringArray(args), args.length)
|
|
30
|
+
global.es2panda._CreateDiagnosticInfo(global.context, kind.peer, passStringArray(args), args.length, pos.peer)
|
|
30
31
|
);
|
|
31
32
|
}
|
|
32
33
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* limitations under the License.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import { ArktsObject } from '
|
|
16
|
+
import { ArktsObject } from '../../../arkts-api/peers/ArktsObject';
|
|
17
17
|
import { global } from '../static/global';
|
|
18
18
|
import { KNativePointer } from '@koalaui/interop';
|
|
19
19
|
import { Es2pandaPluginDiagnosticType as PluginDiagnosticType } from '../../../generated/Es2pandaEnums';
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* limitations under the License.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import { ArktsObject } from "
|
|
16
|
+
import { ArktsObject } from "../../../arkts-api/peers/ArktsObject"
|
|
17
17
|
import { global } from "../static/global"
|
|
18
18
|
import { KNativePointer } from "@koalaui/interop"
|
|
19
19
|
|
|
@@ -29,6 +29,6 @@ export class ImportPathManager extends ArktsObject {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
resolvePath(currentModulePath: string, importPath: string): string {
|
|
32
|
-
return ''; //
|
|
32
|
+
return ''; // Improve: no longer support this.
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* limitations under the License.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import { ArktsObject } from "
|
|
16
|
+
import { ArktsObject } from "../../../arkts-api/peers/ArktsObject"
|
|
17
17
|
import { global } from "../static/global"
|
|
18
18
|
import { acceptNativeObjectArrayResult, unpackString } from "../utilities/private"
|
|
19
19
|
import { KNativePointer } from "@koalaui/interop"
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* limitations under the License.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import { ArktsObject } from "
|
|
16
|
+
import { ArktsObject } from "../../../arkts-api/peers/ArktsObject"
|
|
17
17
|
import { global } from "../static/global"
|
|
18
18
|
import { KNativePointer } from "@koalaui/interop"
|
|
19
19
|
|
|
@@ -35,4 +35,4 @@ export class SourcePosition extends ArktsObject {
|
|
|
35
35
|
line(): number {
|
|
36
36
|
return global.es2panda._SourcePositionLine(global.context, this.peer);
|
|
37
37
|
}
|
|
38
|
-
}
|
|
38
|
+
}
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
* See the License for the specific language governing permissions and
|
|
13
13
|
* limitations under the License.
|
|
14
14
|
*/
|
|
15
|
-
import { SourcePosition } from '
|
|
16
|
-
import { ArktsObject } from '
|
|
15
|
+
import { SourcePosition } from '../../../arkts-api/peers/SourcePosition';
|
|
16
|
+
import { ArktsObject } from '../../../arkts-api/peers/ArktsObject';
|
|
17
17
|
import { global } from '../static/global';
|
|
18
18
|
import { KNativePointer } from '@koalaui/interop';
|
|
19
19
|
|
|
@@ -13,20 +13,21 @@
|
|
|
13
13
|
* limitations under the License.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import { ArktsObject } from '
|
|
16
|
+
import { ArktsObject } from '../../../arkts-api/peers/ArktsObject';
|
|
17
17
|
import { global } from '../static/global';
|
|
18
18
|
import { KNativePointer } from '@koalaui/interop';
|
|
19
19
|
import { DiagnosticKind } from './DiagnosticKind';
|
|
20
20
|
import { passStringArray } from '../utilities/private';
|
|
21
|
+
import { SourceRange } from './SourceRange';
|
|
21
22
|
|
|
22
23
|
export class SuggestionInfo extends ArktsObject {
|
|
23
24
|
constructor(peer: KNativePointer) {
|
|
24
25
|
super(peer);
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
static create(kind: DiagnosticKind, substitutionCode: string, ...args: string[]): SuggestionInfo {
|
|
28
|
+
static create(kind: DiagnosticKind, substitutionCode: string, range: SourceRange, ...args: string[]): SuggestionInfo {
|
|
28
29
|
return new SuggestionInfo(
|
|
29
|
-
global.es2panda._CreateSuggestionInfo(global.context, kind.peer, passStringArray(args), args.length, substitutionCode)
|
|
30
|
+
global.es2panda._CreateSuggestionInfo(global.context, kind.peer, passStringArray(args), args.length, substitutionCode, range.peer)
|
|
30
31
|
);
|
|
31
32
|
}
|
|
32
33
|
|
|
@@ -35,9 +35,9 @@ import {
|
|
|
35
35
|
updatePeerByNode,
|
|
36
36
|
} from './utilities/private';
|
|
37
37
|
import { proceedToState } from './utilities/public';
|
|
38
|
-
import { AstNode } from '
|
|
39
|
-
import { Config } from '
|
|
40
|
-
import { Context } from '
|
|
38
|
+
import { AstNode } from '../../arkts-api/peers/AstNode';
|
|
39
|
+
import { Config } from '../../arkts-api/peers/Config';
|
|
40
|
+
import { Context } from '../../arkts-api/peers/Context';
|
|
41
41
|
import { nodeByType } from './class-by-peer';
|
|
42
42
|
import { MemberExpression } from './to-be-generated/MemberExpression';
|
|
43
43
|
import {
|
|
@@ -45,6 +45,7 @@ import {
|
|
|
45
45
|
ArrayExpression,
|
|
46
46
|
BlockStatement,
|
|
47
47
|
ClassDefinition,
|
|
48
|
+
ETSModule,
|
|
48
49
|
ETSTypeReference,
|
|
49
50
|
ETSTypeReferencePart,
|
|
50
51
|
Expression,
|
|
@@ -56,14 +57,8 @@ import {
|
|
|
56
57
|
TSTypeParameterInstantiation,
|
|
57
58
|
TypeNode,
|
|
58
59
|
} from '../../generated';
|
|
59
|
-
import { createCallExpression, updateCallExpression } from 'src/arkts-api/node-utilities/CallExpression';
|
|
60
|
-
|
|
61
|
-
export class EtsScript extends AstNode {
|
|
62
|
-
constructor(peer: KPtr) {
|
|
63
|
-
assertValidPeer(peer, Es2pandaAstNodeType.AST_NODE_TYPE_ETS_MODULE);
|
|
64
|
-
super(peer);
|
|
65
|
-
}
|
|
66
60
|
|
|
61
|
+
export class EtsScript extends ETSModule {
|
|
67
62
|
static fromContext(): EtsScript {
|
|
68
63
|
console.log('[TS WRAPPER] GET AST FROM CONTEXT');
|
|
69
64
|
return new EtsScript(
|
|
@@ -81,7 +76,7 @@ export class EtsScript extends AstNode {
|
|
|
81
76
|
if (!global.configIsInitialized()) {
|
|
82
77
|
global.config = Config.createDefault().peer;
|
|
83
78
|
}
|
|
84
|
-
global.compilerContext = Context.createFromString(source) as any; //
|
|
79
|
+
global.compilerContext = Context.createFromString(source) as any; // Improve: commonize context
|
|
85
80
|
proceedToState(state, global.context);
|
|
86
81
|
return new EtsScript(
|
|
87
82
|
global.es2panda._ProgramAst(global.context, global.es2panda._ContextProgram(global.context))
|
|
@@ -100,19 +95,6 @@ export class EtsScript extends AstNode {
|
|
|
100
95
|
);
|
|
101
96
|
return node;
|
|
102
97
|
}
|
|
103
|
-
|
|
104
|
-
get statements(): readonly AstNode[] {
|
|
105
|
-
return unpackNodeArray(global.generatedEs2panda._BlockStatementStatements(global.context, this.peer));
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
set statements(nodes: readonly AstNode[]) {
|
|
109
|
-
global.generatedEs2panda._BlockStatementSetStatements(
|
|
110
|
-
global.context,
|
|
111
|
-
this.peer,
|
|
112
|
-
passNodeArray(nodes),
|
|
113
|
-
nodes.length
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
98
|
}
|
|
117
99
|
|
|
118
100
|
export class ExpressionStatement extends AstNode {
|
|
@@ -145,7 +127,7 @@ export class ExpressionStatement extends AstNode {
|
|
|
145
127
|
}
|
|
146
128
|
}
|
|
147
129
|
|
|
148
|
-
//
|
|
130
|
+
// Improve:
|
|
149
131
|
// the CallExpression idl Create signature doesn't include the trailing block at all.
|
|
150
132
|
// Need to clarify with the compiler people if they will provide create signature with a trailing block argument.
|
|
151
133
|
export class CallExpression extends Expression {
|
|
@@ -398,13 +380,13 @@ export class FunctionDeclaration extends AstNode {
|
|
|
398
380
|
global.generatedEs2panda._CreateFunctionDeclaration(
|
|
399
381
|
global.context,
|
|
400
382
|
scriptFunction.peer,
|
|
401
|
-
//
|
|
383
|
+
// Improve: support annotations
|
|
402
384
|
arrayOfNullptr,
|
|
403
385
|
0,
|
|
404
386
|
isAnon
|
|
405
387
|
)
|
|
406
388
|
);
|
|
407
|
-
//
|
|
389
|
+
// Improve: maybe wrong
|
|
408
390
|
res.modifiers = scriptFunction.modifiers;
|
|
409
391
|
if (annotations) {
|
|
410
392
|
res.annotations = annotations;
|
|
@@ -423,7 +405,7 @@ export class FunctionDeclaration extends AstNode {
|
|
|
423
405
|
global.context,
|
|
424
406
|
node.peer,
|
|
425
407
|
scriptFunction.peer,
|
|
426
|
-
//
|
|
408
|
+
// Improve: support annotations
|
|
427
409
|
passNodeArray(annotations),
|
|
428
410
|
0,
|
|
429
411
|
isAnon
|
|
@@ -626,7 +608,7 @@ export class StructDeclaration extends AstNode {
|
|
|
626
608
|
constructor(peer: KPtr) {
|
|
627
609
|
assertValidPeer(peer, Es2pandaAstNodeType.AST_NODE_TYPE_STRUCT_DECLARATION);
|
|
628
610
|
super(peer);
|
|
629
|
-
//
|
|
611
|
+
// Improve: is struct definition the same as struct definition?
|
|
630
612
|
this.definition = unpackNonNullableNode(
|
|
631
613
|
global.generatedEs2panda._ClassDeclarationDefinition(global.context, this.peer)
|
|
632
614
|
);
|
|
@@ -711,7 +693,7 @@ export class MethodDefinition extends AstNode {
|
|
|
711
693
|
);
|
|
712
694
|
}
|
|
713
695
|
|
|
714
|
-
//
|
|
696
|
+
// Improve: does not work
|
|
715
697
|
isConstructor(): boolean {
|
|
716
698
|
return global.generatedEs2panda._MethodDefinitionIsConstructorConst(global.context, this.peer);
|
|
717
699
|
}
|
|
@@ -61,7 +61,7 @@ export class NativePtrDecoder extends ArrayDecoder<pointer> {
|
|
|
61
61
|
return global.interop._GetPtrVectorSize(blob)
|
|
62
62
|
}
|
|
63
63
|
disposeArray(blob: pointer): void {
|
|
64
|
-
//
|
|
64
|
+
// Improve:
|
|
65
65
|
}
|
|
66
66
|
getArrayElement(blob: pointer, index: int32): pointer {
|
|
67
67
|
return global.interop._GetPtrVectorElement(blob, index)
|
|
@@ -27,7 +27,7 @@ import { NativePtrDecoder } from './nativePtrDecoder';
|
|
|
27
27
|
import { Es2pandaModifierFlags, Es2pandaScriptFunctionFlags } from '../../../generated/Es2pandaEnums';
|
|
28
28
|
import { classByPeer } from '../class-by-peer';
|
|
29
29
|
import type { AstNode } from '../peers/AstNode';
|
|
30
|
-
import { ArktsObject } from '
|
|
30
|
+
import { ArktsObject } from '../../../arkts-api/peers/ArktsObject';
|
|
31
31
|
import { Es2pandaAstNodeType } from '../../../generated/Es2pandaEnums';
|
|
32
32
|
|
|
33
33
|
export const arrayOfNullptr = new BigUint64Array([nullptr]);
|
|
@@ -128,8 +128,8 @@ export function scriptFunctionHasBody(peer: KNativePointer): boolean {
|
|
|
128
128
|
);
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
//
|
|
132
|
-
//
|
|
131
|
+
// Improve: remove this
|
|
132
|
+
// Improve: update scopes and other data
|
|
133
133
|
export function updatePeerByNode<T extends AstNode>(peer: KNativePointer, original: T | undefined): KNativePointer {
|
|
134
134
|
if (peer === nullptr) {
|
|
135
135
|
throwError('updatePeerByNode called on NULLPTR');
|
|
@@ -150,7 +150,7 @@ export function updatePeerByNode<T extends AstNode>(peer: KNativePointer, origin
|
|
|
150
150
|
return peer;
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
//
|
|
153
|
+
// Improve: update scopes and other data
|
|
154
154
|
export function updateNodeByNode<T extends AstNode>(node: T, original: AstNode): T {
|
|
155
155
|
if (original.peer === nullptr) {
|
|
156
156
|
throwError('update called on NULLPTR');
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
} from '../../../generated';
|
|
41
41
|
import { Program } from '../peers/Program';
|
|
42
42
|
import { clearNodeCache, nodeByType } from '../class-by-peer';
|
|
43
|
-
import { SourcePosition } from '
|
|
43
|
+
import { SourcePosition } from '../../../arkts-api/peers/SourcePosition';
|
|
44
44
|
import { MemberExpression } from '../to-be-generated/MemberExpression';
|
|
45
45
|
|
|
46
46
|
export function proceedToState(state: Es2pandaContextState, context: KNativePointer, forceDtsEmit = false): void {
|
|
@@ -166,7 +166,7 @@ export function getAnnotations(node: AstNode): readonly AnnotationUsage[] {
|
|
|
166
166
|
|
|
167
167
|
export function getOriginalNode(node: AstNode): AstNode {
|
|
168
168
|
if (node === undefined) {
|
|
169
|
-
//
|
|
169
|
+
// Improve: fix this
|
|
170
170
|
throwError('there is no arkts pair of ts node (unable to getOriginalNode)');
|
|
171
171
|
}
|
|
172
172
|
if (node.originalPeer === nullptr) {
|
|
@@ -195,15 +195,15 @@ export function ImportSpecifierIsRemovableConst(node: ImportSpecifier): boolean
|
|
|
195
195
|
return global.generatedEs2panda._ImportSpecifierIsRemovableConst(global.context, node.peer);
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
-
//
|
|
199
|
-
// with
|
|
198
|
+
// Improve: It seems like Definition overrides AstNode modifiers
|
|
199
|
+
// with its own modifiers which is completely unrelated set of flags.
|
|
200
200
|
// Use this function if you need
|
|
201
201
|
// the language level modifiers: public, declare, export, etc.
|
|
202
202
|
export function classDefinitionFlags(node: ClassDefinition): Es2pandaModifierFlags {
|
|
203
203
|
return global.generatedEs2panda._AstNodeModifiers(global.context, node.peer);
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
-
//
|
|
206
|
+
// Improve: Import statements should be inserted to the statements
|
|
207
207
|
export function importDeclarationInsert(node: ETSImportDeclaration, program: Program): void {
|
|
208
208
|
global.es2panda._InsertETSImportDeclarationAndParse(global.context, program.peer, node.peer);
|
|
209
209
|
}
|
|
@@ -224,7 +224,7 @@ export function hasModifierFlag(node: AstNode, flag: Es2pandaModifierFlags): boo
|
|
|
224
224
|
return (modifiers & flag) === flag;
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
-
//
|
|
227
|
+
// Improve: ClassProperty's optional flag is set by AstNode's modifiers flags.
|
|
228
228
|
export function classPropertySetOptional(node: ClassProperty, value: boolean): ClassProperty {
|
|
229
229
|
if (value) {
|
|
230
230
|
node.modifiers |= Es2pandaModifierFlags.MODIFIER_FLAGS_OPTIONAL;
|
|
@@ -256,14 +256,16 @@ export function generateTsDeclarationsFromContext(
|
|
|
256
256
|
outputDeclEts: string,
|
|
257
257
|
outputEts: string,
|
|
258
258
|
exportAll: boolean,
|
|
259
|
-
isolated: boolean
|
|
259
|
+
isolated: boolean,
|
|
260
|
+
recordFile: string
|
|
260
261
|
): KInt {
|
|
261
262
|
return global.es2panda._GenerateTsDeclarationsFromContext(
|
|
262
263
|
global.context,
|
|
263
264
|
passString(outputDeclEts),
|
|
264
265
|
passString(outputEts),
|
|
265
266
|
exportAll,
|
|
266
|
-
isolated
|
|
267
|
+
isolated,
|
|
268
|
+
recordFile
|
|
267
269
|
);
|
|
268
270
|
}
|
|
269
271
|
|
|
@@ -64,7 +64,7 @@ import { Es2pandaAstNodeType } from '../../generated/Es2pandaEnums';
|
|
|
64
64
|
|
|
65
65
|
type Visitor = (node: AstNode) => AstNode;
|
|
66
66
|
|
|
67
|
-
//
|
|
67
|
+
// Improve: rethink (remove as)
|
|
68
68
|
function nodeVisitor<T extends AstNode | undefined>(node: T, visitor: Visitor): T {
|
|
69
69
|
if (node === undefined) {
|
|
70
70
|
return node;
|
|
@@ -72,7 +72,7 @@ function nodeVisitor<T extends AstNode | undefined>(node: T, visitor: Visitor):
|
|
|
72
72
|
return visitor(node) as T;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
//
|
|
75
|
+
// Improve: rethink (remove as)
|
|
76
76
|
function nodesVisitor<T extends AstNode, TIn extends readonly T[] | undefined>(
|
|
77
77
|
nodes: TIn,
|
|
78
78
|
visitor: Visitor
|
|
@@ -97,7 +97,7 @@ export function visitEachChild(node: AstNode, visitor: Visitor): AstNode {
|
|
|
97
97
|
script = visitInnerExpression(script, visitor);
|
|
98
98
|
script = visitTrivialExpression(script, visitor);
|
|
99
99
|
script = visitLiteral(script, visitor);
|
|
100
|
-
//
|
|
100
|
+
// Improve:
|
|
101
101
|
return visitWithoutUpdate(script, visitor);
|
|
102
102
|
}
|
|
103
103
|
|
|
@@ -194,7 +194,7 @@ function visitInnerExpression(node: AstNode, visitor: Visitor): AstNode {
|
|
|
194
194
|
updated = true;
|
|
195
195
|
return factory.updateProperty(node, node.key, nodeVisitor(node.value, visitor));
|
|
196
196
|
}
|
|
197
|
-
//
|
|
197
|
+
// Improve:
|
|
198
198
|
return node;
|
|
199
199
|
}
|
|
200
200
|
|
|
@@ -211,7 +211,7 @@ function visitTrivialExpression(node: AstNode, visitor: Visitor): AstNode {
|
|
|
211
211
|
node.operatorType
|
|
212
212
|
);
|
|
213
213
|
}
|
|
214
|
-
//
|
|
214
|
+
// Improve:
|
|
215
215
|
return node;
|
|
216
216
|
}
|
|
217
217
|
|
|
@@ -245,7 +245,7 @@ function visitDeclaration(node: AstNode, visitor: Visitor): AstNode {
|
|
|
245
245
|
nodeVisitor(node.typeParams, visitor),
|
|
246
246
|
nodeVisitor(node.body, visitor),
|
|
247
247
|
node.isStatic,
|
|
248
|
-
//
|
|
248
|
+
// Improve: how do I get it?
|
|
249
249
|
true
|
|
250
250
|
);
|
|
251
251
|
}
|
|
@@ -258,7 +258,7 @@ function visitDeclaration(node: AstNode, visitor: Visitor): AstNode {
|
|
|
258
258
|
nodesVisitor(node.declarators, visitor)
|
|
259
259
|
);
|
|
260
260
|
}
|
|
261
|
-
//
|
|
261
|
+
// Improve:
|
|
262
262
|
return node;
|
|
263
263
|
}
|
|
264
264
|
|
|
@@ -344,7 +344,7 @@ function visitStatement(node: AstNode, visitor: Visitor): AstNode {
|
|
|
344
344
|
[]
|
|
345
345
|
);
|
|
346
346
|
}
|
|
347
|
-
//
|
|
347
|
+
// Improve:
|
|
348
348
|
return node;
|
|
349
349
|
}
|
|
350
350
|
|
|
@@ -389,7 +389,7 @@ function visitDefinitionBody(node: AstNode, visitor: Visitor): AstNode {
|
|
|
389
389
|
node.isComputed
|
|
390
390
|
);
|
|
391
391
|
}
|
|
392
|
-
//
|
|
392
|
+
// Improve:
|
|
393
393
|
return node;
|
|
394
394
|
}
|
|
395
395
|
|
|
@@ -409,7 +409,7 @@ function visitLiteral(node: AstNode, visitor: Visitor): AstNode {
|
|
|
409
409
|
return node;
|
|
410
410
|
}
|
|
411
411
|
|
|
412
|
-
//
|
|
412
|
+
// Improve: apply this to all nodes that does not require updating
|
|
413
413
|
function visitWithoutUpdate<T extends AstNode>(node: T, visitor: Visitor): T {
|
|
414
414
|
if (updated) {
|
|
415
415
|
return node;
|