@idlizer/arktscgen 2.1.10-arktscgen-7 → 2.1.10-arktscgen-10
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 +107 -99
- package/build/libarkts-copy/native/meson.build +22 -14
- package/build/libarkts-copy/native/mingw.cross +1 -1
- package/build/libarkts-copy/native/src/bridges.cpp +1 -298
- package/build/libarkts-copy/native/src/common.cpp +286 -76
- package/build/libarkts-copy/native/src/common.h +0 -15
- package/build/libarkts-copy/package.json +12 -16
- package/build/libarkts-copy/src/Es2pandaNativeModule.ts +28 -61
- package/build/libarkts-copy/src/arkts-api/index.ts +0 -1
- package/build/libarkts-copy/src/arkts-api/node-utilities/OpaqueTypeNode.ts +1 -1
- package/build/libarkts-copy/src/arkts-api/peers/AstNode.ts +14 -0
- package/build/libarkts-copy/src/arkts-api/peers/Context.ts +25 -58
- package/build/libarkts-copy/src/arkts-api/peers/ExternalSource.ts +8 -13
- package/build/libarkts-copy/src/arkts-api/plugins.ts +3 -2
- package/build/libarkts-copy/src/arkts-api/static/global.ts +8 -1
- package/build/libarkts-copy/src/arkts-api/utilities/extensions.ts +9 -12
- package/build/libarkts-copy/src/arkts-api/utilities/performance.ts +99 -9
- package/build/libarkts-copy/src/arkts-api/utilities/private.ts +3 -0
- package/build/libarkts-copy/src/arkts-api/utilities/public.ts +68 -148
- package/build/libarkts-copy/src/arkts-api/visitor.ts +17 -3
- package/build/libarkts-copy/src/index.ts +0 -1
- package/build/libarkts-copy/src/plugin-utils.ts +2 -1
- package/build/libarkts-copy/src/reexport-for-generated.ts +2 -1
- package/build/libarkts-copy/src/utils.ts +4 -0
- package/lib/index.js +4599 -4366
- package/package.json +3 -4
- package/templates/Es2pandaNativeModule.ts +1 -0
- package/templates/peer.ts +1 -0
|
@@ -18,71 +18,11 @@
|
|
|
18
18
|
#include <string>
|
|
19
19
|
|
|
20
20
|
#include "common.h"
|
|
21
|
-
#include "memoryTracker.h"
|
|
22
21
|
|
|
23
22
|
/** XXX: If you add or remove methods that exist in C API,
|
|
24
23
|
* please change generator/options.json5 accordingly.
|
|
25
24
|
*/
|
|
26
25
|
|
|
27
|
-
KNativePointer impl_AstNodeRebind(KNativePointer contextPtr, KNativePointer nodePtr)
|
|
28
|
-
{
|
|
29
|
-
auto context = reinterpret_cast<es2panda_Context*>(contextPtr);
|
|
30
|
-
auto node = reinterpret_cast<es2panda_AstNode*>(nodePtr);
|
|
31
|
-
GetImpl()->AstNodeRebind(context, node);
|
|
32
|
-
return nullptr;
|
|
33
|
-
}
|
|
34
|
-
KOALA_INTEROP_2(AstNodeRebind, KNativePointer, KNativePointer, KNativePointer)
|
|
35
|
-
|
|
36
|
-
KNativePointer impl_AnnotationAllowedAnnotations(
|
|
37
|
-
KNativePointer contextPtr, KNativePointer nodePtr, KNativePointer returnLen)
|
|
38
|
-
{
|
|
39
|
-
auto context = reinterpret_cast<es2panda_Context*>(contextPtr);
|
|
40
|
-
auto node = reinterpret_cast<es2panda_AstNode*>(nodePtr);
|
|
41
|
-
std::size_t params_len = 0;
|
|
42
|
-
auto annotations = GetImpl()->AnnotationAllowedAnnotations(context, node, ¶ms_len);
|
|
43
|
-
return StageArena::CloneVector(annotations, params_len);
|
|
44
|
-
}
|
|
45
|
-
KOALA_INTEROP_3(AnnotationAllowedAnnotations, KNativePointer, KNativePointer, KNativePointer, KNativePointer)
|
|
46
|
-
|
|
47
|
-
KNativePointer impl_AnnotationAllowedAnnotationsConst(
|
|
48
|
-
KNativePointer contextPtr, KNativePointer nodePtr, KNativePointer returnLen)
|
|
49
|
-
{
|
|
50
|
-
auto context = reinterpret_cast<es2panda_Context*>(contextPtr);
|
|
51
|
-
auto node = reinterpret_cast<es2panda_AstNode*>(nodePtr);
|
|
52
|
-
std::size_t params_len = 0;
|
|
53
|
-
auto annotations = GetImpl()->AnnotationAllowedAnnotationsConst(context, node, ¶ms_len);
|
|
54
|
-
return StageArena::CloneVector(annotations, params_len);
|
|
55
|
-
}
|
|
56
|
-
KOALA_INTEROP_3(AnnotationAllowedAnnotationsConst, KNativePointer, KNativePointer, KNativePointer, KNativePointer)
|
|
57
|
-
|
|
58
|
-
KNativePointer impl_VariableDeclaration(KNativePointer contextPtr, KNativePointer variablePtr)
|
|
59
|
-
{
|
|
60
|
-
auto context = reinterpret_cast<es2panda_Context*>(contextPtr);
|
|
61
|
-
auto variable = reinterpret_cast<es2panda_Variable*>(variablePtr);
|
|
62
|
-
|
|
63
|
-
return GetImpl()->VariableDeclaration(context, variable);
|
|
64
|
-
}
|
|
65
|
-
KOALA_INTEROP_2(VariableDeclaration, KNativePointer, KNativePointer, KNativePointer)
|
|
66
|
-
|
|
67
|
-
KNativePointer impl_DeclNode(KNativePointer contextPtr, KNativePointer declPtr)
|
|
68
|
-
{
|
|
69
|
-
auto context = reinterpret_cast<es2panda_Context*>(contextPtr);
|
|
70
|
-
auto decl = reinterpret_cast<es2panda_Declaration*>(declPtr);
|
|
71
|
-
|
|
72
|
-
return GetImpl()->DeclNode(context, decl);
|
|
73
|
-
}
|
|
74
|
-
KOALA_INTEROP_2(DeclNode, KNativePointer, KNativePointer, KNativePointer)
|
|
75
|
-
|
|
76
|
-
KNativePointer impl_ScopeSetParent(KNativePointer contextPtr, KNativePointer nodePtr, KNativePointer parentPtr)
|
|
77
|
-
{
|
|
78
|
-
auto context = reinterpret_cast<es2panda_Context*>(contextPtr);
|
|
79
|
-
auto node = reinterpret_cast<es2panda_Scope*>(nodePtr);
|
|
80
|
-
auto parent = reinterpret_cast<es2panda_Scope*>(parentPtr);
|
|
81
|
-
GetImpl()->ScopeSetParent(context, node, parent);
|
|
82
|
-
return node;
|
|
83
|
-
}
|
|
84
|
-
KOALA_INTEROP_3(ScopeSetParent, KNativePointer, KNativePointer, KNativePointer, KNativePointer)
|
|
85
|
-
|
|
86
26
|
KNativePointer impl_ETSParserCreateExpression(KNativePointer contextPtr, KStringPtr& sourceCodePtr, KInt flagsT)
|
|
87
27
|
{
|
|
88
28
|
auto context = reinterpret_cast<es2panda_Context*>(contextPtr);
|
|
@@ -92,35 +32,6 @@ KNativePointer impl_ETSParserCreateExpression(KNativePointer contextPtr, KString
|
|
|
92
32
|
}
|
|
93
33
|
KOALA_INTEROP_3(ETSParserCreateExpression, KNativePointer, KNativePointer, KStringPtr, KInt)
|
|
94
34
|
|
|
95
|
-
KNativePointer impl_SignatureFunction(KNativePointer context, KNativePointer classInstance)
|
|
96
|
-
{
|
|
97
|
-
const auto _context = reinterpret_cast<es2panda_Context*>(context);
|
|
98
|
-
const auto _classInstance = reinterpret_cast<es2panda_Signature*>(classInstance);
|
|
99
|
-
const auto result = GetImpl()->SignatureFunction(_context, _classInstance);
|
|
100
|
-
return result;
|
|
101
|
-
}
|
|
102
|
-
KOALA_INTEROP_2(SignatureFunction, KNativePointer, KNativePointer, KNativePointer)
|
|
103
|
-
|
|
104
|
-
static KNativePointer impl_ProgramExternalSources(KNativePointer contextPtr, KNativePointer instancePtr)
|
|
105
|
-
{
|
|
106
|
-
auto context = reinterpret_cast<es2panda_Context*>(contextPtr);
|
|
107
|
-
auto&& instance = reinterpret_cast<es2panda_Program*>(instancePtr);
|
|
108
|
-
std::size_t source_len = 0;
|
|
109
|
-
auto external_sources = GetImpl()->ProgramExternalSources(context, instance, &source_len);
|
|
110
|
-
return StageArena::CloneVector(external_sources, source_len);
|
|
111
|
-
}
|
|
112
|
-
KOALA_INTEROP_2(ProgramExternalSources, KNativePointer, KNativePointer, KNativePointer);
|
|
113
|
-
|
|
114
|
-
static KNativePointer impl_ProgramDirectExternalSources(KNativePointer contextPtr, KNativePointer instancePtr)
|
|
115
|
-
{
|
|
116
|
-
auto context = reinterpret_cast<es2panda_Context*>(contextPtr);
|
|
117
|
-
auto&& instance = reinterpret_cast<es2panda_Program*>(instancePtr);
|
|
118
|
-
std::size_t sourceLen = 0;
|
|
119
|
-
auto externalSources = GetImpl()->ProgramDirectExternalSources(context, instance, &sourceLen);
|
|
120
|
-
return new std::vector<void*>(externalSources, externalSources + sourceLen);
|
|
121
|
-
}
|
|
122
|
-
KOALA_INTEROP_2(ProgramDirectExternalSources, KNativePointer, KNativePointer, KNativePointer);
|
|
123
|
-
|
|
124
35
|
static KNativePointer impl_ProgramSourceFilePath(KNativePointer contextPtr, KNativePointer instancePtr)
|
|
125
36
|
{
|
|
126
37
|
auto context = reinterpret_cast<es2panda_Context*>(contextPtr);
|
|
@@ -130,23 +41,6 @@ static KNativePointer impl_ProgramSourceFilePath(KNativePointer contextPtr, KNat
|
|
|
130
41
|
}
|
|
131
42
|
KOALA_INTEROP_2(ProgramSourceFilePath, KNativePointer, KNativePointer, KNativePointer);
|
|
132
43
|
|
|
133
|
-
static KNativePointer impl_ExternalSourceName(KNativePointer instance)
|
|
134
|
-
{
|
|
135
|
-
auto&& _instance_ = reinterpret_cast<es2panda_ExternalSource*>(instance);
|
|
136
|
-
auto&& result = GetImpl()->ExternalSourceName(_instance_);
|
|
137
|
-
return StageArena::Strdup(result);
|
|
138
|
-
}
|
|
139
|
-
KOALA_INTEROP_1(ExternalSourceName, KNativePointer, KNativePointer);
|
|
140
|
-
|
|
141
|
-
static KNativePointer impl_ExternalSourcePrograms(KNativePointer instance)
|
|
142
|
-
{
|
|
143
|
-
auto&& _instance_ = reinterpret_cast<es2panda_ExternalSource*>(instance);
|
|
144
|
-
std::size_t program_len = 0;
|
|
145
|
-
auto programs = GetImpl()->ExternalSourcePrograms(_instance_, &program_len);
|
|
146
|
-
return StageArena::CloneVector(programs, program_len);
|
|
147
|
-
}
|
|
148
|
-
KOALA_INTEROP_1(ExternalSourcePrograms, KNativePointer, KNativePointer);
|
|
149
|
-
|
|
150
44
|
KNativePointer impl_ETSParserBuildImportDeclaration(KNativePointer context, KInt importKinds,
|
|
151
45
|
KNativePointerArray specifiers, KUInt specifiersSequenceLength, KNativePointer source, KNativePointer program,
|
|
152
46
|
KInt importFlag)
|
|
@@ -197,104 +91,6 @@ KNativePointer impl_OptionsArkTsConfig(KNativePointer context, KNativePointer op
|
|
|
197
91
|
}
|
|
198
92
|
KOALA_INTEROP_2(OptionsArkTsConfig, KNativePointer, KNativePointer, KNativePointer)
|
|
199
93
|
|
|
200
|
-
// All these "Checker_" bridges are related to checker namespace in es2panda, so work with them carefully
|
|
201
|
-
// Checker.Type does reset on recheck, so modifying them makes no sence
|
|
202
|
-
// It seems that compiler does not provide API to convert Checker.Type to ir.Type
|
|
203
|
-
KNativePointer impl_Checker_CreateOpaqueTypeNode(KNativePointer context, KNativePointer type)
|
|
204
|
-
{
|
|
205
|
-
auto _context = reinterpret_cast<es2panda_Context*>(context);
|
|
206
|
-
auto _type = reinterpret_cast<es2panda_Type*>(type);
|
|
207
|
-
return GetImpl()->CreateOpaqueTypeNode(_context, _type);
|
|
208
|
-
}
|
|
209
|
-
KOALA_INTEROP_2(Checker_CreateOpaqueTypeNode, KNativePointer, KNativePointer, KNativePointer)
|
|
210
|
-
|
|
211
|
-
KNativePointer impl_Checker_ScriptFunctionSignature(KNativePointer context, KNativePointer node)
|
|
212
|
-
{
|
|
213
|
-
auto _context = reinterpret_cast<es2panda_Context*>(context);
|
|
214
|
-
auto _node = reinterpret_cast<es2panda_AstNode*>(node);
|
|
215
|
-
return GetImpl()->ScriptFunctionSignature(_context, _node);
|
|
216
|
-
}
|
|
217
|
-
KOALA_INTEROP_2(Checker_ScriptFunctionSignature, KNativePointer, KNativePointer, KNativePointer)
|
|
218
|
-
|
|
219
|
-
void impl_Checker_ScriptFunctionSetSignature(KNativePointer context, KNativePointer node, KNativePointer signature)
|
|
220
|
-
{
|
|
221
|
-
auto _context = reinterpret_cast<es2panda_Context*>(context);
|
|
222
|
-
auto _node = reinterpret_cast<es2panda_AstNode*>(node);
|
|
223
|
-
auto _signature = reinterpret_cast<es2panda_Signature*>(signature);
|
|
224
|
-
GetImpl()->ScriptFunctionSetSignature(_context, _node, _signature);
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
KOALA_INTEROP_V3(Checker_ScriptFunctionSetSignature, KNativePointer, KNativePointer, KNativePointer)
|
|
228
|
-
|
|
229
|
-
KNativePointer impl_Checker_SignatureReturnType(KNativePointer context, KNativePointer signature)
|
|
230
|
-
{
|
|
231
|
-
auto _context = reinterpret_cast<es2panda_Context*>(context);
|
|
232
|
-
auto _signature = reinterpret_cast<es2panda_Signature*>(signature);
|
|
233
|
-
return GetImpl()->SignatureReturnType(_context, _signature);
|
|
234
|
-
}
|
|
235
|
-
KOALA_INTEROP_2(Checker_SignatureReturnType, KNativePointer, KNativePointer, KNativePointer)
|
|
236
|
-
|
|
237
|
-
KNativePointer impl_Checker_ScriptFunctionGetPreferredReturnType(KNativePointer context, KNativePointer node)
|
|
238
|
-
{
|
|
239
|
-
auto _context = reinterpret_cast<es2panda_Context*>(context);
|
|
240
|
-
auto _node = reinterpret_cast<es2panda_AstNode*>(node);
|
|
241
|
-
return GetImpl()->ScriptFunctionGetPreferredReturnType(_context, _node);
|
|
242
|
-
}
|
|
243
|
-
KOALA_INTEROP_2(Checker_ScriptFunctionGetPreferredReturnType, KNativePointer, KNativePointer, KNativePointer)
|
|
244
|
-
|
|
245
|
-
void impl_Checker_ScriptFunctionSetPreferredReturnType(KNativePointer context, KNativePointer node, KNativePointer type)
|
|
246
|
-
{
|
|
247
|
-
auto _context = reinterpret_cast<es2panda_Context*>(context);
|
|
248
|
-
auto _node = reinterpret_cast<es2panda_AstNode*>(node);
|
|
249
|
-
auto _type = reinterpret_cast<es2panda_Type*>(type);
|
|
250
|
-
GetImpl()->ScriptFunctionSetPreferredReturnType(_context, _node, _type);
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
KOALA_INTEROP_V3(Checker_ScriptFunctionSetPreferredReturnType, KNativePointer, KNativePointer, KNativePointer)
|
|
254
|
-
|
|
255
|
-
KNativePointer impl_Checker_ExpressionGetPreferredType(KNativePointer context, KNativePointer node)
|
|
256
|
-
{
|
|
257
|
-
auto _context = reinterpret_cast<es2panda_Context*>(context);
|
|
258
|
-
auto _node = reinterpret_cast<es2panda_AstNode*>(node);
|
|
259
|
-
return GetImpl()->ExpressionPreferredTypeConst(_context, _node);
|
|
260
|
-
}
|
|
261
|
-
KOALA_INTEROP_2(Checker_ExpressionGetPreferredType, KNativePointer, KNativePointer, KNativePointer)
|
|
262
|
-
|
|
263
|
-
void impl_Checker_ExpressionSetPreferredType(KNativePointer context, KNativePointer node, KNativePointer type)
|
|
264
|
-
{
|
|
265
|
-
auto _context = reinterpret_cast<es2panda_Context*>(context);
|
|
266
|
-
auto _node = reinterpret_cast<es2panda_AstNode*>(node);
|
|
267
|
-
auto _type = reinterpret_cast<es2panda_Type*>(type);
|
|
268
|
-
GetImpl()->ExpressionSetPreferredType(_context, _node, _type);
|
|
269
|
-
return;
|
|
270
|
-
}
|
|
271
|
-
KOALA_INTEROP_V3(Checker_ExpressionSetPreferredType, KNativePointer, KNativePointer, KNativePointer)
|
|
272
|
-
|
|
273
|
-
KNativePointer impl_Checker_TypeToString(KNativePointer context, KNativePointer type)
|
|
274
|
-
{
|
|
275
|
-
auto _context = reinterpret_cast<es2panda_Context*>(context);
|
|
276
|
-
auto _type = reinterpret_cast<es2panda_Type*>(type);
|
|
277
|
-
auto result = GetImpl()->TypeToStringConst(_context, _type);
|
|
278
|
-
return StageArena::Strdup(result);
|
|
279
|
-
}
|
|
280
|
-
KOALA_INTEROP_2(Checker_TypeToString, KNativePointer, KNativePointer, KNativePointer)
|
|
281
|
-
|
|
282
|
-
KNativePointer impl_Checker_TypeClone(KNativePointer context, KNativePointer type)
|
|
283
|
-
{
|
|
284
|
-
auto _context = reinterpret_cast<es2panda_Context*>(context);
|
|
285
|
-
auto _type = reinterpret_cast<es2panda_Type*>(type);
|
|
286
|
-
return GetImpl()->TypeClone(_context, _type);
|
|
287
|
-
}
|
|
288
|
-
KOALA_INTEROP_2(Checker_TypeClone, KNativePointer, KNativePointer, KNativePointer)
|
|
289
|
-
|
|
290
|
-
KNativePointer impl_Checker_TypeNodeGetType(KNativePointer context, KNativePointer astNode)
|
|
291
|
-
{
|
|
292
|
-
auto _context = reinterpret_cast<es2panda_Context*>(context);
|
|
293
|
-
auto _astNode = reinterpret_cast<es2panda_AstNode*>(astNode);
|
|
294
|
-
return GetImpl()->TypeNodeGetType(_context, _astNode);
|
|
295
|
-
}
|
|
296
|
-
KOALA_INTEROP_2(Checker_TypeNodeGetType, KNativePointer, KNativePointer, KNativePointer)
|
|
297
|
-
|
|
298
94
|
// From koala-wrapper
|
|
299
95
|
// Improve: check if some code should be generated
|
|
300
96
|
|
|
@@ -322,50 +118,11 @@ KBoolean impl_HasGlobalStructInfo(KNativePointer contextPtr, KStringPtr& instanc
|
|
|
322
118
|
}
|
|
323
119
|
KOALA_INTEROP_2(HasGlobalStructInfo, KBoolean, KNativePointer, KStringPtr);
|
|
324
120
|
|
|
325
|
-
KNativePointer impl_ClassVariableDeclaration(KNativePointer context, KNativePointer classInstance)
|
|
326
|
-
{
|
|
327
|
-
const auto _context = reinterpret_cast<es2panda_Context*>(context);
|
|
328
|
-
const auto _classInstance = reinterpret_cast<es2panda_AstNode*>(classInstance);
|
|
329
|
-
auto _typedTsType = GetImpl()->TypedTsType(_context, _classInstance);
|
|
330
|
-
if (_typedTsType == nullptr) {
|
|
331
|
-
return nullptr;
|
|
332
|
-
}
|
|
333
|
-
const auto _instanceType = reinterpret_cast<es2panda_Type*>(_typedTsType);
|
|
334
|
-
auto _typeVar = GetImpl()->TypeVariable(_context, _instanceType);
|
|
335
|
-
if (_typeVar == nullptr) {
|
|
336
|
-
return nullptr;
|
|
337
|
-
}
|
|
338
|
-
const auto result = reinterpret_cast<es2panda_Declaration*>(GetImpl()->VariableDeclaration(_context, _typeVar));
|
|
339
|
-
const auto declNode = GetImpl()->DeclNode(_context, result);
|
|
340
|
-
return declNode;
|
|
341
|
-
}
|
|
342
|
-
KOALA_INTEROP_2(ClassVariableDeclaration, KNativePointer, KNativePointer, KNativePointer)
|
|
343
|
-
|
|
344
|
-
KNativePointer impl_TSInterfaceBodyBodyPtr(KNativePointer context, KNativePointer receiver)
|
|
345
|
-
{
|
|
346
|
-
const auto _context = reinterpret_cast<es2panda_Context*>(context);
|
|
347
|
-
const auto _receiver = reinterpret_cast<es2panda_AstNode*>(receiver);
|
|
348
|
-
std::size_t length;
|
|
349
|
-
auto result = GetImpl()->TSInterfaceBodyBodyPtr(_context, _receiver, &length);
|
|
350
|
-
return StageArena::CloneVector(result, length);
|
|
351
|
-
}
|
|
352
|
-
KOALA_INTEROP_2(TSInterfaceBodyBodyPtr, KNativePointer, KNativePointer, KNativePointer);
|
|
353
|
-
|
|
354
|
-
KNativePointer impl_AnnotationDeclarationPropertiesPtrConst(KNativePointer context, KNativePointer receiver)
|
|
355
|
-
{
|
|
356
|
-
const auto _context = reinterpret_cast<es2panda_Context*>(context);
|
|
357
|
-
const auto _receiver = reinterpret_cast<es2panda_AstNode*>(receiver);
|
|
358
|
-
std::size_t length;
|
|
359
|
-
auto result = GetImpl()->AnnotationDeclarationPropertiesPtrConst(_context, _receiver, &length);
|
|
360
|
-
return StageArena::CloneVector(result, length);
|
|
361
|
-
}
|
|
362
|
-
KOALA_INTEROP_2(AnnotationDeclarationPropertiesPtrConst, KNativePointer, KNativePointer, KNativePointer);
|
|
363
|
-
|
|
364
121
|
KNativePointer impl_ETSParserGetGlobalProgramAbsName(KNativePointer contextPtr)
|
|
365
122
|
{
|
|
366
123
|
auto context = reinterpret_cast<es2panda_Context*>(contextPtr);
|
|
367
124
|
auto result = GetImpl()->ETSParserGetGlobalProgramAbsName(context);
|
|
368
|
-
return new std::string(result);
|
|
125
|
+
return new std::string(result); // O_o
|
|
369
126
|
}
|
|
370
127
|
KOALA_INTEROP_1(ETSParserGetGlobalProgramAbsName, KNativePointer, KNativePointer)
|
|
371
128
|
|
|
@@ -378,16 +135,6 @@ KNativePointer impl_CreateDiagnosticKind(KNativePointer context, KStringPtr& mes
|
|
|
378
135
|
}
|
|
379
136
|
KOALA_INTEROP_3(CreateDiagnosticKind, KNativePointer, KNativePointer, KStringPtr, KInt)
|
|
380
137
|
|
|
381
|
-
void impl_LogDiagnostic(
|
|
382
|
-
KNativePointer context, KNativePointer kind, KStringArray& argvPtr, KInt argc, KNativePointer pos)
|
|
383
|
-
{
|
|
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_);
|
|
388
|
-
}
|
|
389
|
-
KOALA_INTEROP_V5(LogDiagnostic, KNativePointer, KNativePointer, KStringArray, KInt, KNativePointer)
|
|
390
|
-
|
|
391
138
|
KNativePointer impl_AnnotationUsageIrPropertiesPtrConst(KNativePointer context, KNativePointer receiver)
|
|
392
139
|
{
|
|
393
140
|
const auto _context = reinterpret_cast<es2panda_Context*>(context);
|
|
@@ -397,47 +144,3 @@ KNativePointer impl_AnnotationUsageIrPropertiesPtrConst(KNativePointer context,
|
|
|
397
144
|
return StageArena::CloneVector(result, length);
|
|
398
145
|
}
|
|
399
146
|
KOALA_INTEROP_2(AnnotationUsageIrPropertiesPtrConst, KNativePointer, KNativePointer, KNativePointer);
|
|
400
|
-
|
|
401
|
-
KInt impl_GetCompilationMode(KNativePointer configPtr)
|
|
402
|
-
{
|
|
403
|
-
auto _config = reinterpret_cast<es2panda_Config*>(configPtr);
|
|
404
|
-
auto _options = const_cast<es2panda_Options*>(GetImpl()->ConfigGetOptions(_config));
|
|
405
|
-
return GetImpl()->OptionsUtilGetCompilationModeConst(nullptr, _options);
|
|
406
|
-
}
|
|
407
|
-
KOALA_INTEROP_1(GetCompilationMode, KInt, KNativePointer)
|
|
408
|
-
|
|
409
|
-
KNativePointer impl_CreateTypeNodeFromTsType(KNativePointer context, KNativePointer nodePtr)
|
|
410
|
-
{
|
|
411
|
-
const auto _context = reinterpret_cast<es2panda_Context*>(context);
|
|
412
|
-
const auto _nodePtr = reinterpret_cast<es2panda_AstNode*>(nodePtr);
|
|
413
|
-
auto _tsType = GetImpl()->TypedTsType(_context, _nodePtr);
|
|
414
|
-
if (_tsType == nullptr) {
|
|
415
|
-
_tsType = GetImpl()->ExpressionTsType(_context, _nodePtr);
|
|
416
|
-
}
|
|
417
|
-
if (_tsType == nullptr) {
|
|
418
|
-
return nullptr;
|
|
419
|
-
}
|
|
420
|
-
const auto _nodeTsType = reinterpret_cast<es2panda_Type*>(_tsType);
|
|
421
|
-
auto _typeAnnotation = GetImpl()->CreateOpaqueTypeNode(_context, _nodeTsType);
|
|
422
|
-
return _typeAnnotation;
|
|
423
|
-
}
|
|
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);
|