@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
|
@@ -22,31 +22,14 @@
|
|
|
22
22
|
"ETSUndefinedType",
|
|
23
23
|
],
|
|
24
24
|
"ignore": {
|
|
25
|
-
"
|
|
25
|
+
"peers": [
|
|
26
26
|
"es2panda_Config",
|
|
27
|
+
"es2panda_Context",
|
|
28
|
+
"es2panda_GlobalContext",
|
|
29
|
+
],
|
|
30
|
+
"full": [
|
|
27
31
|
"es2panda_ExternalSource",
|
|
28
32
|
"es2panda_OverloadInfo",
|
|
29
|
-
"es2panda_GlobalContext",
|
|
30
|
-
|
|
31
|
-
// Duplicates of types in ir namespace
|
|
32
|
-
// They will be removed in the fututre.
|
|
33
|
-
'es2panda_Signature',
|
|
34
|
-
'es2panda_CheckerContext',
|
|
35
|
-
'es2panda_Type',
|
|
36
|
-
'es2panda_TypeRelation',
|
|
37
|
-
'es2panda_GlobalTypesHolder',
|
|
38
|
-
'es2panda_Variable',
|
|
39
|
-
'es2panda_Scope',
|
|
40
|
-
'es2panda_Path',
|
|
41
|
-
'es2panda_ResolveResult',
|
|
42
|
-
'es2panda_RecordTable',
|
|
43
|
-
'es2panda_BoundContext',
|
|
44
|
-
'es2panda_ImportPathManager',
|
|
45
|
-
'es2panda_Options',
|
|
46
|
-
'es2panda_AstNode',
|
|
47
|
-
'es2panda_Program',
|
|
48
|
-
'es2panda_ArkTsConfig',
|
|
49
|
-
'es2panda_FunctionSignature',
|
|
50
33
|
|
|
51
34
|
'NodeTransformer',
|
|
52
35
|
'NodeTraverser',
|
|
@@ -87,25 +70,22 @@
|
|
|
87
70
|
interface: "es2panda_Impl",
|
|
88
71
|
methods: [
|
|
89
72
|
"LogSyntaxError", "LogWarning", "LogTypeError", // wrong idl
|
|
90
|
-
"
|
|
73
|
+
"DestroyConfig", // cleanup arena
|
|
91
74
|
|
|
92
75
|
// Handwritten bridges
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"CreateContextGenerateAbcForExternalSourceFiles",
|
|
99
|
-
"CreateDiagnosticInfo",
|
|
76
|
+
"ConfigGetOptions", // handwritten class
|
|
77
|
+
"ExternalSourceName", // handwritten class and used in panda API
|
|
78
|
+
"SourcePositionCol", // not in idl
|
|
79
|
+
"ExternalSourcePrograms", // Wrong args
|
|
80
|
+
"LogDiagnostic", // not in idl
|
|
100
81
|
"CreateDiagnosticKind",
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
"LogDiagnostic",
|
|
82
|
+
"GetSemanticErrors",
|
|
83
|
+
"GetSyntaxErrors",
|
|
84
|
+
"GetPluginErrors",
|
|
85
|
+
"GetWarnings",
|
|
86
|
+
"NumberLiteralStrConst",
|
|
87
|
+
"MemInitialize",
|
|
88
|
+
"MemFinalize",
|
|
109
89
|
],
|
|
110
90
|
},
|
|
111
91
|
{
|
|
@@ -235,18 +215,15 @@
|
|
|
235
215
|
"Parse",
|
|
236
216
|
]
|
|
237
217
|
},
|
|
218
|
+
{
|
|
219
|
+
interface: "ClassDefinition",
|
|
220
|
+
methods: [
|
|
221
|
+
"SetBody", // handwritten
|
|
222
|
+
]
|
|
223
|
+
},
|
|
238
224
|
]
|
|
239
225
|
},
|
|
240
226
|
nonNullable: [
|
|
241
|
-
{
|
|
242
|
-
name: "ScriptFunction",
|
|
243
|
-
methods: [
|
|
244
|
-
{
|
|
245
|
-
name: "SetIdent",
|
|
246
|
-
types: ["id"]
|
|
247
|
-
}
|
|
248
|
-
]
|
|
249
|
-
},
|
|
250
227
|
{
|
|
251
228
|
name: "ArrowFunctionExpression",
|
|
252
229
|
methods: [
|
|
@@ -26,11 +26,11 @@ sources = [
|
|
|
26
26
|
'./src/common.cc',
|
|
27
27
|
'./src/memoryTracker.cc',
|
|
28
28
|
'./src/bridges.cc',
|
|
29
|
-
'
|
|
30
|
-
get_option('interop_src_dir') / 'common-interop.
|
|
31
|
-
get_option('interop_src_dir') / 'callback-resource.
|
|
32
|
-
get_option('interop_src_dir') / 'interop-logging.
|
|
33
|
-
get_option('interop_src_dir') / 'napi' / 'convertors-napi.
|
|
29
|
+
'../generated/native/bridges.cc',
|
|
30
|
+
get_option('interop_src_dir') / 'common-interop.cpp',
|
|
31
|
+
get_option('interop_src_dir') / 'callback-resource.cpp',
|
|
32
|
+
get_option('interop_src_dir') / 'interop-logging.cpp',
|
|
33
|
+
get_option('interop_src_dir') / 'napi' / 'convertors-napi.cpp',
|
|
34
34
|
]
|
|
35
35
|
|
|
36
36
|
cflags = [
|
|
@@ -44,7 +44,7 @@ if (host_machine.system() == 'windows')
|
|
|
44
44
|
cflags += ['-DKOALA_WINDOWS']
|
|
45
45
|
# apply node.exe symbol loading hook
|
|
46
46
|
sources += [
|
|
47
|
-
get_option('interop_src_dir') / 'napi/win-dynamic-node.
|
|
47
|
+
get_option('interop_src_dir') / 'napi/win-dynamic-node.cpp'
|
|
48
48
|
]
|
|
49
49
|
else
|
|
50
50
|
cflags += ['-DKOALA_LINUX']
|
|
@@ -76,6 +76,22 @@ suffix_cross = '_' + os + '_arm64'
|
|
|
76
76
|
endif
|
|
77
77
|
endif
|
|
78
78
|
|
|
79
|
+
fs = import('fs')
|
|
80
|
+
if fs.is_dir(get_option('node_modules_dir_1') + '/node-api-headers')
|
|
81
|
+
node_api_headers_dir = get_option('node_modules_dir_1')
|
|
82
|
+
elif fs.is_dir(get_option('node_modules_dir_2') + '/node-api-headers')
|
|
83
|
+
node_api_headers_dir = get_option('node_modules_dir_2')
|
|
84
|
+
else
|
|
85
|
+
error('node-api-headers not found')
|
|
86
|
+
endif
|
|
87
|
+
if fs.is_dir(get_option('node_modules_dir_1') + '/node-addon-api')
|
|
88
|
+
node_addon_api_dir = get_option('node_modules_dir_1')
|
|
89
|
+
elif fs.is_dir(get_option('node_modules_dir_2') + '/node-addon-api')
|
|
90
|
+
node_addon_api_dir = get_option('node_modules_dir_2')
|
|
91
|
+
else
|
|
92
|
+
error('node-addon-api not found')
|
|
93
|
+
endif
|
|
94
|
+
|
|
79
95
|
shared_library(
|
|
80
96
|
get_option('lib_name') + suffix_host,
|
|
81
97
|
sources,
|
|
@@ -92,8 +108,8 @@ shared_library(
|
|
|
92
108
|
get_option('interop_src_dir'),
|
|
93
109
|
get_option('interop_src_dir') / 'types',
|
|
94
110
|
get_option('interop_src_dir') / 'napi',
|
|
95
|
-
|
|
96
|
-
|
|
111
|
+
node_api_headers_dir / 'node-api-headers/include',
|
|
112
|
+
node_addon_api_dir / 'node-addon-api',
|
|
97
113
|
],
|
|
98
114
|
cpp_args: cflags + cflags_host,
|
|
99
115
|
link_args: [cflags_host],
|
|
@@ -118,8 +134,8 @@ if is_cross
|
|
|
118
134
|
get_option('interop_src_dir'),
|
|
119
135
|
get_option('interop_src_dir') / 'types',
|
|
120
136
|
get_option('interop_src_dir') / 'napi',
|
|
121
|
-
|
|
122
|
-
|
|
137
|
+
node_api_headers_dir / 'node-api-headers/include',
|
|
138
|
+
node_addon_api_dir / 'node-addon-api',
|
|
123
139
|
],
|
|
124
140
|
cpp_args: cflags + cflags_cross,
|
|
125
141
|
link_args: [cflags_cross],
|
|
@@ -12,7 +12,13 @@
|
|
|
12
12
|
# limitations under the License.
|
|
13
13
|
|
|
14
14
|
option(
|
|
15
|
-
'
|
|
15
|
+
'node_modules_dir_1',
|
|
16
|
+
type : 'string',
|
|
17
|
+
value : '../node_modules/',
|
|
18
|
+
description : 'path to node_modules'
|
|
19
|
+
)
|
|
20
|
+
option(
|
|
21
|
+
'node_modules_dir_2',
|
|
16
22
|
type : 'string',
|
|
17
23
|
value : '../../node_modules/',
|
|
18
24
|
description : 'path to node_modules'
|
|
@@ -20,13 +26,13 @@ option(
|
|
|
20
26
|
option(
|
|
21
27
|
'interop_src_dir',
|
|
22
28
|
type : 'string',
|
|
23
|
-
value : '
|
|
29
|
+
value : '../../interop/src/cpp/',
|
|
24
30
|
description : 'path to koala interop cpp files'
|
|
25
31
|
)
|
|
26
32
|
option(
|
|
27
33
|
'panda_sdk_dir',
|
|
28
34
|
type : 'string',
|
|
29
|
-
value : '
|
|
35
|
+
value : '../../incremental/tools/panda/node_modules/@panda/sdk/',
|
|
30
36
|
description : 'path to panda sdk'
|
|
31
37
|
)
|
|
32
38
|
option(
|
|
@@ -13,11 +13,12 @@
|
|
|
13
13
|
* limitations under the License.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
#include
|
|
17
|
-
|
|
16
|
+
#include <mutex>
|
|
18
17
|
#include <set>
|
|
19
18
|
#include <string>
|
|
20
|
-
|
|
19
|
+
|
|
20
|
+
#include "common.h"
|
|
21
|
+
#include "memoryTracker.h"
|
|
21
22
|
|
|
22
23
|
/** XXX: If you add or remove methods that exist in C API,
|
|
23
24
|
* please change generator/options.json5 accordingly.
|
|
@@ -32,7 +33,8 @@ KNativePointer impl_AstNodeRebind(KNativePointer contextPtr, KNativePointer node
|
|
|
32
33
|
}
|
|
33
34
|
KOALA_INTEROP_2(AstNodeRebind, KNativePointer, KNativePointer, KNativePointer)
|
|
34
35
|
|
|
35
|
-
KNativePointer impl_AnnotationAllowedAnnotations(
|
|
36
|
+
KNativePointer impl_AnnotationAllowedAnnotations(
|
|
37
|
+
KNativePointer contextPtr, KNativePointer nodePtr, KNativePointer returnLen)
|
|
36
38
|
{
|
|
37
39
|
auto context = reinterpret_cast<es2panda_Context*>(contextPtr);
|
|
38
40
|
auto node = reinterpret_cast<es2panda_AstNode*>(nodePtr);
|
|
@@ -42,7 +44,8 @@ KNativePointer impl_AnnotationAllowedAnnotations(KNativePointer contextPtr, KNat
|
|
|
42
44
|
}
|
|
43
45
|
KOALA_INTEROP_3(AnnotationAllowedAnnotations, KNativePointer, KNativePointer, KNativePointer, KNativePointer)
|
|
44
46
|
|
|
45
|
-
KNativePointer impl_AnnotationAllowedAnnotationsConst(
|
|
47
|
+
KNativePointer impl_AnnotationAllowedAnnotationsConst(
|
|
48
|
+
KNativePointer contextPtr, KNativePointer nodePtr, KNativePointer returnLen)
|
|
46
49
|
{
|
|
47
50
|
auto context = reinterpret_cast<es2panda_Context*>(contextPtr);
|
|
48
51
|
auto node = reinterpret_cast<es2panda_AstNode*>(nodePtr);
|
|
@@ -89,20 +92,6 @@ KNativePointer impl_ETSParserCreateExpression(KNativePointer contextPtr, KString
|
|
|
89
92
|
}
|
|
90
93
|
KOALA_INTEROP_3(ETSParserCreateExpression, KNativePointer, KNativePointer, KStringPtr, KInt)
|
|
91
94
|
|
|
92
|
-
KNativePointer impl_CreateContextFromString(KNativePointer configPtr, KStringPtr& sourcePtr, KStringPtr& filenamePtr)
|
|
93
|
-
{
|
|
94
|
-
auto config = reinterpret_cast<es2panda_Config*>(configPtr);
|
|
95
|
-
return GetImpl()->CreateContextFromString(config, sourcePtr.data(), filenamePtr.data());
|
|
96
|
-
}
|
|
97
|
-
KOALA_INTEROP_3(CreateContextFromString, KNativePointer, KNativePointer, KStringPtr, KStringPtr)
|
|
98
|
-
|
|
99
|
-
KNativePointer impl_CreateContextFromFile(KNativePointer configPtr, KStringPtr& filenamePtr)
|
|
100
|
-
{
|
|
101
|
-
auto config = reinterpret_cast<es2panda_Config*>(configPtr);
|
|
102
|
-
return GetImpl()->CreateContextFromFile(config, getStringCopy(filenamePtr));
|
|
103
|
-
}
|
|
104
|
-
KOALA_INTEROP_2(CreateContextFromFile, KNativePointer, KNativePointer, KStringPtr)
|
|
105
|
-
|
|
106
95
|
KNativePointer impl_SignatureFunction(KNativePointer context, KNativePointer classInstance)
|
|
107
96
|
{
|
|
108
97
|
const auto _context = reinterpret_cast<es2panda_Context*>(context);
|
|
@@ -115,7 +104,7 @@ KOALA_INTEROP_2(SignatureFunction, KNativePointer, KNativePointer, KNativePointe
|
|
|
115
104
|
static KNativePointer impl_ProgramExternalSources(KNativePointer contextPtr, KNativePointer instancePtr)
|
|
116
105
|
{
|
|
117
106
|
auto context = reinterpret_cast<es2panda_Context*>(contextPtr);
|
|
118
|
-
auto&& instance = reinterpret_cast<es2panda_Program
|
|
107
|
+
auto&& instance = reinterpret_cast<es2panda_Program*>(instancePtr);
|
|
119
108
|
std::size_t source_len = 0;
|
|
120
109
|
auto external_sources = GetImpl()->ProgramExternalSources(context, instance, &source_len);
|
|
121
110
|
return StageArena::cloneVector(external_sources, source_len);
|
|
@@ -125,7 +114,7 @@ KOALA_INTEROP_2(ProgramExternalSources, KNativePointer, KNativePointer, KNativeP
|
|
|
125
114
|
static KNativePointer impl_ProgramDirectExternalSources(KNativePointer contextPtr, KNativePointer instancePtr)
|
|
126
115
|
{
|
|
127
116
|
auto context = reinterpret_cast<es2panda_Context*>(contextPtr);
|
|
128
|
-
auto&& instance = reinterpret_cast<es2panda_Program
|
|
117
|
+
auto&& instance = reinterpret_cast<es2panda_Program*>(instancePtr);
|
|
129
118
|
std::size_t sourceLen = 0;
|
|
130
119
|
auto externalSources = GetImpl()->ProgramDirectExternalSources(context, instance, &sourceLen);
|
|
131
120
|
return new std::vector<void*>(externalSources, externalSources + sourceLen);
|
|
@@ -135,7 +124,7 @@ KOALA_INTEROP_2(ProgramDirectExternalSources, KNativePointer, KNativePointer, KN
|
|
|
135
124
|
static KNativePointer impl_ProgramSourceFilePath(KNativePointer contextPtr, KNativePointer instancePtr)
|
|
136
125
|
{
|
|
137
126
|
auto context = reinterpret_cast<es2panda_Context*>(contextPtr);
|
|
138
|
-
auto&& instance = reinterpret_cast<es2panda_Program
|
|
127
|
+
auto&& instance = reinterpret_cast<es2panda_Program*>(instancePtr);
|
|
139
128
|
auto&& result = GetImpl()->ProgramSourceFilePathConst(context, instance);
|
|
140
129
|
return StageArena::strdup(result);
|
|
141
130
|
}
|
|
@@ -143,7 +132,7 @@ KOALA_INTEROP_2(ProgramSourceFilePath, KNativePointer, KNativePointer, KNativePo
|
|
|
143
132
|
|
|
144
133
|
static KNativePointer impl_ExternalSourceName(KNativePointer instance)
|
|
145
134
|
{
|
|
146
|
-
auto&& _instance_ = reinterpret_cast<es2panda_ExternalSource
|
|
135
|
+
auto&& _instance_ = reinterpret_cast<es2panda_ExternalSource*>(instance);
|
|
147
136
|
auto&& result = GetImpl()->ExternalSourceName(_instance_);
|
|
148
137
|
return StageArena::strdup(result);
|
|
149
138
|
}
|
|
@@ -151,14 +140,16 @@ KOALA_INTEROP_1(ExternalSourceName, KNativePointer, KNativePointer);
|
|
|
151
140
|
|
|
152
141
|
static KNativePointer impl_ExternalSourcePrograms(KNativePointer instance)
|
|
153
142
|
{
|
|
154
|
-
auto&& _instance_ = reinterpret_cast<es2panda_ExternalSource
|
|
143
|
+
auto&& _instance_ = reinterpret_cast<es2panda_ExternalSource*>(instance);
|
|
155
144
|
std::size_t program_len = 0;
|
|
156
145
|
auto programs = GetImpl()->ExternalSourcePrograms(_instance_, &program_len);
|
|
157
146
|
return StageArena::cloneVector(programs, program_len);
|
|
158
147
|
}
|
|
159
148
|
KOALA_INTEROP_1(ExternalSourcePrograms, KNativePointer, KNativePointer);
|
|
160
149
|
|
|
161
|
-
KNativePointer impl_ETSParserBuildImportDeclaration(KNativePointer context, KInt importKinds,
|
|
150
|
+
KNativePointer impl_ETSParserBuildImportDeclaration(KNativePointer context, KInt importKinds,
|
|
151
|
+
KNativePointerArray specifiers, KUInt specifiersSequenceLength, KNativePointer source, KNativePointer program,
|
|
152
|
+
KInt importFlag)
|
|
162
153
|
{
|
|
163
154
|
const auto _context = reinterpret_cast<es2panda_Context*>(context);
|
|
164
155
|
const auto _kinds = static_cast<Es2pandaImportKinds>(importKinds);
|
|
@@ -168,9 +159,11 @@ KNativePointer impl_ETSParserBuildImportDeclaration(KNativePointer context, KInt
|
|
|
168
159
|
const auto _program = reinterpret_cast<es2panda_Program*>(program);
|
|
169
160
|
const auto _importFlag = static_cast<Es2pandaImportFlags>(importFlag);
|
|
170
161
|
|
|
171
|
-
return GetImpl()->ETSParserBuildImportDeclaration(
|
|
162
|
+
return GetImpl()->ETSParserBuildImportDeclaration(
|
|
163
|
+
_context, _kinds, _specifiers, _specifiersSequenceLength, _source, _program, _importFlag);
|
|
172
164
|
}
|
|
173
|
-
KOALA_INTEROP_7(ETSParserBuildImportDeclaration, KNativePointer, KNativePointer, KInt, KNativePointerArray, KUInt,
|
|
165
|
+
KOALA_INTEROP_7(ETSParserBuildImportDeclaration, KNativePointer, KNativePointer, KInt, KNativePointerArray, KUInt,
|
|
166
|
+
KNativePointer, KNativePointer, KInt)
|
|
174
167
|
|
|
175
168
|
KNativePointer impl_ETSParserGetImportPathManager(KNativePointer contextPtr)
|
|
176
169
|
{
|
|
@@ -181,15 +174,15 @@ KOALA_INTEROP_1(ETSParserGetImportPathManager, KNativePointer, KNativePointer);
|
|
|
181
174
|
|
|
182
175
|
KInt impl_SourcePositionCol(KNativePointer context, KNativePointer instance)
|
|
183
176
|
{
|
|
184
|
-
auto&& _context_ = reinterpret_cast<es2panda_Context
|
|
185
|
-
auto&& _instance_ = reinterpret_cast<es2panda_SourcePosition
|
|
177
|
+
auto&& _context_ = reinterpret_cast<es2panda_Context*>(context);
|
|
178
|
+
auto&& _instance_ = reinterpret_cast<es2panda_SourcePosition*>(instance);
|
|
186
179
|
return GetImpl()->SourcePositionCol(_context_, _instance_);
|
|
187
180
|
}
|
|
188
181
|
KOALA_INTEROP_2(SourcePositionCol, KInt, KNativePointer, KNativePointer);
|
|
189
182
|
|
|
190
183
|
KNativePointer impl_ConfigGetOptions(KNativePointer config)
|
|
191
184
|
{
|
|
192
|
-
const auto _config = reinterpret_cast<es2panda_Config
|
|
185
|
+
const auto _config = reinterpret_cast<es2panda_Config*>(config);
|
|
193
186
|
auto result = GetImpl()->ConfigGetOptions(_config);
|
|
194
187
|
return (void*)result;
|
|
195
188
|
}
|
|
@@ -197,43 +190,13 @@ KOALA_INTEROP_1(ConfigGetOptions, KNativePointer, KNativePointer)
|
|
|
197
190
|
|
|
198
191
|
KNativePointer impl_OptionsArkTsConfig(KNativePointer context, KNativePointer options)
|
|
199
192
|
{
|
|
200
|
-
const auto _context = reinterpret_cast<es2panda_Context
|
|
201
|
-
const auto _options = reinterpret_cast<es2panda_Options
|
|
193
|
+
const auto _context = reinterpret_cast<es2panda_Context*>(context);
|
|
194
|
+
const auto _options = reinterpret_cast<es2panda_Options*>(options);
|
|
202
195
|
auto result = GetImpl()->OptionsUtilArkTSConfigConst(_context, _options);
|
|
203
196
|
return (void*)result;
|
|
204
197
|
}
|
|
205
198
|
KOALA_INTEROP_2(OptionsArkTsConfig, KNativePointer, KNativePointer, KNativePointer)
|
|
206
199
|
|
|
207
|
-
KNativePointer impl_CreateCacheContextFromFile(KNativePointer configPtr, KStringPtr& source_file_namePtr, KNativePointer globalContextPtr, KBoolean isExternal) {
|
|
208
|
-
auto config = reinterpret_cast<es2panda_Config*>(configPtr);
|
|
209
|
-
auto globalContext = reinterpret_cast<es2panda_GlobalContext*>(globalContextPtr);
|
|
210
|
-
return GetImpl()->CreateCacheContextFromFile(config, getStringCopy(source_file_namePtr), globalContext, isExternal);
|
|
211
|
-
}
|
|
212
|
-
KOALA_INTEROP_4(CreateCacheContextFromFile, KNativePointer, KNativePointer, KStringPtr, KNativePointer, KBoolean)
|
|
213
|
-
|
|
214
|
-
KNativePointer impl_CreateGlobalContext(KNativePointer configPtr, KStringArray externalFileListPtr, KUInt fileNum, KBoolean LspUsage) {
|
|
215
|
-
auto config = reinterpret_cast<es2panda_Config*>(configPtr);
|
|
216
|
-
const int headerLen = 4;
|
|
217
|
-
const char** files = StageArena::allocArray<const char*>(fileNum);
|
|
218
|
-
uint8_t* filesPtr = (uint8_t*)externalFileListPtr;
|
|
219
|
-
std::size_t position = headerLen;
|
|
220
|
-
std::size_t strLen;
|
|
221
|
-
for (std::size_t i = 0; i < static_cast<std::size_t>(fileNum); ++i) {
|
|
222
|
-
strLen = unpackUInt(filesPtr + position);
|
|
223
|
-
position += headerLen;
|
|
224
|
-
files[i] = StageArena::strdup(std::string(reinterpret_cast<const char*>(filesPtr + position), strLen).c_str());
|
|
225
|
-
position += strLen;
|
|
226
|
-
}
|
|
227
|
-
return GetImpl()->CreateGlobalContext(config, files, fileNum, LspUsage);
|
|
228
|
-
}
|
|
229
|
-
KOALA_INTEROP_4(CreateGlobalContext, KNativePointer, KNativePointer, KStringArray, KUInt, KBoolean)
|
|
230
|
-
|
|
231
|
-
void impl_DestroyGlobalContext(KNativePointer globalContextPtr) {
|
|
232
|
-
auto globalContext = reinterpret_cast<es2panda_GlobalContext*>(globalContextPtr);
|
|
233
|
-
GetImpl()->DestroyGlobalContext(globalContext);
|
|
234
|
-
}
|
|
235
|
-
KOALA_INTEROP_V1(DestroyGlobalContext, KNativePointer)
|
|
236
|
-
|
|
237
200
|
// All these "Checker_" bridges are related to checker namespace in es2panda, so work with them carefully
|
|
238
201
|
// Checker.Type does reset on recheck, so modifying them makes no sence
|
|
239
202
|
// It seems that compiler does not provide API to convert Checker.Type to ir.Type
|
|
@@ -411,71 +374,17 @@ KNativePointer impl_CreateDiagnosticKind(KNativePointer context, KStringPtr& mes
|
|
|
411
374
|
const auto _context = reinterpret_cast<es2panda_Context*>(context);
|
|
412
375
|
const auto _message = getStringCopy(message);
|
|
413
376
|
const auto _type = static_cast<es2panda_PluginDiagnosticType>(type);
|
|
414
|
-
return const_cast<es2panda_DiagnosticKind
|
|
377
|
+
return const_cast<es2panda_DiagnosticKind*>(GetImpl()->CreateDiagnosticKind(_context, _message, _type));
|
|
415
378
|
}
|
|
416
379
|
KOALA_INTEROP_3(CreateDiagnosticKind, KNativePointer, KNativePointer, KStringPtr, KInt)
|
|
417
380
|
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
{
|
|
421
|
-
const auto _context = reinterpret_cast<es2panda_Context*>(context);
|
|
422
|
-
const auto _kind = reinterpret_cast<es2panda_DiagnosticKind*>(kind);
|
|
423
|
-
const auto _pos = reinterpret_cast<es2panda_SourcePosition *>(pos);
|
|
424
|
-
const std::size_t headerLen = 4;
|
|
425
|
-
const char** _args = new const char*[argc];
|
|
426
|
-
std::size_t position = headerLen;
|
|
427
|
-
std::size_t strLen;
|
|
428
|
-
for (std::size_t i = 0; i < static_cast<std::size_t>(argc); ++i) {
|
|
429
|
-
strLen = unpackUInt(argsPtr + position);
|
|
430
|
-
position += headerLen;
|
|
431
|
-
_args[i] = strdup(std::string(reinterpret_cast<const char*>(argsPtr + position), strLen).c_str());
|
|
432
|
-
position += strLen;
|
|
433
|
-
}
|
|
434
|
-
return GetImpl()->CreateDiagnosticInfo(_context, _kind, _args, argc, _pos);
|
|
435
|
-
}
|
|
436
|
-
KOALA_INTEROP_5(CreateDiagnosticInfo, KNativePointer, KNativePointer, KNativePointer,
|
|
437
|
-
KStringArray, KInt, KNativePointer)
|
|
438
|
-
|
|
439
|
-
KNativePointer impl_CreateSuggestionInfo(KNativePointer context, KNativePointer kind, KStringArray argsPtr,
|
|
440
|
-
KInt argc, KStringPtr& substitutionCode, KStringPtr& title, KNativePointer range)
|
|
381
|
+
void impl_LogDiagnostic(
|
|
382
|
+
KNativePointer context, KNativePointer kind, KStringArray& argvPtr, KInt argc, KNativePointer pos)
|
|
441
383
|
{
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
const std::size_t headerLen = 4;
|
|
447
|
-
const char** _args = new const char*[argc];
|
|
448
|
-
std::size_t position = headerLen;
|
|
449
|
-
std::size_t strLen;
|
|
450
|
-
for (std::size_t i = 0; i < static_cast<std::size_t>(argc); ++i) {
|
|
451
|
-
strLen = unpackUInt(argsPtr + position);
|
|
452
|
-
position += headerLen;
|
|
453
|
-
_args[i] = strdup(std::string(reinterpret_cast<const char*>(argsPtr + position), strLen).c_str());
|
|
454
|
-
position += strLen;
|
|
455
|
-
}
|
|
456
|
-
const auto _substitutionCode = getStringCopy(substitutionCode);
|
|
457
|
-
return GetImpl()->CreateSuggestionInfo(_context, _kind, _args, argc, _substitutionCode, _title, _range);
|
|
458
|
-
}
|
|
459
|
-
KOALA_INTEROP_7(CreateSuggestionInfo, KNativePointer, KNativePointer, KNativePointer, KStringArray, KInt,
|
|
460
|
-
KStringPtr, KStringPtr, KNativePointer)
|
|
461
|
-
|
|
462
|
-
void impl_LogDiagnostic(KNativePointer context, KNativePointer kind, KStringArray argvPtr,
|
|
463
|
-
KInt argc, KNativePointer pos)
|
|
464
|
-
{
|
|
465
|
-
auto&& _context_ = reinterpret_cast<es2panda_Context *>(context);
|
|
466
|
-
auto&& _kind_ = reinterpret_cast<es2panda_DiagnosticKind *>(kind);
|
|
467
|
-
auto&& _pos_ = reinterpret_cast<es2panda_SourcePosition *>(pos);
|
|
468
|
-
const std::size_t headerLen = 4;
|
|
469
|
-
const char** argv = new const char*[argc];
|
|
470
|
-
std::size_t position = headerLen;
|
|
471
|
-
std::size_t strLen;
|
|
472
|
-
for (std::size_t i = 0; i < static_cast<std::size_t>(argc); ++i) {
|
|
473
|
-
strLen = unpackUInt(argvPtr + position);
|
|
474
|
-
position += headerLen;
|
|
475
|
-
argv[i] = strdup(std::string(reinterpret_cast<const char*>(argvPtr + position), strLen).c_str());
|
|
476
|
-
position += strLen;
|
|
477
|
-
}
|
|
478
|
-
GetImpl()->LogDiagnostic(_context_, _kind_, argv, argc, _pos_);
|
|
384
|
+
auto&& _context_ = reinterpret_cast<es2panda_Context*>(context);
|
|
385
|
+
auto&& _kind_ = reinterpret_cast<es2panda_DiagnosticKind*>(kind);
|
|
386
|
+
auto&& _pos_ = reinterpret_cast<es2panda_SourcePosition*>(pos);
|
|
387
|
+
GetImpl()->LogDiagnostic(_context_, _kind_, getStringArray(argvPtr), argc, _pos_);
|
|
479
388
|
}
|
|
480
389
|
KOALA_INTEROP_V5(LogDiagnostic, KNativePointer, KNativePointer, KStringArray, KInt, KNativePointer)
|
|
481
390
|
|
|
@@ -489,45 +398,13 @@ KNativePointer impl_AnnotationUsageIrPropertiesPtrConst(KNativePointer context,
|
|
|
489
398
|
}
|
|
490
399
|
KOALA_INTEROP_2(AnnotationUsageIrPropertiesPtrConst, KNativePointer, KNativePointer, KNativePointer);
|
|
491
400
|
|
|
492
|
-
KInt impl_GenerateTsDeclarationsFromContext(KNativePointer contextPtr, KStringPtr &outputDeclEts, KStringPtr &outputEts,
|
|
493
|
-
KBoolean exportAll, KBoolean isolated, KStringPtr &recordFile)
|
|
494
|
-
{
|
|
495
|
-
auto context = reinterpret_cast<es2panda_Context *>(contextPtr);
|
|
496
|
-
return GetImpl()->GenerateTsDeclarationsFromContext(context, outputDeclEts.data(), outputEts.data(), exportAll, isolated, recordFile.data() );
|
|
497
|
-
}
|
|
498
|
-
KOALA_INTEROP_6(GenerateTsDeclarationsFromContext, KInt, KNativePointer, KStringPtr, KStringPtr, KBoolean, KBoolean, KStringPtr)
|
|
499
|
-
|
|
500
|
-
// Improve: simplify
|
|
501
|
-
KNativePointer impl_CreateContextGenerateAbcForExternalSourceFiles(
|
|
502
|
-
KNativePointer configPtr, KInt fileNamesCount, KStringArray fileNames)
|
|
503
|
-
{
|
|
504
|
-
auto config = reinterpret_cast<es2panda_Config *>(configPtr);
|
|
505
|
-
const std::size_t headerLen = 4;
|
|
506
|
-
const char **argv =
|
|
507
|
-
new const char *[static_cast<unsigned int>(fileNamesCount)];
|
|
508
|
-
std::size_t position = headerLen;
|
|
509
|
-
std::size_t strLen;
|
|
510
|
-
for (std::size_t i = 0; i < static_cast<std::size_t>(fileNamesCount); ++i) {
|
|
511
|
-
strLen = unpackUInt(fileNames + position);
|
|
512
|
-
position += headerLen;
|
|
513
|
-
argv[i] = strdup(
|
|
514
|
-
std::string(reinterpret_cast<const char *>(fileNames + position),
|
|
515
|
-
strLen)
|
|
516
|
-
.c_str());
|
|
517
|
-
position += strLen;
|
|
518
|
-
}
|
|
519
|
-
return GetImpl()->CreateContextGenerateAbcForExternalSourceFiles(
|
|
520
|
-
config, fileNamesCount, argv);
|
|
521
|
-
}
|
|
522
|
-
KOALA_INTEROP_3(CreateContextGenerateAbcForExternalSourceFiles, KNativePointer, KNativePointer, KInt, KStringArray)
|
|
523
|
-
|
|
524
401
|
KInt impl_GetCompilationMode(KNativePointer configPtr)
|
|
525
402
|
{
|
|
526
|
-
auto _config = reinterpret_cast<es2panda_Config
|
|
527
|
-
auto _options = const_cast<es2panda_Options
|
|
403
|
+
auto _config = reinterpret_cast<es2panda_Config*>(configPtr);
|
|
404
|
+
auto _options = const_cast<es2panda_Options*>(GetImpl()->ConfigGetOptions(_config));
|
|
528
405
|
return GetImpl()->OptionsUtilGetCompilationModeConst(nullptr, _options);
|
|
529
406
|
}
|
|
530
|
-
KOALA_INTEROP_1(GetCompilationMode, KInt, KNativePointer)
|
|
407
|
+
KOALA_INTEROP_1(GetCompilationMode, KInt, KNativePointer)
|
|
531
408
|
|
|
532
409
|
KNativePointer impl_CreateTypeNodeFromTsType(KNativePointer context, KNativePointer nodePtr)
|
|
533
410
|
{
|
|
@@ -544,4 +421,23 @@ KNativePointer impl_CreateTypeNodeFromTsType(KNativePointer context, KNativePoin
|
|
|
544
421
|
auto _typeAnnotation = GetImpl()->CreateOpaqueTypeNode(_context, _nodeTsType);
|
|
545
422
|
return _typeAnnotation;
|
|
546
423
|
}
|
|
547
|
-
KOALA_INTEROP_2(CreateTypeNodeFromTsType, KNativePointer, KNativePointer, KNativePointer)
|
|
424
|
+
KOALA_INTEROP_2(CreateTypeNodeFromTsType, KNativePointer, KNativePointer, KNativePointer)
|
|
425
|
+
|
|
426
|
+
MemoryTracker tracker;
|
|
427
|
+
void impl_MemoryTrackerReset(KNativePointer context)
|
|
428
|
+
{
|
|
429
|
+
tracker.Reset();
|
|
430
|
+
}
|
|
431
|
+
KOALA_INTEROP_V1(MemoryTrackerReset, KNativePointer);
|
|
432
|
+
|
|
433
|
+
void impl_MemoryTrackerGetDelta(KNativePointer context)
|
|
434
|
+
{
|
|
435
|
+
tracker.Report(tracker.GetDelta());
|
|
436
|
+
}
|
|
437
|
+
KOALA_INTEROP_V1(MemoryTrackerGetDelta, KNativePointer);
|
|
438
|
+
|
|
439
|
+
void impl_MemoryTrackerPrintCurrent(KNativePointer context)
|
|
440
|
+
{
|
|
441
|
+
tracker.Report(GetMemoryStats());
|
|
442
|
+
}
|
|
443
|
+
KOALA_INTEROP_V1(MemoryTrackerPrintCurrent, KNativePointer);
|