@idlizer/arktscgen 2.1.10-arktscgen-4 → 2.1.10-arktscgen-6
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 +24 -47
- package/build/libarkts-copy/native/meson.build +26 -10
- package/build/libarkts-copy/native/meson_options.txt +9 -3
- package/build/libarkts-copy/native/mingw.cross +2 -0
- package/build/libarkts-copy/native/src/bridges.cc +55 -159
- package/build/libarkts-copy/native/src/common.cc +316 -97
- package/build/libarkts-copy/native/src/common.h +22 -22
- package/build/libarkts-copy/native/src/memoryTracker.cc +5 -5
- package/build/libarkts-copy/native/src/memoryTracker.h +5 -5
- package/build/libarkts-copy/package.json +31 -25
- package/build/libarkts-copy/src/Es2pandaNativeModule.ts +139 -116
- package/build/libarkts-copy/src/InteropNativeModule.ts +18 -15
- package/build/libarkts-copy/src/arkts-api/AbstractVisitor.ts +24 -19
- package/build/libarkts-copy/src/arkts-api/ImportStorage.ts +30 -31
- package/build/libarkts-copy/src/arkts-api/ProgramProvider.ts +30 -18
- package/build/libarkts-copy/src/arkts-api/class-by-peer.ts +30 -12
- package/build/libarkts-copy/src/arkts-api/factory/nodeFactory.ts +38 -29
- package/build/libarkts-copy/src/arkts-api/index.ts +23 -24
- package/build/libarkts-copy/src/arkts-api/node-cache.ts +22 -13
- package/build/libarkts-copy/src/arkts-api/node-utilities/ArkTsConfig.ts +8 -8
- package/build/libarkts-copy/src/arkts-api/node-utilities/ArrayExpression.ts +9 -21
- package/build/libarkts-copy/src/arkts-api/node-utilities/AssignmentExpression.ts +12 -14
- package/build/libarkts-copy/src/arkts-api/node-utilities/BlockStatement.ts +5 -5
- package/build/libarkts-copy/src/arkts-api/node-utilities/CallExpression.ts +26 -24
- package/build/libarkts-copy/src/arkts-api/node-utilities/ClassDefinition.ts +62 -32
- package/build/libarkts-copy/src/arkts-api/node-utilities/ClassProperty.ts +14 -13
- package/build/libarkts-copy/src/arkts-api/node-utilities/ETSFunctionType.ts +24 -21
- package/build/libarkts-copy/src/arkts-api/node-utilities/ETSImportDeclaration.ts +10 -12
- package/build/libarkts-copy/src/arkts-api/node-utilities/ETSModule.ts +14 -18
- package/build/libarkts-copy/src/arkts-api/node-utilities/ETSParameterExpression.ts +15 -16
- package/build/libarkts-copy/src/arkts-api/node-utilities/ETSStructDeclaration.ts +5 -8
- package/build/libarkts-copy/src/arkts-api/node-utilities/ETSTuple.ts +6 -12
- package/build/libarkts-copy/src/arkts-api/node-utilities/MemberExpression.ts +12 -11
- package/build/libarkts-copy/src/arkts-api/node-utilities/MethodDefinition.ts +14 -33
- package/build/libarkts-copy/src/arkts-api/node-utilities/NumberLiteral.ts +12 -23
- package/build/libarkts-copy/src/arkts-api/node-utilities/ObjectExpression.ts +17 -21
- package/build/libarkts-copy/src/arkts-api/node-utilities/OpaqueTypeNode.ts +9 -8
- package/build/libarkts-copy/src/arkts-api/node-utilities/Program.ts +21 -16
- package/build/libarkts-copy/src/arkts-api/node-utilities/ScriptFunction.ts +52 -53
- package/build/libarkts-copy/src/arkts-api/node-utilities/TSInterfaceDeclaration.ts +22 -32
- package/build/libarkts-copy/src/arkts-api/node-utilities/TSTypeParameter.ts +12 -14
- package/build/libarkts-copy/src/arkts-api/node-utilities/TSTypeReferencePart.ts +10 -12
- package/build/libarkts-copy/src/arkts-api/node-utilities/TryStatement.ts +10 -9
- package/build/libarkts-copy/src/arkts-api/node-utilities/VariableDeclarator.ts +10 -12
- package/build/libarkts-copy/src/arkts-api/peers/ArktsObject.ts +8 -8
- package/build/libarkts-copy/src/arkts-api/peers/AstNode.ts +53 -65
- package/build/libarkts-copy/src/arkts-api/peers/Config.ts +18 -25
- package/build/libarkts-copy/src/arkts-api/peers/Context.ts +35 -42
- package/build/libarkts-copy/src/arkts-api/peers/ExternalSource.ts +9 -9
- package/build/libarkts-copy/src/arkts-api/peers/ImportPathManager.ts +6 -8
- package/build/libarkts-copy/src/arkts-api/peers/Options.ts +8 -8
- package/build/libarkts-copy/src/arkts-api/plugins.ts +205 -32
- package/build/libarkts-copy/src/arkts-api/static/global.ts +35 -36
- package/build/libarkts-copy/src/arkts-api/static/globalUtils.ts +5 -5
- package/build/libarkts-copy/src/arkts-api/static/profiler.ts +107 -91
- package/build/libarkts-copy/src/arkts-api/utilities/extensions.ts +54 -37
- package/build/libarkts-copy/src/arkts-api/utilities/nativePtrDecoder.ts +86 -69
- package/build/libarkts-copy/src/arkts-api/utilities/performance.ts +41 -24
- package/build/libarkts-copy/src/arkts-api/utilities/private.ts +69 -62
- package/build/libarkts-copy/src/arkts-api/utilities/public.ts +254 -175
- package/build/libarkts-copy/src/arkts-api/visitor.ts +599 -756
- package/build/libarkts-copy/src/arkts-api/wrapper-compat.ts +8 -8
- package/build/libarkts-copy/src/checkSdk.ts +15 -18
- package/build/libarkts-copy/src/index.ts +29 -29
- package/build/libarkts-copy/src/memo-node-cache.ts +143 -0
- package/build/libarkts-copy/src/plugin-utils.ts +64 -45
- package/build/libarkts-copy/src/reexport-for-generated.ts +13 -10
- package/build/libarkts-copy/src/tracer.ts +76 -70
- package/build/libarkts-copy/src/ts-api/factory/nodeFactory.ts +134 -274
- package/build/libarkts-copy/src/ts-api/factory/nodeTests.ts +23 -23
- package/build/libarkts-copy/src/ts-api/index.ts +27 -35
- package/build/libarkts-copy/src/ts-api/static/enums.ts +3 -3
- package/build/libarkts-copy/src/ts-api/types.ts +535 -395
- package/build/libarkts-copy/src/ts-api/utilities/private.ts +116 -113
- package/build/libarkts-copy/src/ts-api/utilities/public.ts +18 -18
- package/build/libarkts-copy/src/ts-api/visitor/visitor.ts +33 -49
- package/build/libarkts-copy/src/utils.ts +103 -80
- package/build/libarkts-copy/tsconfig.json +3 -2
- package/lib/index.js +2713 -7729
- package/package.json +53 -52
- package/templates/Es2pandaNativeModule.ts +1 -0
- package/templates/peer.ts +1 -0
- package/build/libarkts-copy/native/src/generated/bridges.cc +0 -16375
- package/build/libarkts-copy/src/arkts-api/peers/DiagnosticKind.ts +0 -24
- package/build/libarkts-copy/src/generated/Es2pandaEnums.ts +0 -1344
- package/build/libarkts-copy/src/generated/Es2pandaNativeModule.ts +0 -5192
- package/build/libarkts-copy/src/generated/factory.ts +0 -1285
- package/build/libarkts-copy/src/generated/index.ts +0 -222
- package/build/libarkts-copy/src/generated/peers/AnnotatedAstNode.ts +0 -44
- package/build/libarkts-copy/src/generated/peers/AnnotatedExpression.ts +0 -54
- package/build/libarkts-copy/src/generated/peers/AnnotatedStatement.ts +0 -45
- package/build/libarkts-copy/src/generated/peers/AnnotationDeclaration.ts +0 -165
- package/build/libarkts-copy/src/generated/peers/AnnotationUsage.ts +0 -84
- package/build/libarkts-copy/src/generated/peers/ArkTsConfig.ts +0 -73
- package/build/libarkts-copy/src/generated/peers/ArrayExpression.ts +0 -109
- package/build/libarkts-copy/src/generated/peers/ArrowFunctionExpression.ts +0 -119
- package/build/libarkts-copy/src/generated/peers/AssertStatement.ts +0 -65
- package/build/libarkts-copy/src/generated/peers/AssignmentExpression.ts +0 -111
- package/build/libarkts-copy/src/generated/peers/AstDumper.ts +0 -49
- package/build/libarkts-copy/src/generated/peers/AstVerifier.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/AstVisitor.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/AwaitExpression.ts +0 -61
- package/build/libarkts-copy/src/generated/peers/BigIntLiteral.ts +0 -61
- package/build/libarkts-copy/src/generated/peers/BinaryExpression.ts +0 -110
- package/build/libarkts-copy/src/generated/peers/BindingProps.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/BlockExpression.ts +0 -72
- package/build/libarkts-copy/src/generated/peers/BlockStatement.ts +0 -94
- package/build/libarkts-copy/src/generated/peers/BooleanLiteral.ts +0 -61
- package/build/libarkts-copy/src/generated/peers/BreakStatement.ts +0 -78
- package/build/libarkts-copy/src/generated/peers/CallExpression.ts +0 -129
- package/build/libarkts-copy/src/generated/peers/CatchClause.ts +0 -74
- package/build/libarkts-copy/src/generated/peers/ChainExpression.ts +0 -68
- package/build/libarkts-copy/src/generated/peers/CharLiteral.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/ClassDeclaration.ts +0 -76
- package/build/libarkts-copy/src/generated/peers/ClassDefinition.ts +0 -365
- package/build/libarkts-copy/src/generated/peers/ClassElement.ts +0 -76
- package/build/libarkts-copy/src/generated/peers/ClassExpression.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/ClassProperty.ts +0 -137
- package/build/libarkts-copy/src/generated/peers/ClassStaticBlock.ts +0 -66
- package/build/libarkts-copy/src/generated/peers/CodeGen.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/ConditionalExpression.ts +0 -82
- package/build/libarkts-copy/src/generated/peers/ContinueStatement.ts +0 -78
- package/build/libarkts-copy/src/generated/peers/DebuggerStatement.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/Declaration.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/Decorator.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/DiagnosticInfo.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/DirectEvalExpression.ts +0 -60
- package/build/libarkts-copy/src/generated/peers/DoWhileStatement.ts +0 -66
- package/build/libarkts-copy/src/generated/peers/DynamicImportData.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/ETSClassLiteral.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/ETSFunctionType.ts +0 -102
- package/build/libarkts-copy/src/generated/peers/ETSImportDeclaration.ts +0 -90
- package/build/libarkts-copy/src/generated/peers/ETSIntrinsicNode.ts +0 -69
- package/build/libarkts-copy/src/generated/peers/ETSKeyofType.ts +0 -61
- package/build/libarkts-copy/src/generated/peers/ETSModule.ts +0 -129
- package/build/libarkts-copy/src/generated/peers/ETSNewArrayInstanceExpression.ts +0 -75
- package/build/libarkts-copy/src/generated/peers/ETSNewClassInstanceExpression.ts +0 -79
- package/build/libarkts-copy/src/generated/peers/ETSNewMultiDimArrayInstanceExpression.ts +0 -75
- package/build/libarkts-copy/src/generated/peers/ETSNullType.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/ETSPackageDeclaration.ts +0 -59
- package/build/libarkts-copy/src/generated/peers/ETSParameterExpression.ts +0 -189
- package/build/libarkts-copy/src/generated/peers/ETSPrimitiveType.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/ETSReExportDeclaration.ts +0 -55
- package/build/libarkts-copy/src/generated/peers/ETSStringLiteralType.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/ETSStructDeclaration.ts +0 -59
- package/build/libarkts-copy/src/generated/peers/ETSTuple.ts +0 -89
- package/build/libarkts-copy/src/generated/peers/ETSTypeReference.ts +0 -66
- package/build/libarkts-copy/src/generated/peers/ETSTypeReferencePart.ts +0 -78
- package/build/libarkts-copy/src/generated/peers/ETSUndefinedType.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/ETSUnionType.ts +0 -75
- package/build/libarkts-copy/src/generated/peers/ETSWildcardType.ts +0 -63
- package/build/libarkts-copy/src/generated/peers/EmptyStatement.ts +0 -66
- package/build/libarkts-copy/src/generated/peers/ErrorLogger.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/ExportAllDeclaration.ts +0 -66
- package/build/libarkts-copy/src/generated/peers/ExportDefaultDeclaration.ts +0 -64
- package/build/libarkts-copy/src/generated/peers/ExportNamedDeclaration.ts +0 -94
- package/build/libarkts-copy/src/generated/peers/ExportSpecifier.ts +0 -82
- package/build/libarkts-copy/src/generated/peers/Expression.ts +0 -84
- package/build/libarkts-copy/src/generated/peers/ExpressionStatement.ts +0 -67
- package/build/libarkts-copy/src/generated/peers/ForInStatement.ts +0 -69
- package/build/libarkts-copy/src/generated/peers/ForOfStatement.ts +0 -72
- package/build/libarkts-copy/src/generated/peers/ForUpdateStatement.ts +0 -67
- package/build/libarkts-copy/src/generated/peers/FunctionDeclaration.ts +0 -106
- package/build/libarkts-copy/src/generated/peers/FunctionExpression.ts +0 -74
- package/build/libarkts-copy/src/generated/peers/FunctionSignature.ts +0 -70
- package/build/libarkts-copy/src/generated/peers/IRNode.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/Identifier.ts +0 -162
- package/build/libarkts-copy/src/generated/peers/IfStatement.ts +0 -78
- package/build/libarkts-copy/src/generated/peers/ImportDeclaration.ts +0 -87
- package/build/libarkts-copy/src/generated/peers/ImportDefaultSpecifier.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/ImportExpression.ts +0 -61
- package/build/libarkts-copy/src/generated/peers/ImportNamespaceSpecifier.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/ImportSource.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/ImportSpecifier.ts +0 -73
- package/build/libarkts-copy/src/generated/peers/IndexInfo.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/LabelPair.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/LabelledStatement.ts +0 -68
- package/build/libarkts-copy/src/generated/peers/Literal.ts +0 -53
- package/build/libarkts-copy/src/generated/peers/LoopStatement.ts +0 -45
- package/build/libarkts-copy/src/generated/peers/MaybeOptionalExpression.ts +0 -53
- package/build/libarkts-copy/src/generated/peers/MemberExpression.ts +0 -115
- package/build/libarkts-copy/src/generated/peers/MetaProperty.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/MethodDefinition.ts +0 -152
- package/build/libarkts-copy/src/generated/peers/NamedType.ts +0 -84
- package/build/libarkts-copy/src/generated/peers/NewExpression.ts +0 -64
- package/build/libarkts-copy/src/generated/peers/NullLiteral.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/NumberLiteral.ts +0 -78
- package/build/libarkts-copy/src/generated/peers/ObjectDescriptor.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/ObjectExpression.ts +0 -94
- package/build/libarkts-copy/src/generated/peers/OmittedExpression.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/OpaqueTypeNode.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/OverloadDeclaration.ts +0 -101
- package/build/libarkts-copy/src/generated/peers/PrefixAssertionExpression.ts +0 -65
- package/build/libarkts-copy/src/generated/peers/Program.ts +0 -206
- package/build/libarkts-copy/src/generated/peers/Property.ts +0 -92
- package/build/libarkts-copy/src/generated/peers/RegExpLiteral.ts +0 -65
- package/build/libarkts-copy/src/generated/peers/ReturnStatement.ts +0 -75
- package/build/libarkts-copy/src/generated/peers/ScopeFindResult.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/ScriptFunction.ts +0 -310
- package/build/libarkts-copy/src/generated/peers/ScriptFunctionData.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/SequenceExpression.ts +0 -61
- package/build/libarkts-copy/src/generated/peers/SignatureInfo.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/SourcePosition.ts +0 -48
- package/build/libarkts-copy/src/generated/peers/SourceRange.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/SpreadElement.ts +0 -83
- package/build/libarkts-copy/src/generated/peers/SrcDumper.ts +0 -120
- package/build/libarkts-copy/src/generated/peers/Statement.ts +0 -44
- package/build/libarkts-copy/src/generated/peers/StringLiteral.ts +0 -66
- package/build/libarkts-copy/src/generated/peers/SuggestionInfo.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/SuperExpression.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/SwitchCaseStatement.ts +0 -70
- package/build/libarkts-copy/src/generated/peers/SwitchStatement.ts +0 -71
- package/build/libarkts-copy/src/generated/peers/TSAnyKeyword.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/TSArrayType.ts +0 -61
- package/build/libarkts-copy/src/generated/peers/TSAsExpression.ts +0 -84
- package/build/libarkts-copy/src/generated/peers/TSBigintKeyword.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/TSBooleanKeyword.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/TSClassImplements.ts +0 -70
- package/build/libarkts-copy/src/generated/peers/TSConditionalType.ts +0 -71
- package/build/libarkts-copy/src/generated/peers/TSConstructorType.ts +0 -73
- package/build/libarkts-copy/src/generated/peers/TSEnumDeclaration.ts +0 -112
- package/build/libarkts-copy/src/generated/peers/TSEnumMember.ts +0 -76
- package/build/libarkts-copy/src/generated/peers/TSExternalModuleReference.ts +0 -61
- package/build/libarkts-copy/src/generated/peers/TSFunctionType.ts +0 -75
- package/build/libarkts-copy/src/generated/peers/TSImportEqualsDeclaration.ts +0 -69
- package/build/libarkts-copy/src/generated/peers/TSImportType.ts +0 -72
- package/build/libarkts-copy/src/generated/peers/TSIndexSignature.ts +0 -73
- package/build/libarkts-copy/src/generated/peers/TSIndexedAccessType.ts +0 -64
- package/build/libarkts-copy/src/generated/peers/TSInferType.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/TSInterfaceBody.ts +0 -61
- package/build/libarkts-copy/src/generated/peers/TSInterfaceDeclaration.ts +0 -160
- package/build/libarkts-copy/src/generated/peers/TSInterfaceHeritage.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/TSIntersectionType.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/TSLiteralType.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/TSMappedType.ts +0 -72
- package/build/libarkts-copy/src/generated/peers/TSMethodSignature.ts +0 -79
- package/build/libarkts-copy/src/generated/peers/TSModuleBlock.ts +0 -61
- package/build/libarkts-copy/src/generated/peers/TSModuleDeclaration.ts +0 -71
- package/build/libarkts-copy/src/generated/peers/TSNamedTupleMember.ts +0 -68
- package/build/libarkts-copy/src/generated/peers/TSNeverKeyword.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/TSNonNullExpression.ts +0 -66
- package/build/libarkts-copy/src/generated/peers/TSNullKeyword.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/TSNumberKeyword.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/TSObjectKeyword.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/TSParameterProperty.ts +0 -74
- package/build/libarkts-copy/src/generated/peers/TSParenthesizedType.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/TSPropertySignature.ts +0 -80
- package/build/libarkts-copy/src/generated/peers/TSQualifiedName.ts +0 -71
- package/build/libarkts-copy/src/generated/peers/TSSignatureDeclaration.ts +0 -75
- package/build/libarkts-copy/src/generated/peers/TSStringKeyword.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/TSThisType.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/TSTupleType.ts +0 -61
- package/build/libarkts-copy/src/generated/peers/TSTypeAliasDeclaration.ts +0 -151
- package/build/libarkts-copy/src/generated/peers/TSTypeAssertion.ts +0 -71
- package/build/libarkts-copy/src/generated/peers/TSTypeLiteral.ts +0 -61
- package/build/libarkts-copy/src/generated/peers/TSTypeOperator.ts +0 -71
- package/build/libarkts-copy/src/generated/peers/TSTypeParameter.ts +0 -121
- package/build/libarkts-copy/src/generated/peers/TSTypeParameterDeclaration.ts +0 -75
- package/build/libarkts-copy/src/generated/peers/TSTypeParameterInstantiation.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/TSTypePredicate.ts +0 -68
- package/build/libarkts-copy/src/generated/peers/TSTypeQuery.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/TSTypeReference.ts +0 -70
- package/build/libarkts-copy/src/generated/peers/TSUndefinedKeyword.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/TSUnionType.ts +0 -61
- package/build/libarkts-copy/src/generated/peers/TSUnknownKeyword.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/TSVoidKeyword.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/TaggedTemplateExpression.ts +0 -69
- package/build/libarkts-copy/src/generated/peers/TemplateElement.ts +0 -69
- package/build/libarkts-copy/src/generated/peers/TemplateLiteral.ts +0 -68
- package/build/libarkts-copy/src/generated/peers/ThisExpression.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/ThrowStatement.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/TryStatement.ts +0 -89
- package/build/libarkts-copy/src/generated/peers/TypeNode.ts +0 -81
- package/build/libarkts-copy/src/generated/peers/TypedAstNode.ts +0 -44
- package/build/libarkts-copy/src/generated/peers/TypedStatement.ts +0 -45
- package/build/libarkts-copy/src/generated/peers/TypeofExpression.ts +0 -61
- package/build/libarkts-copy/src/generated/peers/UnaryExpression.ts +0 -70
- package/build/libarkts-copy/src/generated/peers/UndefinedLiteral.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/UpdateExpression.ts +0 -68
- package/build/libarkts-copy/src/generated/peers/VReg.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/ValidationInfo.ts +0 -50
- package/build/libarkts-copy/src/generated/peers/VariableDeclaration.ts +0 -113
- package/build/libarkts-copy/src/generated/peers/VariableDeclarator.ts +0 -79
- package/build/libarkts-copy/src/generated/peers/VerificationContext.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/VerifierMessage.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/WhileStatement.ts +0 -71
- package/build/libarkts-copy/src/generated/peers/YieldExpression.ts +0 -64
|
@@ -14,19 +14,19 @@
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
export function throwError(error: string): never {
|
|
17
|
-
throw new Error(error)
|
|
17
|
+
throw new Error(error);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export function withWarning<T>(value: T, message: string): T {
|
|
21
21
|
// console.warn(message)
|
|
22
|
-
return value
|
|
22
|
+
return value;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
export function isNumber(value:
|
|
26
|
-
return typeof value === `number
|
|
25
|
+
export function isNumber(value: unknown): value is number {
|
|
26
|
+
return typeof value === `number`;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
function replacePercentOutsideStrings(code: string): string
|
|
29
|
+
function replacePercentOutsideStrings(code: string): string {
|
|
30
30
|
const stringPattern = /("[^"]*"|'[^']*'|`[^`]*`)/g;
|
|
31
31
|
const percentPattern = /(?<!["'`])(%)(?![\d\s])/g;
|
|
32
32
|
const strings = code.match(stringPattern) || [];
|
|
@@ -70,127 +70,154 @@ function replaceIllegalHashes(code: string): string {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
function replaceGensymWrappers(code: string): string {
|
|
73
|
-
const indices = [...code.matchAll(/\({let/g)].map(it => it.index)
|
|
74
|
-
const replacements: string[][] = []
|
|
75
|
-
for (
|
|
73
|
+
const indices = [...code.matchAll(/\({let/g)].map((it) => it.index);
|
|
74
|
+
const replacements: string[][] = [];
|
|
75
|
+
for (let i of indices) {
|
|
76
76
|
if (!i) {
|
|
77
|
-
continue
|
|
77
|
+
continue;
|
|
78
78
|
}
|
|
79
|
-
|
|
79
|
+
let j: number = i + 1,
|
|
80
|
+
depth = 1;
|
|
80
81
|
while (j < code.length) {
|
|
81
82
|
if (code[j] == '(') {
|
|
82
|
-
depth
|
|
83
|
+
depth++;
|
|
83
84
|
}
|
|
84
85
|
if (code[j] == ')') {
|
|
85
|
-
depth
|
|
86
|
+
depth--;
|
|
86
87
|
}
|
|
87
88
|
if (depth == 0) {
|
|
88
|
-
break
|
|
89
|
+
break;
|
|
89
90
|
}
|
|
90
|
-
j
|
|
91
|
+
j++;
|
|
91
92
|
}
|
|
92
93
|
|
|
93
|
-
if (j
|
|
94
|
-
continue
|
|
94
|
+
if (j === code.length) {
|
|
95
|
+
continue;
|
|
95
96
|
}
|
|
96
97
|
|
|
97
|
-
const base = code.substring(i, j + 1)
|
|
98
|
-
if (base.match(/\({let/)?.length! > 1) {
|
|
99
|
-
|
|
98
|
+
const base = code.substring(i, j + 1);
|
|
99
|
+
if (base.match(/\({let/)?.length! > 1) {
|
|
100
|
+
// don't touch if contains nested constructions
|
|
101
|
+
continue;
|
|
100
102
|
}
|
|
101
|
-
const fixed = base.replaceAll(
|
|
103
|
+
const fixed = base.replaceAll(
|
|
104
|
+
/^\({let ([_%a-zA-Z0-9]+?) = (?!\({let)([\s\S]*?);\n([\s\S]*?)}\)$/g,
|
|
102
105
|
(match, name: string, val: string, expr: string) => {
|
|
103
|
-
let rightExpr = expr.slice(expr.lastIndexOf(name) + name.length, -1)
|
|
104
|
-
if (rightExpr[0]
|
|
105
|
-
rightExpr = `.${rightExpr}
|
|
106
|
+
let rightExpr = expr.slice(expr.lastIndexOf(name) + name.length, -1);
|
|
107
|
+
if (rightExpr[0] !== '.') {
|
|
108
|
+
rightExpr = `.${rightExpr}`;
|
|
106
109
|
}
|
|
107
|
-
return `(${val}?${rightExpr})
|
|
110
|
+
return `(${val}?${rightExpr})`;
|
|
108
111
|
}
|
|
109
|
-
)
|
|
110
|
-
replacements.push([base, fixed])
|
|
112
|
+
);
|
|
113
|
+
replacements.push([base, fixed]);
|
|
111
114
|
}
|
|
112
|
-
for (
|
|
113
|
-
code = code.replace(b, f)
|
|
115
|
+
for (let [b, f] of replacements) {
|
|
116
|
+
code = code.replace(b, f);
|
|
114
117
|
}
|
|
115
|
-
return code
|
|
118
|
+
return code;
|
|
116
119
|
}
|
|
117
120
|
|
|
118
121
|
function addExports(code: string): string {
|
|
119
|
-
const exportAstNodes = [
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
const exportAstNodes = [
|
|
123
|
+
' enum',
|
|
124
|
+
'let',
|
|
125
|
+
'const',
|
|
126
|
+
'class',
|
|
127
|
+
'abstract class',
|
|
128
|
+
'@Entry() @Component() final class',
|
|
129
|
+
'@Component() final class',
|
|
130
|
+
'interface',
|
|
131
|
+
'@interface',
|
|
132
|
+
'type',
|
|
133
|
+
'enum',
|
|
134
|
+
'final class',
|
|
135
|
+
'function',
|
|
136
|
+
'declare interface',
|
|
137
|
+
'@memo_stable() declare interface',
|
|
138
|
+
'@memo_stable() interface',
|
|
139
|
+
'@Retention({policy:"SOURCE"}) @interface',
|
|
140
|
+
'@memo() function',
|
|
141
|
+
'@memo_entry() function',
|
|
142
|
+
'@memo_intrinsic() function',
|
|
143
|
+
];
|
|
123
144
|
exportAstNodes.forEach((astNodeText) => {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
)
|
|
145
|
+
code = code.replaceAll(`\n${astNodeText}`, `\nexport ${astNodeText}`);
|
|
146
|
+
});
|
|
127
147
|
// Improve: this is a temporary workaround and should be replaced with a proper import/export handling in future
|
|
128
|
-
code = code.replaceAll(/\n(@memo\(\) @BuilderLambda\(\{value:"\w+"\}\)) function/g, '\n$1 export function')
|
|
148
|
+
code = code.replaceAll(/\n(@memo\(\) @BuilderLambda\(\{value:"\w+"\}\)) function/g, '\n$1 export function');
|
|
129
149
|
const fix = [
|
|
130
|
-
[
|
|
131
|
-
[
|
|
132
|
-
[
|
|
133
|
-
[
|
|
134
|
-
[
|
|
135
|
-
]
|
|
136
|
-
for (
|
|
137
|
-
code = code.replaceAll(f, t)
|
|
150
|
+
['export @memo() function', '@memo() export function'],
|
|
151
|
+
['export @memo_entry() function', '@memo_entry() export function'],
|
|
152
|
+
['export @memo_intrinsic() function', '@memo_intrinsic() export function'],
|
|
153
|
+
['export @memo_stable()', '@memo_stable() export'],
|
|
154
|
+
['export class OhosRouter', 'export default class OhosRouter'],
|
|
155
|
+
];
|
|
156
|
+
for (let [f, t] of fix) {
|
|
157
|
+
code = code.replaceAll(f, t);
|
|
138
158
|
}
|
|
139
|
-
return code.replaceAll(
|
|
159
|
+
return code.replaceAll('\nexport function main()', '\nfunction main()');
|
|
140
160
|
}
|
|
141
161
|
|
|
142
162
|
function excludePartialInterfaces(code: string): string {
|
|
143
163
|
return code
|
|
144
|
-
|
|
145
|
-
|
|
164
|
+
.replaceAll(/export interface (.*)\$partial<>([\s\S]*?)}/g, '')
|
|
165
|
+
.replaceAll(/interface (.*)\$partial<>([\s\S]*?)}/g, '');
|
|
146
166
|
}
|
|
147
167
|
|
|
148
168
|
function fixEnums(code: string) {
|
|
149
|
-
const lines = code.split('\n')
|
|
150
|
-
const enums = []
|
|
169
|
+
const lines = code.split('\n');
|
|
170
|
+
const enums = [];
|
|
151
171
|
for (let i = 0; i + 1 < lines.length; i++) {
|
|
152
|
-
if (
|
|
153
|
-
|
|
172
|
+
if (
|
|
173
|
+
lines[i].trimStart().startsWith(`export final class`) &&
|
|
174
|
+
lines[i + 1].trimStart().startsWith(`private readonly _ordinal`)
|
|
154
175
|
) {
|
|
155
|
-
const name = lines[i].split(' ')[3]
|
|
156
|
-
enums.push(name)
|
|
176
|
+
const name = lines[i].split(' ')[3];
|
|
177
|
+
enums.push(name);
|
|
157
178
|
}
|
|
158
179
|
}
|
|
159
180
|
enums.forEach((name) => {
|
|
160
|
-
const regexp = new RegExp(`${name}\\.(\\w+)(.)`, `g`)
|
|
161
|
-
code = code.replaceAll(regexp, (match, p1, p2) => {
|
|
162
|
-
if (!p1.startsWith('_') && p2
|
|
163
|
-
|
|
181
|
+
const regexp = new RegExp(`${name}\\.(\\w+)(.)`, `g`);
|
|
182
|
+
code = code.replaceAll(regexp, (match: string, p1: string, p2: string) => {
|
|
183
|
+
if (!p1.startsWith('_') && p2 === ':') {
|
|
184
|
+
// this colon is for switch case, not for type
|
|
185
|
+
return `${name}.${p1}.valueOf()${p2}`;
|
|
164
186
|
}
|
|
165
|
-
return match
|
|
166
|
-
})
|
|
167
|
-
const idents = [...code.matchAll(new RegExp(`(\\w+?)([\\W])(\\w+?): ${name}`, `g`))]
|
|
187
|
+
return match;
|
|
188
|
+
});
|
|
189
|
+
const idents = [...code.matchAll(new RegExp(`(\\w+?)([\\W])(\\w+?): ${name}`, `g`))]
|
|
190
|
+
.filter((it) => it[1] !== 'readonly' && it[1] !== '_get')
|
|
191
|
+
.map((it) => it[3]);
|
|
168
192
|
// work manually with a couple of cases not to write one more bracket parser
|
|
169
193
|
if (code.includes(`const eventKind = (deserializer.readInt32() as CallbackEventKind);`)) {
|
|
170
194
|
// this is for file arkui/src/generated/peers/CallbacksChecker.ts
|
|
171
|
-
idents.push(`eventKind`)
|
|
172
|
-
code = code.replace(
|
|
195
|
+
idents.push(`eventKind`);
|
|
196
|
+
code = code.replace(
|
|
197
|
+
`const eventKind = (deserializer.readInt32() as CallbackEventKind);`,
|
|
198
|
+
`const eventKind = CallbackEventKind.fromValue(deserializer.readInt32());`
|
|
199
|
+
);
|
|
173
200
|
}
|
|
174
201
|
if (code.includes(`switch ((type as EventType))`)) {
|
|
175
202
|
// this is for file arkui/src/Application.ts
|
|
176
|
-
code = code.replace(`switch ((type as EventType))`, `switch (type)`)
|
|
203
|
+
code = code.replace(`switch ((type as EventType))`, `switch (type)`);
|
|
177
204
|
}
|
|
178
205
|
idents.forEach((id) => {
|
|
179
|
-
code = code.replaceAll(`${id} as int32`, `${id}.valueOf()`)
|
|
180
|
-
code = code.replaceAll(`switch (${id})`, `switch (${id}.valueOf())`)
|
|
181
|
-
})
|
|
182
|
-
})
|
|
183
|
-
return code
|
|
206
|
+
code = code.replaceAll(`${id} as int32`, `${id}.valueOf()`);
|
|
207
|
+
code = code.replaceAll(`switch (${id})`, `switch (${id}.valueOf())`);
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
return code;
|
|
184
211
|
}
|
|
185
212
|
|
|
186
213
|
function fixEmptyDeclareNamespace(code: string): string {
|
|
187
|
-
const lines = code.split('\n')
|
|
214
|
+
const lines = code.split('\n');
|
|
188
215
|
for (let i = 0; i < lines.length; i++) {
|
|
189
216
|
if (lines[i].startsWith('export declare namespace') && !lines[i].endsWith('{')) {
|
|
190
|
-
lines[i] += ' {}'
|
|
217
|
+
lines[i] += ' {}';
|
|
191
218
|
}
|
|
192
219
|
}
|
|
193
|
-
return lines.join('\n')
|
|
220
|
+
return lines.join('\n');
|
|
194
221
|
}
|
|
195
222
|
|
|
196
223
|
/*
|
|
@@ -211,14 +238,10 @@ export function filterSource(text: string): string {
|
|
|
211
238
|
replaceIllegalHashes,
|
|
212
239
|
replacePercentOutsideStrings,
|
|
213
240
|
excludePartialInterfaces,
|
|
214
|
-
(code: string) => code.replaceAll(
|
|
215
|
-
(code: string) => code.replaceAll(
|
|
216
|
-
]
|
|
241
|
+
(code: string) => code.replaceAll('<cctor>', '_cctor_'),
|
|
242
|
+
(code: string) => code.replaceAll('public constructor() {}', ''),
|
|
243
|
+
];
|
|
217
244
|
// console.error("====")
|
|
218
245
|
// console.error(dumperUnwrappers.reduceRight((code, f) => f(code), text).split('\n').map((it, index) => `${`${index + 1}`.padStart(4)} |${it}`).join('\n'))
|
|
219
|
-
return dumperUnwrappers.reduceRight((code, f) => f(code), text)
|
|
246
|
+
return dumperUnwrappers.reduceRight((code, f) => f(code), text);
|
|
220
247
|
}
|
|
221
|
-
|
|
222
|
-
export function getEnumName(enumType: any, value: number): string | undefined {
|
|
223
|
-
return enumType[value];
|
|
224
|
-
}
|
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"outDir": "build",
|
|
5
5
|
"baseUrl": ".",
|
|
6
|
-
"rootDir": "
|
|
6
|
+
"rootDir": ".",
|
|
7
7
|
"module": "esnext",
|
|
8
8
|
"tsBuildInfoFile": "./build/tsconfig.tsbuildinfo"
|
|
9
9
|
},
|
|
10
10
|
"include": [
|
|
11
|
-
"./src/**/*.ts"
|
|
11
|
+
"./src/**/*.ts",
|
|
12
|
+
"./generated/**/*.ts"
|
|
12
13
|
],
|
|
13
14
|
"exclude": [
|
|
14
15
|
"./src/ts-api/**/*.ts"
|