@idlizer/arktscgen 2.1.2 → 2.1.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/README.md +36 -0
- package/build/libarkts-copy/generator/options.json5 +113 -44
- package/build/libarkts-copy/native/src/bridges.cc +70 -2
- package/build/libarkts-copy/native/src/generated/bridges.cc +700 -200
- package/build/libarkts-copy/package.json +27 -15
- package/build/libarkts-copy/src/Es2pandaNativeModule.ts +42 -4
- package/build/libarkts-copy/src/InteropNativeModule.ts +2 -1
- package/build/libarkts-copy/src/arkts-api/AbstractVisitor.ts +50 -0
- package/build/libarkts-copy/src/arkts-api/class-by-peer.ts +8 -6
- package/build/libarkts-copy/src/arkts-api/factory/nodeFactory.ts +95 -117
- package/build/libarkts-copy/src/arkts-api/index.ts +3 -1
- package/build/libarkts-copy/src/arkts-api/node-cache.ts +35 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/ArrayExpression.ts +42 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/ArrowFunctionExpression.ts +49 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/AssignmentExpression.ts +50 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/{createCallExpression.ts → CallExpression.ts} +27 -4
- package/build/libarkts-copy/src/arkts-api/node-utilities/ClassDefinition.ts +73 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/ClassProperty.ts +41 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/ETSFunctionType.ts +65 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/ETSImportDeclaration.ts +63 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/ETSParameterExpression.ts +60 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/ETSStructDeclaration.ts +31 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/ETSTuple.ts +31 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/MemberExpression.ts +41 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/MethodDefinition.ts +75 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/{createNumberLiteral.ts → NumberLiteral.ts} +15 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/ObjectExpression.ts +34 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/ScriptFunction.ts +99 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/TSInterfaceDeclaration.ts +61 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/TSTypeAliasDeclaration.ts +60 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/TSTypeParameter.ts +39 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/TSTypeReferencePart.ts +36 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/TryStatement.ts +44 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/VariableDeclaration.ts +54 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/VariableDeclarator.ts +37 -0
- package/build/libarkts-copy/src/arkts-api/peers/AstNode.ts +15 -14
- package/build/libarkts-copy/src/arkts-api/peers/ImportPathManager.ts +30 -0
- package/build/libarkts-copy/src/arkts-api/peers/Program.ts +4 -4
- package/build/libarkts-copy/src/arkts-api/peers/SourcePosition.ts +38 -0
- package/build/libarkts-copy/src/arkts-api/static/global.ts +5 -0
- package/build/libarkts-copy/src/arkts-api/static/profiler.ts +25 -0
- package/build/libarkts-copy/src/arkts-api/utilities/private.ts +13 -11
- package/build/libarkts-copy/src/arkts-api/utilities/public.ts +68 -10
- package/build/libarkts-copy/src/arkts-api/visitor.ts +175 -42
- package/build/libarkts-copy/src/generated/Es2pandaEnums.ts +504 -458
- package/build/libarkts-copy/src/generated/Es2pandaNativeModule.ts +225 -75
- package/build/libarkts-copy/src/generated/factory.ts +21 -43
- package/build/libarkts-copy/src/generated/index.ts +24 -3
- package/build/libarkts-copy/src/generated/peers/AnnotatedAstNode.ts +1 -2
- package/build/libarkts-copy/src/generated/peers/AnnotatedExpression.ts +1 -2
- package/build/libarkts-copy/src/generated/peers/AnnotatedStatement.ts +1 -2
- package/build/libarkts-copy/src/generated/peers/AnnotationDeclaration.ts +7 -7
- package/build/libarkts-copy/src/generated/peers/AnnotationUsage.ts +12 -12
- package/build/libarkts-copy/src/generated/peers/ArrayExpression.ts +10 -5
- package/build/libarkts-copy/src/generated/peers/ArrowFunctionExpression.ts +7 -7
- package/build/libarkts-copy/src/generated/peers/AssertStatement.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/AssignmentExpression.ts +13 -7
- package/build/libarkts-copy/src/generated/peers/AstDumper.ts +1 -2
- package/build/libarkts-copy/src/generated/peers/AstVerifier.ts +35 -0
- package/build/libarkts-copy/src/generated/peers/AstVisitor.ts +35 -0
- package/build/libarkts-copy/src/generated/peers/AwaitExpression.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/BigIntLiteral.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/BinaryExpression.ts +14 -7
- package/build/libarkts-copy/src/generated/peers/BindingProps.ts +35 -0
- package/build/libarkts-copy/src/generated/peers/BlockExpression.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/BlockStatement.ts +15 -5
- package/build/libarkts-copy/src/generated/peers/BooleanLiteral.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/BreakStatement.ts +8 -5
- package/build/libarkts-copy/src/generated/peers/CallExpression.ts +8 -8
- package/build/libarkts-copy/src/generated/peers/CatchClause.ts +6 -6
- package/build/libarkts-copy/src/generated/peers/ChainExpression.ts +12 -5
- package/build/libarkts-copy/src/generated/peers/CharLiteral.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/ClassDeclaration.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/ClassDefinition.ts +30 -15
- package/build/libarkts-copy/src/generated/peers/ClassElement.ts +7 -8
- package/build/libarkts-copy/src/generated/peers/ClassExpression.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/ClassProperty.ts +21 -5
- package/build/libarkts-copy/src/generated/peers/ClassStaticBlock.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/CodeGen.ts +35 -0
- package/build/libarkts-copy/src/generated/peers/ConditionalExpression.ts +7 -7
- package/build/libarkts-copy/src/generated/peers/ContinueStatement.ts +8 -5
- package/build/libarkts-copy/src/generated/peers/DebuggerStatement.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/Declaration.ts +35 -0
- package/build/libarkts-copy/src/generated/peers/Decorator.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/DirectEvalExpression.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/DoWhileStatement.ts +6 -6
- package/build/libarkts-copy/src/generated/peers/DynamicImportData.ts +35 -0
- package/build/libarkts-copy/src/generated/peers/ETSClassLiteral.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/ETSDynamicFunctionType.ts +1 -2
- package/build/libarkts-copy/src/generated/peers/ETSFunctionType.ts +15 -15
- package/build/libarkts-copy/src/generated/peers/ETSImportDeclaration.ts +26 -17
- package/build/libarkts-copy/src/generated/peers/ETSKeyofType.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/ETSModule.ts +6 -6
- package/build/libarkts-copy/src/generated/peers/ETSNewArrayInstanceExpression.ts +11 -6
- package/build/libarkts-copy/src/generated/peers/ETSNewClassInstanceExpression.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/ETSNewMultiDimArrayInstanceExpression.ts +11 -6
- package/build/libarkts-copy/src/generated/peers/ETSNullType.ts +6 -6
- package/build/libarkts-copy/src/generated/peers/ETSPackageDeclaration.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/ETSParameterExpression.ts +10 -10
- package/build/libarkts-copy/src/generated/peers/ETSPrimitiveType.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/ETSReExportDeclaration.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/ETSStringLiteralType.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/ETSStructDeclaration.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/ETSTuple.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/ETSTypeReference.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/ETSTypeReferencePart.ts +8 -8
- package/build/libarkts-copy/src/generated/peers/ETSUndefinedType.ts +6 -6
- package/build/libarkts-copy/src/generated/peers/ETSUnionType.ts +7 -7
- package/build/libarkts-copy/src/generated/peers/ETSWildcardType.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/EmptyStatement.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/ErrorLogger.ts +35 -0
- package/build/libarkts-copy/src/generated/peers/ExportAllDeclaration.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/ExportDefaultDeclaration.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/ExportNamedDeclaration.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/ExportSpecifier.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/Expression.ts +4 -5
- package/build/libarkts-copy/src/generated/peers/ExpressionStatement.ts +6 -6
- package/build/libarkts-copy/src/generated/peers/ForInStatement.ts +7 -7
- package/build/libarkts-copy/src/generated/peers/ForOfStatement.ts +7 -7
- package/build/libarkts-copy/src/generated/peers/ForUpdateStatement.ts +7 -7
- package/build/libarkts-copy/src/generated/peers/FunctionDecl.ts +1 -2
- package/build/libarkts-copy/src/generated/peers/FunctionDeclaration.ts +8 -8
- package/build/libarkts-copy/src/generated/peers/FunctionExpression.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/FunctionSignature.ts +6 -7
- package/build/libarkts-copy/src/generated/peers/IRNode.ts +35 -0
- package/build/libarkts-copy/src/generated/peers/Identifier.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/IfStatement.ts +9 -9
- package/build/libarkts-copy/src/generated/peers/ImportDeclaration.ts +10 -10
- package/build/libarkts-copy/src/generated/peers/ImportDefaultSpecifier.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/ImportExpression.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/ImportNamespaceSpecifier.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/ImportSource.ts +1 -15
- package/build/libarkts-copy/src/generated/peers/ImportSpecifier.ts +14 -6
- package/build/libarkts-copy/src/generated/peers/IndexInfo.ts +35 -0
- package/build/libarkts-copy/src/generated/peers/InterfaceDecl.ts +1 -2
- package/build/libarkts-copy/src/generated/peers/LabelPair.ts +35 -0
- package/build/libarkts-copy/src/generated/peers/LabelledStatement.ts +6 -6
- package/build/libarkts-copy/src/generated/peers/Literal.ts +1 -2
- package/build/libarkts-copy/src/generated/peers/LoopStatement.ts +1 -2
- package/build/libarkts-copy/src/generated/peers/MaybeOptionalExpression.ts +1 -2
- package/build/libarkts-copy/src/generated/peers/MemberExpression.ts +24 -8
- package/build/libarkts-copy/src/generated/peers/MetaProperty.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/MethodDefinition.ts +25 -8
- package/build/libarkts-copy/src/generated/peers/NamedType.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/NewExpression.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/NullLiteral.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/NumberLiteral.ts +19 -4
- package/build/libarkts-copy/src/generated/peers/ObjectDescriptor.ts +35 -0
- package/build/libarkts-copy/src/generated/peers/ObjectExpression.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/OmittedExpression.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/OpaqueTypeNode.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/OverloadInfo.ts +35 -0
- package/build/libarkts-copy/src/generated/peers/PrefixAssertionExpression.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/Property.ts +6 -6
- package/build/libarkts-copy/src/generated/peers/RegExpLiteral.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/ReturnStatement.ts +8 -5
- package/build/libarkts-copy/src/generated/peers/ScopeFindResult.ts +35 -0
- package/build/libarkts-copy/src/generated/peers/ScriptFunction.ts +16 -11
- package/build/libarkts-copy/src/generated/peers/ScriptFunctionData.ts +35 -0
- package/build/libarkts-copy/src/generated/peers/SequenceExpression.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/SignatureInfo.ts +35 -0
- package/build/libarkts-copy/src/generated/peers/SourcePosition.ts +35 -0
- package/build/libarkts-copy/src/generated/peers/SourceRange.ts +35 -0
- package/build/libarkts-copy/src/generated/peers/SpreadElement.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/SrcDumper.ts +1 -2
- package/build/libarkts-copy/src/generated/peers/Statement.ts +1 -2
- package/build/libarkts-copy/src/generated/peers/StringLiteral.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/SuperExpression.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/SwitchCaseStatement.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/SwitchStatement.ts +6 -6
- package/build/libarkts-copy/src/generated/peers/TSAnyKeyword.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSArrayType.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSAsExpression.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/TSBigintKeyword.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSBooleanKeyword.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSClassImplements.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/TSConditionalType.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSConstructorType.ts +6 -6
- package/build/libarkts-copy/src/generated/peers/TSEnumDeclaration.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/TSEnumMember.ts +6 -6
- package/build/libarkts-copy/src/generated/peers/TSExternalModuleReference.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSFunctionType.ts +6 -6
- package/build/libarkts-copy/src/generated/peers/TSImportEqualsDeclaration.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSImportType.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSIndexSignature.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSIndexedAccessType.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSInferType.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSInterfaceBody.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/TSInterfaceDeclaration.ts +10 -10
- package/build/libarkts-copy/src/generated/peers/TSInterfaceHeritage.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/TSIntersectionType.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSLiteralType.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSMappedType.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSMethodSignature.ts +7 -7
- package/build/libarkts-copy/src/generated/peers/TSModuleBlock.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSModuleDeclaration.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSNamedTupleMember.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/TSNeverKeyword.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSNonNullExpression.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/TSNullKeyword.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSNumberKeyword.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSObjectKeyword.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSParameterProperty.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSParenthesizedType.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSPropertySignature.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/TSQualifiedName.ts +7 -7
- package/build/libarkts-copy/src/generated/peers/TSSignatureDeclaration.ts +6 -6
- package/build/libarkts-copy/src/generated/peers/TSStringKeyword.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSThisType.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSTupleType.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSTypeAliasDeclaration.ts +8 -8
- package/build/libarkts-copy/src/generated/peers/TSTypeAssertion.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSTypeLiteral.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSTypeOperator.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSTypeParameter.ts +7 -7
- package/build/libarkts-copy/src/generated/peers/TSTypeParameterDeclaration.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSTypeParameterInstantiation.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSTypePredicate.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSTypeQuery.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSTypeReference.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSUndefinedKeyword.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSUnionType.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSUnknownKeyword.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TSVoidKeyword.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TaggedTemplateExpression.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TemplateElement.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TemplateLiteral.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/ThisExpression.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/ThrowStatement.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/TryStatement.ts +10 -6
- package/build/libarkts-copy/src/generated/peers/TypeNode.ts +2 -3
- package/build/libarkts-copy/src/generated/peers/TypedAstNode.ts +1 -2
- package/build/libarkts-copy/src/generated/peers/TypedStatement.ts +1 -2
- package/build/libarkts-copy/src/generated/peers/TypeofExpression.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/UnaryExpression.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/UndefinedLiteral.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/UpdateExpression.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/VReg.ts +35 -0
- package/build/libarkts-copy/src/generated/peers/ValidationInfo.ts +4 -4
- package/build/libarkts-copy/src/generated/peers/VariableDeclaration.ts +5 -5
- package/build/libarkts-copy/src/generated/peers/VariableDeclarator.ts +7 -7
- package/build/libarkts-copy/src/generated/peers/VerificationContext.ts +35 -0
- package/build/libarkts-copy/src/generated/peers/VerifierMessage.ts +35 -0
- package/build/libarkts-copy/src/generated/peers/WhileStatement.ts +6 -6
- package/build/libarkts-copy/src/generated/peers/YieldExpression.ts +4 -4
- package/build/libarkts-copy/src/index.ts +17 -0
- package/build/libarkts-copy/src/reexport-for-generated.ts +1 -1
- package/build/libarkts-copy/src/utils.ts +307 -9
- package/build/libarkts-copy/tsconfig.json +4 -4
- package/lib/index.js +1516 -1120
- package/package.json +6 -6
- package/templates/factory.ts +0 -1
- package/templates/peer.ts +0 -1
- package/build/libarkts-copy/src/Es2pandaEnums.ts +0 -183
- package/build/libarkts-copy/src/arkts-api/node-utilities/createScriptFunction.ts +0 -55
- package/build/libarkts-copy/src/es2panda.ts +0 -277
- package/build/libarkts-copy/src/generated/node-map.ts +0 -182
- package/build/libarkts-copy/src/generated/peers/ETSLaunchExpression.ts +0 -57
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
## libarkts
|
|
2
|
+
|
|
3
|
+
Wrapper library which provides tsc-like __ArkTS__ compiler API
|
|
4
|
+
|
|
5
|
+
Implemented with koala interop technology
|
|
6
|
+
|
|
7
|
+
### Prerequisites
|
|
8
|
+
|
|
9
|
+
node >= 18
|
|
10
|
+
meson >= 0.62
|
|
11
|
+
|
|
12
|
+
Having following .npmrc: https://gitee.com/openharmony-sig/arkcompiler_ets_frontend/wikis/npmrc
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
cd ~/arkcompiler_ets_frontend
|
|
16
|
+
npm i
|
|
17
|
+
cd ./ui2abc/libarkts/
|
|
18
|
+
npm i
|
|
19
|
+
npm run compile
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Structure
|
|
23
|
+
|
|
24
|
+
- ```compatible``` - __ArkTS__ / __typescript__ plugins
|
|
25
|
+
- ```input``` - code samples to be compiled with __ArkTS__ / __typescript__
|
|
26
|
+
- ```native``` - node module wrapper for __es2panda.so__
|
|
27
|
+
- ```src``` - plugin API sources
|
|
28
|
+
- ```test``` - plugin API tests
|
|
29
|
+
|
|
30
|
+
### How to run
|
|
31
|
+
```
|
|
32
|
+
npm run run
|
|
33
|
+
node build/api/es2panda.js --help
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Runs __ArkTS__ compiler for __./input/main.sts__ invoking plugins specified in __arktsconfig.json__
|
|
@@ -1,47 +1,98 @@
|
|
|
1
1
|
{
|
|
2
|
+
"irHack": [
|
|
3
|
+
"AnnotationUsage",
|
|
4
|
+
"ETSFunctionType",
|
|
5
|
+
"ETSUnionType",
|
|
6
|
+
"ETSNullType",
|
|
7
|
+
"ETSUndefinedType",
|
|
8
|
+
],
|
|
2
9
|
"ignore": {
|
|
3
|
-
"
|
|
4
|
-
"es2panda_Impl"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
10
|
+
"full": [
|
|
11
|
+
"es2panda_Impl",
|
|
12
|
+
"es2panda_Config",
|
|
13
|
+
"es2panda_ExternalSource",
|
|
14
|
+
],
|
|
15
|
+
"partial": [
|
|
16
|
+
{
|
|
17
|
+
interface: "MethodDefinition",
|
|
18
|
+
methods: [
|
|
19
|
+
"GetOverloadInfo", // return type is wrong
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
interface: "AnnotationDeclaration",
|
|
24
|
+
methods: [
|
|
25
|
+
"PropertiesPtrConst" // interfaces create-to-param matching
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
interface: "NumberLiteral",
|
|
30
|
+
methods: [
|
|
31
|
+
"SetInt",
|
|
32
|
+
"SetLong",
|
|
33
|
+
"SetDouble",
|
|
34
|
+
"SetFloat"
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
interface: "AnnotationUsage",
|
|
39
|
+
methods: [
|
|
40
|
+
"PropertiesPtrConst" // interfaces create-to-param matching
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
interface: "TSInterfaceBody",
|
|
45
|
+
methods: [
|
|
46
|
+
"BodyPtr" // interfaces create-to-param matching
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
interface: "Signature",
|
|
51
|
+
methods: [
|
|
52
|
+
"ProtectionFlagConst" // u8
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
interface: "ETSReExportDeclaration",
|
|
57
|
+
methods: [
|
|
58
|
+
"Create", // sequence<String>
|
|
59
|
+
"Update", // sequence<String>
|
|
60
|
+
"GetUserPathsConst" // sequence<String>
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
interface: "CharLiteral",
|
|
65
|
+
methods: [
|
|
66
|
+
"Create1", // KShort,
|
|
67
|
+
"Update1", // KShort
|
|
68
|
+
"CharConst", // KShort
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
interface: "ForUpdateStatement",
|
|
73
|
+
methods: [
|
|
74
|
+
"Update" // forbidden naming
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
interface: "CallExpression",
|
|
79
|
+
methods: [
|
|
80
|
+
"Update" // differs from handwritten
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
interface: "TryStatement",
|
|
85
|
+
methods: [
|
|
86
|
+
"AddFinalizerInsertion" // idl missing const
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
interface: "MemberExpression",
|
|
91
|
+
methods: [
|
|
92
|
+
"SetExtensionAccessorType" // ETSFunction type ambiguity
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
]
|
|
45
96
|
},
|
|
46
97
|
nonNullable: [
|
|
47
98
|
{
|
|
@@ -148,8 +199,26 @@
|
|
|
148
199
|
{
|
|
149
200
|
name: "FunctionConst",
|
|
150
201
|
types: ["returnType"]
|
|
202
|
+
},
|
|
203
|
+
]
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
name: "ETSFunctionType",
|
|
207
|
+
methods: [
|
|
208
|
+
{
|
|
209
|
+
name: "ReturnTypeConst",
|
|
210
|
+
types: ["returnType"]
|
|
211
|
+
}
|
|
212
|
+
]
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
name: "TSTypeAliasDeclaration",
|
|
216
|
+
methods: [
|
|
217
|
+
{
|
|
218
|
+
name: "TypeAnnotationConst",
|
|
219
|
+
types: ["returnType"]
|
|
151
220
|
}
|
|
152
221
|
]
|
|
153
222
|
},
|
|
154
|
-
]
|
|
155
|
-
}
|
|
223
|
+
],
|
|
224
|
+
}
|
|
@@ -53,6 +53,7 @@ KNativePointer impl_AnnotationAllowedAnnotationsConst(KNativePointer contextPtr,
|
|
|
53
53
|
}
|
|
54
54
|
KOALA_INTEROP_3(AnnotationAllowedAnnotationsConst, KNativePointer, KNativePointer, KNativePointer, KNativePointer)
|
|
55
55
|
|
|
56
|
+
/*
|
|
56
57
|
KNativePointer impl_AstNodeVariableConst(KNativePointer contextPtr, KNativePointer nodePtr)
|
|
57
58
|
{
|
|
58
59
|
auto context = reinterpret_cast<es2panda_Context*>(contextPtr);
|
|
@@ -61,6 +62,7 @@ KNativePointer impl_AstNodeVariableConst(KNativePointer contextPtr, KNativePoint
|
|
|
61
62
|
return GetImpl()->AstNodeVariableConst(context, node);
|
|
62
63
|
}
|
|
63
64
|
KOALA_INTEROP_2(AstNodeVariableConst, KNativePointer, KNativePointer, KNativePointer)
|
|
65
|
+
*/
|
|
64
66
|
|
|
65
67
|
KNativePointer impl_VariableDeclaration(KNativePointer contextPtr, KNativePointer variablePtr)
|
|
66
68
|
{
|
|
@@ -80,6 +82,7 @@ KNativePointer impl_DeclNode(KNativePointer contextPtr, KNativePointer declPtr)
|
|
|
80
82
|
}
|
|
81
83
|
KOALA_INTEROP_2(DeclNode, KNativePointer, KNativePointer, KNativePointer)
|
|
82
84
|
|
|
85
|
+
/*
|
|
83
86
|
KNativePointer impl_AstNodeScopeConst(KNativePointer contextPtr, KNativePointer nodePtr)
|
|
84
87
|
{
|
|
85
88
|
auto context = reinterpret_cast<es2panda_Context*>(contextPtr);
|
|
@@ -87,7 +90,7 @@ KNativePointer impl_AstNodeScopeConst(KNativePointer contextPtr, KNativePointer
|
|
|
87
90
|
return GetImpl()->AstNodeScopeConst(context, node);
|
|
88
91
|
}
|
|
89
92
|
KOALA_INTEROP_2(AstNodeScopeConst, KNativePointer, KNativePointer, KNativePointer)
|
|
90
|
-
|
|
93
|
+
*/
|
|
91
94
|
KNativePointer impl_ScopeSetParent(KNativePointer contextPtr, KNativePointer nodePtr, KNativePointer parentPtr)
|
|
92
95
|
{
|
|
93
96
|
auto context = reinterpret_cast<es2panda_Context*>(contextPtr);
|
|
@@ -98,6 +101,7 @@ KNativePointer impl_ScopeSetParent(KNativePointer contextPtr, KNativePointer nod
|
|
|
98
101
|
}
|
|
99
102
|
KOALA_INTEROP_3(ScopeSetParent, KNativePointer, KNativePointer, KNativePointer, KNativePointer)
|
|
100
103
|
|
|
104
|
+
/*
|
|
101
105
|
KNativePointer impl_CreateNumberLiteral(KNativePointer contextPtr, KDouble value)
|
|
102
106
|
{
|
|
103
107
|
auto context = reinterpret_cast<es2panda_Context*>(contextPtr);
|
|
@@ -105,6 +109,7 @@ KNativePointer impl_CreateNumberLiteral(KNativePointer contextPtr, KDouble value
|
|
|
105
109
|
return GetImpl()->CreateNumberLiteral(context, value);
|
|
106
110
|
}
|
|
107
111
|
KOALA_INTEROP_2(CreateNumberLiteral, KNativePointer, KNativePointer, KDouble)
|
|
112
|
+
*/
|
|
108
113
|
|
|
109
114
|
KNativePointer impl_ETSParserCreateExpression(KNativePointer contextPtr, KStringPtr& sourceCodePtr, KInt flagsT)
|
|
110
115
|
{
|
|
@@ -189,6 +194,7 @@ KNativePointer impl_ContextErrorMessage(KNativePointer contextPtr)
|
|
|
189
194
|
}
|
|
190
195
|
KOALA_INTEROP_1(ContextErrorMessage, KNativePointer, KNativePointer)
|
|
191
196
|
|
|
197
|
+
/*
|
|
192
198
|
KNativePointer impl_CallExpressionSignature(KNativePointer context, KNativePointer classInstance)
|
|
193
199
|
{
|
|
194
200
|
const auto _context = reinterpret_cast<es2panda_Context*>(context);
|
|
@@ -197,7 +203,7 @@ KNativePointer impl_CallExpressionSignature(KNativePointer context, KNativePoint
|
|
|
197
203
|
return result;
|
|
198
204
|
}
|
|
199
205
|
KOALA_INTEROP_2(CallExpressionSignature, KNativePointer, KNativePointer, KNativePointer)
|
|
200
|
-
|
|
206
|
+
*/
|
|
201
207
|
KNativePointer impl_SignatureFunction(KNativePointer context, KNativePointer classInstance)
|
|
202
208
|
{
|
|
203
209
|
const auto _context = reinterpret_cast<es2panda_Context*>(context);
|
|
@@ -263,3 +269,65 @@ KBoolean impl_IsETSFunctionType(KNativePointer nodePtr)
|
|
|
263
269
|
return GetImpl()->IsETSFunctionType(node);
|
|
264
270
|
}
|
|
265
271
|
KOALA_INTEROP_1(IsETSFunctionType, KBoolean, KNativePointer)
|
|
272
|
+
|
|
273
|
+
KNativePointer impl_ETSParserBuildImportDeclaration(KNativePointer context, KInt importKinds, KNativePointerArray specifiers, KUInt specifiersSequenceLength, KNativePointer source, KNativePointer program, KInt importFlag)
|
|
274
|
+
{
|
|
275
|
+
const auto _context = reinterpret_cast<es2panda_Context*>(context);
|
|
276
|
+
const auto _kinds = static_cast<Es2pandaImportKinds>(importKinds);
|
|
277
|
+
const auto _specifiers = reinterpret_cast<es2panda_AstNode**>(specifiers);
|
|
278
|
+
const auto _specifiersSequenceLength = static_cast<size_t>(specifiersSequenceLength);
|
|
279
|
+
const auto _source = reinterpret_cast<es2panda_AstNode*>(source);
|
|
280
|
+
const auto _program = reinterpret_cast<es2panda_Program*>(program);
|
|
281
|
+
const auto _importFlag = static_cast<Es2pandaImportFlags>(importFlag);
|
|
282
|
+
|
|
283
|
+
return GetImpl()->ETSParserBuildImportDeclaration(_context, _kinds, _specifiers, _specifiersSequenceLength, _source, _program, _importFlag);
|
|
284
|
+
}
|
|
285
|
+
KOALA_INTEROP_7(ETSParserBuildImportDeclaration, KNativePointer, KNativePointer, KInt, KNativePointerArray, KUInt, KNativePointer, KNativePointer, KInt)
|
|
286
|
+
|
|
287
|
+
void impl_InsertETSImportDeclarationAndParse(KNativePointer context, KNativePointer program, KNativePointer importDeclaration)
|
|
288
|
+
{
|
|
289
|
+
const auto _context = reinterpret_cast<es2panda_Context*>(context);
|
|
290
|
+
const auto _program = reinterpret_cast<es2panda_Program*>(program);
|
|
291
|
+
const auto _import = reinterpret_cast<es2panda_AstNode*>(importDeclaration);
|
|
292
|
+
GetImpl()->InsertETSImportDeclarationAndParse(_context, _program, _import);
|
|
293
|
+
}
|
|
294
|
+
KOALA_INTEROP_V3(InsertETSImportDeclarationAndParse, KNativePointer, KNativePointer, KNativePointer)
|
|
295
|
+
|
|
296
|
+
KNativePointer impl_ETSParserGetImportPathManager(KNativePointer contextPtr)
|
|
297
|
+
{
|
|
298
|
+
auto context = reinterpret_cast<es2panda_Context*>(contextPtr);
|
|
299
|
+
return GetImpl()->ETSParserGetImportPathManager(context);
|
|
300
|
+
}
|
|
301
|
+
KOALA_INTEROP_1(ETSParserGetImportPathManager, KNativePointer, KNativePointer);
|
|
302
|
+
|
|
303
|
+
KNativePointer impl_CreateSourcePosition(KNativePointer context, KInt index, KInt line)
|
|
304
|
+
{
|
|
305
|
+
auto&& _context_ = reinterpret_cast<es2panda_Context *>(context);
|
|
306
|
+
return GetImpl()->CreateSourcePosition(_context_, index, line);
|
|
307
|
+
}
|
|
308
|
+
KOALA_INTEROP_3(CreateSourcePosition, KNativePointer, KNativePointer, KInt, KInt);
|
|
309
|
+
|
|
310
|
+
KInt impl_SourcePositionIndex(KNativePointer context, KNativePointer instance)
|
|
311
|
+
{
|
|
312
|
+
auto&& _context_ = reinterpret_cast<es2panda_Context *>(context);
|
|
313
|
+
auto&& _instance_ = reinterpret_cast<es2panda_SourcePosition *>(instance);
|
|
314
|
+
return GetImpl()->SourcePositionIndex(_context_, _instance_);
|
|
315
|
+
}
|
|
316
|
+
KOALA_INTEROP_2(SourcePositionIndex, KInt, KNativePointer, KNativePointer);
|
|
317
|
+
|
|
318
|
+
KInt impl_SourcePositionLine(KNativePointer context, KNativePointer instance)
|
|
319
|
+
{
|
|
320
|
+
auto&& _context_ = reinterpret_cast<es2panda_Context *>(context);
|
|
321
|
+
auto&& _instance_ = reinterpret_cast<es2panda_SourcePosition *>(instance);
|
|
322
|
+
return GetImpl()->SourcePositionLine(_context_, _instance_);
|
|
323
|
+
}
|
|
324
|
+
KOALA_INTEROP_2(SourcePositionLine, KInt, KNativePointer, KNativePointer);
|
|
325
|
+
|
|
326
|
+
KNativePointer impl_CreateSourceRange(KNativePointer context, KNativePointer start, KNativePointer end)
|
|
327
|
+
{
|
|
328
|
+
auto&& _context_ = reinterpret_cast<es2panda_Context *>(context);
|
|
329
|
+
auto&& _start_ = reinterpret_cast<es2panda_SourcePosition *>(start);
|
|
330
|
+
auto&& _end_ = reinterpret_cast<es2panda_SourcePosition *>(end);
|
|
331
|
+
return GetImpl()->CreateSourceRange(_context_, _start_, _end_);
|
|
332
|
+
}
|
|
333
|
+
KOALA_INTEROP_3(CreateSourceRange, KNativePointer, KNativePointer, KNativePointer, KNativePointer);
|