@idlizer/arktscgen 2.1.10-arktscgen-4 → 2.1.10-arktscgen-5
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/native/meson.build +1 -1
- package/build/libarkts-copy/native/src/bridges.cc +72 -115
- package/build/libarkts-copy/native/src/common.cc +225 -84
- package/build/libarkts-copy/native/src/common.h +22 -22
- package/build/libarkts-copy/native/src/memoryTracker.cc +30 -37
- package/build/libarkts-copy/native/src/memoryTracker.h +5 -5
- package/build/libarkts-copy/package.json +21 -17
- package/build/libarkts-copy/src/Es2pandaNativeModule.ts +176 -100
- package/build/libarkts-copy/src/InteropNativeModule.ts +18 -15
- package/build/libarkts-copy/src/arkts-api/AbstractVisitor.ts +17 -18
- package/build/libarkts-copy/src/arkts-api/ImportStorage.ts +31 -30
- package/build/libarkts-copy/src/arkts-api/ProgramProvider.ts +20 -17
- package/build/libarkts-copy/src/arkts-api/class-by-peer.ts +12 -12
- package/build/libarkts-copy/src/arkts-api/factory/nodeFactory.ts +38 -29
- package/build/libarkts-copy/src/arkts-api/index.ts +24 -24
- package/build/libarkts-copy/src/arkts-api/node-cache.ts +12 -12
- 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 -49
- package/build/libarkts-copy/src/arkts-api/peers/Config.ts +17 -24
- package/build/libarkts-copy/src/arkts-api/peers/Context.ts +29 -37
- package/build/libarkts-copy/src/arkts-api/peers/DiagnosticKind.ts +5 -6
- 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 +98 -30
- 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 +39 -23
- package/build/libarkts-copy/src/arkts-api/utilities/private.ts +73 -61
- package/build/libarkts-copy/src/arkts-api/utilities/public.ts +220 -173
- package/build/libarkts-copy/src/arkts-api/visitor.ts +606 -742
- 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/plugin-utils.ts +52 -40
- package/build/libarkts-copy/src/reexport-for-generated.ts +11 -10
- package/build/libarkts-copy/src/tracer.ts +75 -69
- 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 +115 -112
- 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 +97 -70
- package/build/libarkts-copy/tsconfig.json +3 -2
- package/lib/index.js +172 -77
- package/package.json +51 -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/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
|
@@ -17,37 +17,40 @@ import {
|
|
|
17
17
|
KNativePointer as KPtr,
|
|
18
18
|
KInt,
|
|
19
19
|
registerNativeModuleLibraryName,
|
|
20
|
-
loadNativeModuleLibrary
|
|
21
|
-
} from
|
|
22
|
-
import { findNativeModule } from
|
|
20
|
+
loadNativeModuleLibrary,
|
|
21
|
+
} from '@koalaui/interop';
|
|
22
|
+
import { findNativeModule } from './Es2pandaNativeModule';
|
|
23
23
|
|
|
24
24
|
export class InteropNativeModule {
|
|
25
25
|
_StringLength(ptr: KPtr): KInt {
|
|
26
|
-
throw new Error(
|
|
26
|
+
throw new Error('Not implemented');
|
|
27
27
|
}
|
|
28
28
|
_StringData(ptr: KPtr, buffer: KPtr, length: KInt): void {
|
|
29
|
-
throw new Error(
|
|
29
|
+
throw new Error('Not implemented');
|
|
30
30
|
}
|
|
31
31
|
_GetStringFinalizer(): KPtr {
|
|
32
|
-
throw new Error(
|
|
32
|
+
throw new Error('Not implemented');
|
|
33
33
|
}
|
|
34
|
-
_RawUtf8ToString(ptr: KPtr): string
|
|
35
|
-
throw new Error(
|
|
34
|
+
_RawUtf8ToString(ptr: KPtr): string {
|
|
35
|
+
throw new Error('Not implemented');
|
|
36
36
|
}
|
|
37
37
|
_InvokeFinalizer(ptr: KPtr, finalizer: KPtr): void {
|
|
38
|
-
throw new Error(
|
|
38
|
+
throw new Error('Not implemented');
|
|
39
|
+
}
|
|
40
|
+
_GetPtrVector(ptr: KPtr): BigUint64Array {
|
|
41
|
+
throw new Error('Not implemented');
|
|
39
42
|
}
|
|
40
43
|
_GetPtrVectorSize(ptr: KPtr): KInt {
|
|
41
|
-
throw new Error(
|
|
44
|
+
throw new Error('Not implemented');
|
|
42
45
|
}
|
|
43
46
|
_GetPtrVectorElement(ptr: KPtr, index: KInt): KPtr {
|
|
44
|
-
throw new Error(
|
|
47
|
+
throw new Error('Not implemented');
|
|
45
48
|
}
|
|
46
49
|
}
|
|
47
50
|
|
|
48
51
|
export function initInterop(): InteropNativeModule {
|
|
49
|
-
registerNativeModuleLibraryName(
|
|
50
|
-
const instance = new InteropNativeModule()
|
|
51
|
-
loadNativeModuleLibrary(
|
|
52
|
-
return instance
|
|
52
|
+
registerNativeModuleLibraryName('InteropNativeModule', findNativeModule());
|
|
53
|
+
const instance = new InteropNativeModule();
|
|
54
|
+
loadNativeModuleLibrary('InteropNativeModule', instance);
|
|
55
|
+
return instance;
|
|
53
56
|
}
|
|
@@ -13,38 +13,37 @@
|
|
|
13
13
|
* limitations under the License.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import { AstNode } from
|
|
17
|
-
import { visitEachChild } from
|
|
18
|
-
import { Program } from
|
|
16
|
+
import { AstNode } from './peers/AstNode';
|
|
17
|
+
import { visitEachChild } from './visitor';
|
|
18
|
+
import { Program } from '../../generated';
|
|
19
19
|
|
|
20
20
|
export interface VisitorOptions {
|
|
21
|
-
program?: Program
|
|
21
|
+
program?: Program;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export abstract class AbstractVisitor {
|
|
25
|
-
public program?: Program
|
|
25
|
+
public program?: Program;
|
|
26
26
|
|
|
27
27
|
constructor(options?: VisitorOptions) {
|
|
28
28
|
this.program = options?.program;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
indentation = 0
|
|
31
|
+
indentation = 0;
|
|
32
32
|
|
|
33
|
-
withIndentation<T>(exec: () => T) {
|
|
34
|
-
this.indentation
|
|
35
|
-
const result = exec()
|
|
36
|
-
this.indentation
|
|
37
|
-
return result
|
|
33
|
+
withIndentation<T>(exec: () => T): T {
|
|
34
|
+
this.indentation++;
|
|
35
|
+
const result = exec();
|
|
36
|
+
this.indentation--;
|
|
37
|
+
return result;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
process(node: AstNode, options?: object): AstNode {
|
|
41
|
+
return this.visitor(node, options);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
abstract visitor(node: AstNode, options?: object): AstNode;
|
|
41
45
|
|
|
42
46
|
visitEachChild(node: AstNode, options?: object): AstNode {
|
|
43
|
-
return this.withIndentation(() =>
|
|
44
|
-
visitEachChild(
|
|
45
|
-
node,
|
|
46
|
-
it => this.visitor(it, options)
|
|
47
|
-
)
|
|
48
|
-
)
|
|
47
|
+
return this.withIndentation((): AstNode => visitEachChild(node, (it): AstNode => this.visitor(it, options)));
|
|
49
48
|
}
|
|
50
49
|
}
|
|
@@ -13,41 +13,44 @@
|
|
|
13
13
|
* limitations under the License.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import { KNativePointer } from
|
|
17
|
-
import { ETSModule, ImportDeclaration, isETSImportDeclaration, Program, Statement } from
|
|
18
|
-
import { passNode, passNodeArray, unpackNonNullableNode } from
|
|
19
|
-
import { global } from
|
|
20
|
-
import { Es2pandaImportFlags, Es2pandaImportKinds } from
|
|
21
|
-
import { factory } from
|
|
16
|
+
import { KNativePointer } from '@koalaui/interop';
|
|
17
|
+
import { ETSModule, ImportDeclaration, isETSImportDeclaration, Program, Statement } from '../../generated';
|
|
18
|
+
import { passNode, passNodeArray, unpackNonNullableNode } from './utilities/private';
|
|
19
|
+
import { global } from './static/global';
|
|
20
|
+
import { Es2pandaImportFlags, Es2pandaImportKinds } from '../../generated/Es2pandaEnums';
|
|
21
|
+
import { factory } from './factory/nodeFactory';
|
|
22
22
|
|
|
23
23
|
export class ImportStorage {
|
|
24
24
|
// Improve: migrate to wrappers instead of pointers
|
|
25
|
-
private imports: Set<KNativePointer> = new Set<KNativePointer>()
|
|
26
|
-
private importSources: Set<string | undefined> = new Set<string | undefined>()
|
|
25
|
+
private imports: Set<KNativePointer> = new Set<KNativePointer>();
|
|
26
|
+
private importSources: Set<string | undefined> = new Set<string | undefined>();
|
|
27
27
|
|
|
28
|
-
constructor(
|
|
28
|
+
constructor(
|
|
29
|
+
private program: Program,
|
|
30
|
+
private isParserState: boolean
|
|
31
|
+
) {
|
|
29
32
|
for (const statement of program.ast.statements) {
|
|
30
33
|
if (isETSImportDeclaration(statement)) {
|
|
31
|
-
this.imports.add(statement.peer)
|
|
34
|
+
this.imports.add(statement.peer);
|
|
32
35
|
if (!isParserState) {
|
|
33
36
|
// Improve: is source non nullable?
|
|
34
|
-
this.importSources.add(statement.source?.str)
|
|
37
|
+
this.importSources.add(statement.source?.str);
|
|
35
38
|
}
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
41
|
}
|
|
39
42
|
|
|
40
|
-
update() {
|
|
43
|
+
update(): void {
|
|
41
44
|
// Save current statements
|
|
42
|
-
const statements = this.program.ast.statements
|
|
45
|
+
const statements = this.program.ast.statements;
|
|
43
46
|
|
|
44
47
|
// Update parser information
|
|
45
|
-
const newStatements: Statement[] = []
|
|
48
|
+
const newStatements: Statement[] = [];
|
|
46
49
|
for (const statement of statements) {
|
|
47
50
|
if (isETSImportDeclaration(statement) && !this.imports.has(statement.peer)) {
|
|
48
51
|
if (!this.isParserState && !this.importSources.has(statement.source?.str)) {
|
|
49
|
-
console.warn(
|
|
50
|
-
console.warn(statement.dumpSrc())
|
|
52
|
+
console.warn('Attempt to insert import from new source after parsed state:');
|
|
53
|
+
console.warn(statement.dumpSrc());
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
const importDeclaration = unpackNonNullableNode<ImportDeclaration>(
|
|
@@ -59,26 +62,24 @@ export class ImportStorage {
|
|
|
59
62
|
statement.specifiers.length,
|
|
60
63
|
passNode(statement.source),
|
|
61
64
|
this.program.peer,
|
|
62
|
-
Es2pandaImportFlags.IMPORT_FLAGS_NONE
|
|
65
|
+
Es2pandaImportFlags.IMPORT_FLAGS_NONE // Improve: where to get it?
|
|
63
66
|
)
|
|
64
|
-
)
|
|
65
|
-
global.generatedEs2panda._InsertETSImportDeclarationAndParse(
|
|
66
|
-
|
|
67
|
+
);
|
|
68
|
+
global.generatedEs2panda._InsertETSImportDeclarationAndParse(
|
|
69
|
+
global.context,
|
|
70
|
+
this.program.peer,
|
|
71
|
+
importDeclaration.peer
|
|
72
|
+
);
|
|
73
|
+
newStatements.push(importDeclaration);
|
|
67
74
|
} else {
|
|
68
|
-
newStatements.push(statement)
|
|
75
|
+
newStatements.push(statement);
|
|
69
76
|
}
|
|
70
77
|
}
|
|
71
78
|
|
|
72
79
|
// Drop import statements generated by compiler in the beginning of the ETSModule
|
|
73
|
-
const module = this.program.ast as ETSModule
|
|
80
|
+
const module = this.program.ast as ETSModule;
|
|
74
81
|
this.program.setAst(
|
|
75
|
-
factory.updateETSModule(
|
|
76
|
-
|
|
77
|
-
newStatements,
|
|
78
|
-
module.ident,
|
|
79
|
-
module.getNamespaceFlag(),
|
|
80
|
-
module.program,
|
|
81
|
-
)
|
|
82
|
-
)
|
|
82
|
+
factory.updateETSModule(module, newStatements, module.ident, module.getNamespaceFlag(), module.program)
|
|
83
|
+
);
|
|
83
84
|
}
|
|
84
85
|
}
|
|
@@ -13,38 +13,41 @@
|
|
|
13
13
|
* limitations under the License.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import { KNativePointer } from
|
|
17
|
-
import { defaultFilter, listPrograms } from
|
|
18
|
-
import { Program } from
|
|
16
|
+
import { KNativePointer } from '@koalaui/interop';
|
|
17
|
+
import { defaultFilter, listPrograms } from './plugins';
|
|
18
|
+
import { Program } from '../../generated';
|
|
19
19
|
|
|
20
20
|
export class ProgramProvider {
|
|
21
21
|
// Improve: migrate to wrappers instead of pointers
|
|
22
|
-
seenPrograms: Set<KNativePointer> = new Set<KNativePointer>()
|
|
23
|
-
queue: Program[] = []
|
|
22
|
+
seenPrograms: Set<KNativePointer> = new Set<KNativePointer>();
|
|
23
|
+
queue: Program[] = [];
|
|
24
24
|
|
|
25
|
-
constructor(
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
constructor(
|
|
26
|
+
private mainProgram: Program,
|
|
27
|
+
private readonly filter: (name: string) => boolean = defaultFilter
|
|
28
|
+
) {
|
|
29
|
+
this.seenPrograms.add(mainProgram.peer);
|
|
30
|
+
this.queue = [mainProgram];
|
|
28
31
|
}
|
|
29
32
|
|
|
30
|
-
updateQueue() {
|
|
31
|
-
const listed = listPrograms(this.mainProgram, this.filter)
|
|
33
|
+
updateQueue(): void {
|
|
34
|
+
const listed = listPrograms(this.mainProgram, this.filter);
|
|
32
35
|
for (const program of listed) {
|
|
33
36
|
if (!this.seenPrograms.has(program.peer)) {
|
|
34
|
-
this.seenPrograms.add(program.peer)
|
|
35
|
-
this.queue.push(program)
|
|
37
|
+
this.seenPrograms.add(program.peer);
|
|
38
|
+
this.queue.push(program);
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
next(): Program | undefined {
|
|
41
|
-
if (this.queue.length
|
|
42
|
-
this.updateQueue()
|
|
43
|
-
if (this.queue.length
|
|
44
|
+
if (this.queue.length === 0) {
|
|
45
|
+
this.updateQueue();
|
|
46
|
+
if (this.queue.length === 0) {
|
|
44
47
|
// console.log("PROGRAMS:", this.seenPrograms.size)
|
|
45
|
-
return undefined
|
|
48
|
+
return undefined;
|
|
46
49
|
}
|
|
47
50
|
}
|
|
48
|
-
return this.queue.shift()
|
|
51
|
+
return this.queue.shift();
|
|
49
52
|
}
|
|
50
53
|
}
|
|
@@ -13,21 +13,21 @@
|
|
|
13
13
|
* limitations under the License.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import { Es2pandaAstNodeType } from
|
|
17
|
-
import { throwError } from
|
|
18
|
-
import { global } from
|
|
19
|
-
import { KNativePointer } from
|
|
20
|
-
import { AstNode } from
|
|
21
|
-
import { NodeCache } from
|
|
16
|
+
import { Es2pandaAstNodeType } from '../../generated/Es2pandaEnums';
|
|
17
|
+
import { throwError } from '../utils';
|
|
18
|
+
import { global } from './static/global';
|
|
19
|
+
import { KNativePointer } from '@koalaui/interop';
|
|
20
|
+
import { AstNode } from './peers/AstNode';
|
|
21
|
+
import { NodeCache } from './node-cache';
|
|
22
22
|
|
|
23
|
-
export const nodeByType = new Map<Es2pandaAstNodeType, (peer: KNativePointer) => AstNode>([])
|
|
23
|
+
export const nodeByType = new Map<Es2pandaAstNodeType, (peer: KNativePointer) => AstNode>([]);
|
|
24
24
|
|
|
25
25
|
export function nodeFrom<T extends AstNode>(peer: KNativePointer, typeHint?: Es2pandaAstNodeType): T {
|
|
26
|
-
const fromCache = NodeCache.get<T>(peer)
|
|
26
|
+
const fromCache = NodeCache.get<T>(peer);
|
|
27
27
|
if (fromCache) {
|
|
28
|
-
return fromCache
|
|
28
|
+
return fromCache;
|
|
29
29
|
}
|
|
30
|
-
const type = typeHint ?? global.generatedEs2panda._AstNodeTypeConst(global.context, peer)
|
|
31
|
-
const create = nodeByType.get(type) ?? throwError(`unknown node type: ${type}`)
|
|
32
|
-
return create(peer) as T
|
|
30
|
+
const type = typeHint ?? global.generatedEs2panda._AstNodeTypeConst(global.context, peer);
|
|
31
|
+
const create = nodeByType.get(type) ?? throwError(`unknown node type: ${type}`);
|
|
32
|
+
return create(peer) as T;
|
|
33
33
|
}
|
|
@@ -24,41 +24,49 @@ import {
|
|
|
24
24
|
ETSStructDeclaration,
|
|
25
25
|
ETSTuple,
|
|
26
26
|
ETSTypeReferencePart,
|
|
27
|
+
Identifier,
|
|
27
28
|
MemberExpression,
|
|
28
29
|
ObjectExpression,
|
|
29
30
|
TryStatement,
|
|
30
31
|
TSTypeParameter,
|
|
31
32
|
VariableDeclarator,
|
|
32
|
-
} from
|
|
33
|
-
import { factory as generatedFactory } from
|
|
34
|
-
import {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
33
|
+
} from '../../../generated';
|
|
34
|
+
import { factory as generatedFactory } from '../../../generated/factory';
|
|
35
|
+
import {
|
|
36
|
+
createScriptFunction,
|
|
37
|
+
inplaceUpdateScriptFunction,
|
|
38
|
+
updateScriptFunction,
|
|
39
|
+
} from '../node-utilities/ScriptFunction';
|
|
40
|
+
import { inplaceUpdateCallExpression, updateCallExpression } from '../node-utilities/CallExpression';
|
|
41
|
+
import { createNumberLiteral, updateNumberLiteral } from '../node-utilities/NumberLiteral';
|
|
42
|
+
import { updateMemberExpression } from '../node-utilities/MemberExpression';
|
|
43
|
+
import { createETSParameterExpression, updateETSParameterExpression } from '../node-utilities/ETSParameterExpression';
|
|
44
|
+
import { updateTSTypeParameter } from '../node-utilities/TSTypeParameter';
|
|
45
|
+
import { updateETSTypeReferencePart } from '../node-utilities/TSTypeReferencePart';
|
|
46
|
+
import { updateETSImportDeclaration } from '../node-utilities/ETSImportDeclaration';
|
|
47
|
+
import { updateVariableDeclarator } from '../node-utilities/VariableDeclarator';
|
|
48
|
+
import { createClassDefinition, updateClassDefinition } from '../node-utilities/ClassDefinition';
|
|
49
|
+
import { updateETSStructDeclaration } from '../node-utilities/ETSStructDeclaration';
|
|
50
|
+
import { updateClassProperty } from '../node-utilities/ClassProperty';
|
|
51
|
+
import { createETSFunctionType, updateETSFunctionType } from '../node-utilities/ETSFunctionType';
|
|
52
|
+
import { createMethodDefinition, updateMethodDefinition } from '../node-utilities/MethodDefinition';
|
|
53
|
+
import { createTSInterfaceDeclaration, updateTSInterfaceDeclaration } from '../node-utilities/TSInterfaceDeclaration';
|
|
54
|
+
import { updateTryStatement } from '../node-utilities/TryStatement';
|
|
55
|
+
import { createAssignmentExpression, updateAssignmentExpression } from '../node-utilities/AssignmentExpression';
|
|
56
|
+
import { createObjectExpression, updateObjectExpression } from '../node-utilities/ObjectExpression';
|
|
57
|
+
import { updateETSTuple } from '../node-utilities/ETSTuple';
|
|
58
|
+
import { createArrayExpression, updateArrayExpression } from '../node-utilities/ArrayExpression';
|
|
59
|
+
import { updateBlockStatement } from '../node-utilities/BlockStatement';
|
|
60
|
+
import { updateETSModule } from '../node-utilities/ETSModule';
|
|
61
|
+
import { createOpaqueTypeNode } from '../node-utilities/OpaqueTypeNode';
|
|
57
62
|
|
|
58
63
|
export const factory = {
|
|
59
64
|
...generatedFactory,
|
|
60
65
|
|
|
61
|
-
|
|
66
|
+
createIdentifier: Identifier.create2Identifier,
|
|
67
|
+
updateIdentifier: Identifier.update2Identifier,
|
|
68
|
+
|
|
69
|
+
createETSModule: ETSModule.create1ETSModule,
|
|
62
70
|
updateETSModule,
|
|
63
71
|
|
|
64
72
|
createCallExpression: CallExpression.createCallExpression,
|
|
@@ -93,8 +101,9 @@ export const factory = {
|
|
|
93
101
|
createETSStructDeclaration: ETSStructDeclaration.createETSStructDeclaration,
|
|
94
102
|
updateETSStructDeclaration,
|
|
95
103
|
|
|
96
|
-
createClassDefinition
|
|
104
|
+
createClassDefinition,
|
|
97
105
|
updateClassDefinition,
|
|
106
|
+
update3ClassDefinition: ClassDefinition.update3ClassDefinition,
|
|
98
107
|
|
|
99
108
|
createClassProperty: ClassProperty.createClassProperty,
|
|
100
109
|
updateClassProperty,
|
|
@@ -126,10 +135,10 @@ export const factory = {
|
|
|
126
135
|
createBlockStatement: BlockStatement.createBlockStatement,
|
|
127
136
|
updateBlockStatement,
|
|
128
137
|
|
|
129
|
-
updateInterfaceBody
|
|
138
|
+
updateInterfaceBody: generatedFactory.updateTSInterfaceBody,
|
|
130
139
|
|
|
131
140
|
createClassStaticBlock: ClassStaticBlock.createClassStaticBlock,
|
|
132
141
|
updateClassStaticBlock: ClassStaticBlock.updateClassStaticBlock,
|
|
133
142
|
|
|
134
143
|
createOpaqueTypeNode,
|
|
135
|
-
}
|
|
144
|
+
};
|
|
@@ -13,29 +13,29 @@
|
|
|
13
13
|
* limitations under the License.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
export * from
|
|
17
|
-
export * from
|
|
16
|
+
export * from '../../generated/Es2pandaEnums';
|
|
17
|
+
export * from '../../generated';
|
|
18
18
|
|
|
19
|
-
export * from
|
|
20
|
-
export * from
|
|
21
|
-
export * from
|
|
22
|
-
export * from
|
|
23
|
-
export * from
|
|
24
|
-
export * from
|
|
25
|
-
export * from
|
|
26
|
-
export * from
|
|
27
|
-
export * from
|
|
19
|
+
export * from './utilities/performance';
|
|
20
|
+
export * from './utilities/private';
|
|
21
|
+
export * from './utilities/public';
|
|
22
|
+
export * from './factory/nodeFactory';
|
|
23
|
+
export * from './visitor';
|
|
24
|
+
export * from './AbstractVisitor';
|
|
25
|
+
export * from './plugins';
|
|
26
|
+
export * from './ImportStorage';
|
|
27
|
+
export * from './ProgramProvider';
|
|
28
28
|
|
|
29
|
-
export * from
|
|
30
|
-
export * from
|
|
31
|
-
export * from
|
|
32
|
-
export { GlobalContext } from
|
|
33
|
-
export * from
|
|
34
|
-
export * from
|
|
35
|
-
export * from
|
|
36
|
-
export * from
|
|
37
|
-
export * from
|
|
38
|
-
export * from
|
|
39
|
-
export * from
|
|
40
|
-
export { global as arktsGlobal } from
|
|
41
|
-
export * from
|
|
29
|
+
export * from './peers/AstNode';
|
|
30
|
+
export * from './peers/Config';
|
|
31
|
+
export * from './peers/Context';
|
|
32
|
+
export { GlobalContext } from './peers/Context';
|
|
33
|
+
export * from './peers/ExternalSource';
|
|
34
|
+
export * from './peers/Options';
|
|
35
|
+
export * from './peers/DiagnosticKind';
|
|
36
|
+
export * from './node-utilities/ArkTsConfig';
|
|
37
|
+
export * from './node-utilities/Program';
|
|
38
|
+
export * from './peers/ImportPathManager';
|
|
39
|
+
export * from './static/globalUtils';
|
|
40
|
+
export { global as arktsGlobal } from './static/global';
|
|
41
|
+
export * from './wrapper-compat';
|
|
@@ -13,31 +13,31 @@
|
|
|
13
13
|
* limitations under the License.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import { KNativePointer } from
|
|
17
|
-
import { AstNode } from
|
|
16
|
+
import { KNativePointer } from '@koalaui/interop';
|
|
17
|
+
import { AstNode } from './peers/AstNode';
|
|
18
18
|
|
|
19
19
|
export class NodeCache {
|
|
20
|
-
private static cache = new Map<KNativePointer, AstNode>()
|
|
20
|
+
private static cache = new Map<KNativePointer, AstNode>();
|
|
21
21
|
|
|
22
22
|
static cached<T extends AstNode>(pointer: KNativePointer, factory: (pointer: KNativePointer) => AstNode): T {
|
|
23
|
-
const cached = NodeCache.cache.get(pointer)
|
|
23
|
+
const cached = NodeCache.cache.get(pointer);
|
|
24
24
|
if (cached !== undefined) {
|
|
25
|
-
return cached as T
|
|
25
|
+
return cached as T;
|
|
26
26
|
}
|
|
27
|
-
const node = factory(pointer)
|
|
28
|
-
NodeCache.addToCache(pointer, node)
|
|
29
|
-
return node as T
|
|
27
|
+
const node = factory(pointer);
|
|
28
|
+
NodeCache.addToCache(pointer, node);
|
|
29
|
+
return node as T;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
static get<T extends AstNode>(pointer: KNativePointer): T | undefined {
|
|
33
|
-
return NodeCache.cache.get(pointer) as T | undefined
|
|
33
|
+
return NodeCache.cache.get(pointer) as T | undefined;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
public static addToCache(pointer: KNativePointer, node: AstNode) {
|
|
37
|
-
NodeCache.cache.set(pointer, node)
|
|
36
|
+
public static addToCache(pointer: KNativePointer, node: AstNode): void {
|
|
37
|
+
NodeCache.cache.set(pointer, node);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
public static clear(): void {
|
|
41
|
-
NodeCache.cache.clear()
|
|
41
|
+
NodeCache.cache.clear();
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
* limitations under the License.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import { ArkTsConfig } from
|
|
17
|
-
import { traceGlobal } from
|
|
16
|
+
import { ArkTsConfig } from '../../../generated';
|
|
17
|
+
import { traceGlobal } from '../../tracer';
|
|
18
18
|
|
|
19
19
|
export function dumpArkTsConfigInfo(arkTsConfig: ArkTsConfig) {
|
|
20
|
-
traceGlobal(() => `ArkTsConfig info:`)
|
|
21
|
-
traceGlobal(() => `\tBaseUrl: ${arkTsConfig.baseUrl}`)
|
|
22
|
-
traceGlobal(() => `\tConfigPath: ${arkTsConfig.configPath}`)
|
|
23
|
-
traceGlobal(() => `\tOutDir: ${arkTsConfig.outDir}`)
|
|
24
|
-
traceGlobal(() => `\tPackage: ${arkTsConfig.package}`)
|
|
25
|
-
traceGlobal(() => `\tRootDir: ${arkTsConfig.rootDir}`)
|
|
20
|
+
traceGlobal(() => `ArkTsConfig info:`);
|
|
21
|
+
traceGlobal(() => `\tBaseUrl: ${arkTsConfig.baseUrl}`);
|
|
22
|
+
traceGlobal(() => `\tConfigPath: ${arkTsConfig.configPath}`);
|
|
23
|
+
traceGlobal(() => `\tOutDir: ${arkTsConfig.outDir}`);
|
|
24
|
+
traceGlobal(() => `\tPackage: ${arkTsConfig.package}`);
|
|
25
|
+
traceGlobal(() => `\tRootDir: ${arkTsConfig.rootDir}`);
|
|
26
26
|
}
|
|
@@ -13,30 +13,18 @@
|
|
|
13
13
|
* limitations under the License.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import { Es2pandaAstNodeType } from
|
|
17
|
-
import { ArrayExpression, Expression } from
|
|
18
|
-
import { isSameNativeObject } from
|
|
19
|
-
import { updateNodeByNode } from
|
|
16
|
+
import { Es2pandaAstNodeType } from '../../../generated/Es2pandaEnums';
|
|
17
|
+
import { ArrayExpression, Expression } from '../../../generated';
|
|
18
|
+
import { isSameNativeObject } from '../peers/ArktsObject';
|
|
19
|
+
import { updateNodeByNode } from '../utilities/private';
|
|
20
20
|
|
|
21
|
-
export function createArrayExpression(
|
|
22
|
-
elements
|
|
23
|
-
): ArrayExpression {
|
|
24
|
-
return ArrayExpression.create1ArrayExpression(
|
|
25
|
-
Es2pandaAstNodeType.AST_NODE_TYPE_ARRAY_EXPRESSION,
|
|
26
|
-
elements,
|
|
27
|
-
false
|
|
28
|
-
)
|
|
21
|
+
export function createArrayExpression(elements: readonly Expression[]): ArrayExpression {
|
|
22
|
+
return ArrayExpression.create1ArrayExpression(Es2pandaAstNodeType.AST_NODE_TYPE_ARRAY_EXPRESSION, elements, false);
|
|
29
23
|
}
|
|
30
24
|
|
|
31
|
-
export function updateArrayExpression(
|
|
32
|
-
original: ArrayExpression,
|
|
33
|
-
elements: readonly Expression[]
|
|
34
|
-
): ArrayExpression {
|
|
25
|
+
export function updateArrayExpression(original: ArrayExpression, elements: readonly Expression[]): ArrayExpression {
|
|
35
26
|
if (isSameNativeObject(original.elements, elements)) {
|
|
36
|
-
return original
|
|
27
|
+
return original;
|
|
37
28
|
}
|
|
38
|
-
return updateNodeByNode(
|
|
39
|
-
createArrayExpression(elements),
|
|
40
|
-
original
|
|
41
|
-
)
|
|
29
|
+
return updateNodeByNode(createArrayExpression(elements), original);
|
|
42
30
|
}
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
* limitations under the License.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import { AssignmentExpression, Expression } from
|
|
17
|
-
import { isSameNativeObject } from
|
|
18
|
-
import { updateNodeByNode } from
|
|
19
|
-
import { Es2pandaAstNodeType, Es2pandaTokenType } from
|
|
16
|
+
import { AssignmentExpression, Expression } from '../../../generated';
|
|
17
|
+
import { isSameNativeObject } from '../peers/ArktsObject';
|
|
18
|
+
import { updateNodeByNode } from '../utilities/private';
|
|
19
|
+
import { Es2pandaAstNodeType, Es2pandaTokenType } from '../../../generated/Es2pandaEnums';
|
|
20
20
|
|
|
21
21
|
export function createAssignmentExpression(
|
|
22
22
|
left: Expression | undefined,
|
|
@@ -27,8 +27,8 @@ export function createAssignmentExpression(
|
|
|
27
27
|
Es2pandaAstNodeType.AST_NODE_TYPE_ASSIGNMENT_EXPRESSION,
|
|
28
28
|
left,
|
|
29
29
|
right,
|
|
30
|
-
assignmentOperator
|
|
31
|
-
)
|
|
30
|
+
assignmentOperator
|
|
31
|
+
);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
export function updateAssignmentExpression(
|
|
@@ -37,14 +37,12 @@ export function updateAssignmentExpression(
|
|
|
37
37
|
right: Expression | undefined,
|
|
38
38
|
assignmentOperator: Es2pandaTokenType
|
|
39
39
|
): AssignmentExpression {
|
|
40
|
-
if (
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
if (
|
|
41
|
+
isSameNativeObject(left, original.left) &&
|
|
42
|
+
isSameNativeObject(right, original.right) &&
|
|
43
|
+
isSameNativeObject(assignmentOperator, original.operatorType)
|
|
43
44
|
) {
|
|
44
|
-
return original
|
|
45
|
+
return original;
|
|
45
46
|
}
|
|
46
|
-
return updateNodeByNode(
|
|
47
|
-
createAssignmentExpression(left, right, assignmentOperator),
|
|
48
|
-
original
|
|
49
|
-
)
|
|
47
|
+
return updateNodeByNode(createAssignmentExpression(left, right, assignmentOperator), original);
|
|
50
48
|
}
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
* limitations under the License.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import { BlockStatement, Statement } from
|
|
17
|
-
import { isSameNativeObject } from
|
|
18
|
-
import { updateNodeByNode } from
|
|
16
|
+
import { BlockStatement, Statement } from '../../../generated';
|
|
17
|
+
import { isSameNativeObject } from '../peers/ArktsObject';
|
|
18
|
+
import { updateNodeByNode } from '../utilities/private';
|
|
19
19
|
|
|
20
20
|
export function updateBlockStatement(original: BlockStatement, statements: readonly Statement[]): BlockStatement {
|
|
21
21
|
if (isSameNativeObject(statements, original.statements)) {
|
|
22
|
-
return original
|
|
22
|
+
return original;
|
|
23
23
|
}
|
|
24
|
-
return updateNodeByNode(BlockStatement.createBlockStatement(statements), original)
|
|
24
|
+
return updateNodeByNode(BlockStatement.createBlockStatement(statements), original);
|
|
25
25
|
}
|