@abaplint/transpiler-cli 2.10.83 → 2.11.1
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/bundle.js +141 -20
- package/package.json +3 -3
package/build/bundle.js
CHANGED
|
@@ -19800,6 +19800,12 @@ class BuiltInMethod extends _identifier_1.Identifier {
|
|
|
19800
19800
|
getAll() {
|
|
19801
19801
|
throw new Error("BuiltInMethod->getAll, Method not implemented");
|
|
19802
19802
|
}
|
|
19803
|
+
getEventName() {
|
|
19804
|
+
return undefined;
|
|
19805
|
+
}
|
|
19806
|
+
getEventClass() {
|
|
19807
|
+
return undefined;
|
|
19808
|
+
}
|
|
19803
19809
|
getImporting() {
|
|
19804
19810
|
const ret = [];
|
|
19805
19811
|
for (const i in this.method.mandatory) {
|
|
@@ -38747,10 +38753,14 @@ class EventDefinition extends _identifier_1.Identifier {
|
|
|
38747
38753
|
super(found.getFirstToken(), input.filename);
|
|
38748
38754
|
this.parameters = [];
|
|
38749
38755
|
this.parse(node, input);
|
|
38756
|
+
this.is_static = node.getFirstToken().getStr().toUpperCase() === "CLASS";
|
|
38750
38757
|
}
|
|
38751
38758
|
getParameters() {
|
|
38752
38759
|
return this.parameters;
|
|
38753
38760
|
}
|
|
38761
|
+
isStatic() {
|
|
38762
|
+
return this.is_static;
|
|
38763
|
+
}
|
|
38754
38764
|
///////////////
|
|
38755
38765
|
parse(node, input) {
|
|
38756
38766
|
for (const e of node.findAllExpressions(expressions_1.MethodParam)) {
|
|
@@ -39170,7 +39180,7 @@ const _reference_1 = __webpack_require__(/*! ../5_syntax/_reference */ "./node_m
|
|
|
39170
39180
|
class MethodDefinition extends _identifier_1.Identifier {
|
|
39171
39181
|
// todo: final flag
|
|
39172
39182
|
constructor(node, visibility, input) {
|
|
39173
|
-
var _a, _b;
|
|
39183
|
+
var _a, _b, _c, _d;
|
|
39174
39184
|
if (!(node.get() instanceof statements_1.MethodDef)) {
|
|
39175
39185
|
throw new Error("MethodDefinition, expected MethodDef as part of input node");
|
|
39176
39186
|
}
|
|
@@ -39192,8 +39202,11 @@ class MethodDefinition extends _identifier_1.Identifier {
|
|
|
39192
39202
|
}
|
|
39193
39203
|
}
|
|
39194
39204
|
this.eventHandler = false;
|
|
39195
|
-
|
|
39205
|
+
const handler = node.findDirectExpression(Expressions.EventHandler);
|
|
39206
|
+
if (handler) {
|
|
39196
39207
|
this.eventHandler = true;
|
|
39208
|
+
this.eventName = (_a = handler.findDirectExpression(Expressions.EventName)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();
|
|
39209
|
+
this.eventClass = (_b = handler.findDirectExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase();
|
|
39197
39210
|
}
|
|
39198
39211
|
this.abstract = false;
|
|
39199
39212
|
if (node.findDirectExpression(Expressions.Abstract)) {
|
|
@@ -39205,7 +39218,7 @@ class MethodDefinition extends _identifier_1.Identifier {
|
|
|
39205
39218
|
this.static = true;
|
|
39206
39219
|
}
|
|
39207
39220
|
this.raising = [];
|
|
39208
|
-
for (const r of ((
|
|
39221
|
+
for (const r of ((_c = node.findDirectExpression(Expressions.MethodDefRaising)) === null || _c === void 0 ? void 0 : _c.findAllExpressions(Expressions.ClassName)) || []) {
|
|
39209
39222
|
const token = r.getFirstToken();
|
|
39210
39223
|
const name = token.getStr();
|
|
39211
39224
|
this.raising.push(name);
|
|
@@ -39221,7 +39234,7 @@ class MethodDefinition extends _identifier_1.Identifier {
|
|
|
39221
39234
|
}
|
|
39222
39235
|
}
|
|
39223
39236
|
this.exceptions = [];
|
|
39224
|
-
for (const r of ((
|
|
39237
|
+
for (const r of ((_d = node.findDirectExpression(Expressions.MethodDefExceptions)) === null || _d === void 0 ? void 0 : _d.findAllExpressions(Expressions.NamespaceSimpleName)) || []) {
|
|
39225
39238
|
const token = r.getFirstToken();
|
|
39226
39239
|
const name = token.getStr();
|
|
39227
39240
|
this.exceptions.push(name);
|
|
@@ -39247,6 +39260,12 @@ class MethodDefinition extends _identifier_1.Identifier {
|
|
|
39247
39260
|
isEventHandler() {
|
|
39248
39261
|
return this.eventHandler;
|
|
39249
39262
|
}
|
|
39263
|
+
getEventName() {
|
|
39264
|
+
return this.eventName;
|
|
39265
|
+
}
|
|
39266
|
+
getEventClass() {
|
|
39267
|
+
return this.eventClass;
|
|
39268
|
+
}
|
|
39250
39269
|
getParameters() {
|
|
39251
39270
|
return this.parameters;
|
|
39252
39271
|
}
|
|
@@ -53585,7 +53604,7 @@ class Registry {
|
|
|
53585
53604
|
}
|
|
53586
53605
|
static abaplintVersion() {
|
|
53587
53606
|
// magic, see build script "version.sh"
|
|
53588
|
-
return "2.113.
|
|
53607
|
+
return "2.113.151";
|
|
53589
53608
|
}
|
|
53590
53609
|
getDDICReferences() {
|
|
53591
53610
|
return this.ddicReferences;
|
|
@@ -77305,8 +77324,9 @@ abaplint:
|
|
|
77305
77324
|
*/
|
|
77306
77325
|
// Keeps track of source maps as generated code is added
|
|
77307
77326
|
class Chunk {
|
|
77327
|
+
raw;
|
|
77328
|
+
mappings = [];
|
|
77308
77329
|
constructor(str) {
|
|
77309
|
-
this.mappings = [];
|
|
77310
77330
|
this.raw = "";
|
|
77311
77331
|
this.mappings = [];
|
|
77312
77332
|
if (str) {
|
|
@@ -77456,6 +77476,7 @@ const snowflake_database_schema_1 = __webpack_require__(/*! ./schema_generation/
|
|
|
77456
77476
|
// Postgres is case sensitive, so all column names should be lower case
|
|
77457
77477
|
// Sqlite escapes field names with single qoute, postgres with double
|
|
77458
77478
|
class DatabaseSetup {
|
|
77479
|
+
reg;
|
|
77459
77480
|
constructor(reg) {
|
|
77460
77481
|
this.reg = reg;
|
|
77461
77482
|
}
|
|
@@ -77570,6 +77591,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
77570
77591
|
exports.PGDatabaseSchema = void 0;
|
|
77571
77592
|
const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
|
|
77572
77593
|
class PGDatabaseSchema {
|
|
77594
|
+
reg;
|
|
77573
77595
|
constructor(reg) {
|
|
77574
77596
|
this.reg = reg;
|
|
77575
77597
|
}
|
|
@@ -77681,6 +77703,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
77681
77703
|
exports.SnowflakeDatabaseSchema = void 0;
|
|
77682
77704
|
const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
|
|
77683
77705
|
class SnowflakeDatabaseSchema {
|
|
77706
|
+
reg;
|
|
77684
77707
|
constructor(reg) {
|
|
77685
77708
|
this.reg = reg;
|
|
77686
77709
|
}
|
|
@@ -77793,6 +77816,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
77793
77816
|
exports.SQLiteDatabaseSchema = void 0;
|
|
77794
77817
|
const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
|
|
77795
77818
|
class SQLiteDatabaseSchema {
|
|
77819
|
+
reg;
|
|
77796
77820
|
constructor(reg) {
|
|
77797
77821
|
this.reg = reg;
|
|
77798
77822
|
}
|
|
@@ -78290,8 +78314,8 @@ const traversal_1 = __webpack_require__(/*! ../traversal */ "./node_modules/@aba
|
|
|
78290
78314
|
const field_length_1 = __webpack_require__(/*! ./field_length */ "./node_modules/@abaplint/transpiler/build/src/expressions/field_length.js");
|
|
78291
78315
|
const field_offset_1 = __webpack_require__(/*! ./field_offset */ "./node_modules/@abaplint/transpiler/build/src/expressions/field_offset.js");
|
|
78292
78316
|
class ComponentChainSimpleTranspiler {
|
|
78317
|
+
prefix = "";
|
|
78293
78318
|
constructor(prefix = "") {
|
|
78294
|
-
this.prefix = "";
|
|
78295
78319
|
this.prefix = prefix;
|
|
78296
78320
|
}
|
|
78297
78321
|
transpile(node, traversal) {
|
|
@@ -78577,6 +78601,7 @@ exports.ConstantTranspiler = void 0;
|
|
|
78577
78601
|
const core_1 = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
|
|
78578
78602
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
78579
78603
|
class ConstantTranspiler {
|
|
78604
|
+
addGet;
|
|
78580
78605
|
constructor(addGet = false) {
|
|
78581
78606
|
this.addGet = addGet;
|
|
78582
78607
|
}
|
|
@@ -78712,6 +78737,7 @@ exports.DatabaseTableTranspiler = void 0;
|
|
|
78712
78737
|
const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
|
|
78713
78738
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
78714
78739
|
class DatabaseTableTranspiler {
|
|
78740
|
+
prefix;
|
|
78715
78741
|
constructor(prefix = true) {
|
|
78716
78742
|
this.prefix = prefix;
|
|
78717
78743
|
}
|
|
@@ -78764,6 +78790,8 @@ const field_symbol_1 = __webpack_require__(/*! ./field_symbol */ "./node_modules
|
|
|
78764
78790
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
78765
78791
|
const feature_flags_1 = __webpack_require__(/*! ../feature_flags */ "./node_modules/@abaplint/transpiler/build/src/feature_flags.js");
|
|
78766
78792
|
class FieldChainTranspiler {
|
|
78793
|
+
addGet;
|
|
78794
|
+
addGetOffset;
|
|
78767
78795
|
constructor(addGet = false) {
|
|
78768
78796
|
this.addGet = addGet;
|
|
78769
78797
|
}
|
|
@@ -79230,6 +79258,7 @@ const core_1 = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abapli
|
|
|
79230
79258
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
79231
79259
|
const method_call_param_1 = __webpack_require__(/*! ./method_call_param */ "./node_modules/@abaplint/transpiler/build/src/expressions/method_call_param.js");
|
|
79232
79260
|
class MethodCallBodyTranspiler {
|
|
79261
|
+
m;
|
|
79233
79262
|
constructor(m) {
|
|
79234
79263
|
this.m = m;
|
|
79235
79264
|
}
|
|
@@ -79355,6 +79384,7 @@ exports.MethodCallParamTranspiler = void 0;
|
|
|
79355
79384
|
const core_1 = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
|
|
79356
79385
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
79357
79386
|
class MethodCallParamTranspiler {
|
|
79387
|
+
m;
|
|
79358
79388
|
constructor(m) {
|
|
79359
79389
|
this.m = m;
|
|
79360
79390
|
}
|
|
@@ -79462,6 +79492,7 @@ const traversal_1 = __webpack_require__(/*! ../traversal */ "./node_modules/@aba
|
|
|
79462
79492
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
79463
79493
|
const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/transpiler/build/src/expressions/index.js");
|
|
79464
79494
|
class MethodSourceTranspiler {
|
|
79495
|
+
prepend;
|
|
79465
79496
|
constructor(prepend) {
|
|
79466
79497
|
this.prepend = (prepend || "") + "await ";
|
|
79467
79498
|
}
|
|
@@ -79782,6 +79813,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
79782
79813
|
exports.SimpleSource3Transpiler = void 0;
|
|
79783
79814
|
const source_1 = __webpack_require__(/*! ./source */ "./node_modules/@abaplint/transpiler/build/src/expressions/source.js");
|
|
79784
79815
|
class SimpleSource3Transpiler {
|
|
79816
|
+
addGet;
|
|
79785
79817
|
constructor(addGet = false) {
|
|
79786
79818
|
this.addGet = addGet;
|
|
79787
79819
|
}
|
|
@@ -79830,6 +79862,7 @@ const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/transpiler/bui
|
|
|
79830
79862
|
const constant_1 = __webpack_require__(/*! ./constant */ "./node_modules/@abaplint/transpiler/build/src/expressions/constant.js");
|
|
79831
79863
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
79832
79864
|
class SourceTranspiler {
|
|
79865
|
+
addGet;
|
|
79833
79866
|
constructor(addGet = false) {
|
|
79834
79867
|
this.addGet = addGet;
|
|
79835
79868
|
}
|
|
@@ -80889,6 +80922,7 @@ const requires_1 = __webpack_require__(/*! ../requires */ "./node_modules/@abapl
|
|
|
80889
80922
|
const rearranger_1 = __webpack_require__(/*! ../rearranger */ "./node_modules/@abaplint/transpiler/build/src/rearranger.js");
|
|
80890
80923
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
80891
80924
|
class HandleABAP {
|
|
80925
|
+
options;
|
|
80892
80926
|
constructor(options) {
|
|
80893
80927
|
this.options = options;
|
|
80894
80928
|
}
|
|
@@ -81144,6 +81178,7 @@ const traversal_1 = __webpack_require__(/*! ../traversal */ "./node_modules/@aba
|
|
|
81144
81178
|
const rearranger_1 = __webpack_require__(/*! ../rearranger */ "./node_modules/@abaplint/transpiler/build/src/rearranger.js");
|
|
81145
81179
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
81146
81180
|
class HandleFUGR {
|
|
81181
|
+
options;
|
|
81147
81182
|
constructor(options) {
|
|
81148
81183
|
this.options = options;
|
|
81149
81184
|
}
|
|
@@ -81592,6 +81627,7 @@ const handle_oa2p_1 = __webpack_require__(/*! ./handlers/handle_oa2p */ "./node_
|
|
|
81592
81627
|
const handle_fugr_1 = __webpack_require__(/*! ./handlers/handle_fugr */ "./node_modules/@abaplint/transpiler/build/src/handlers/handle_fugr.js");
|
|
81593
81628
|
const initialization_1 = __webpack_require__(/*! ./initialization */ "./node_modules/@abaplint/transpiler/build/src/initialization.js");
|
|
81594
81629
|
class Transpiler {
|
|
81630
|
+
options;
|
|
81595
81631
|
constructor(options) {
|
|
81596
81632
|
this.options = options;
|
|
81597
81633
|
if (this.options === undefined) {
|
|
@@ -81977,6 +82013,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
81977
82013
|
exports.Requires = void 0;
|
|
81978
82014
|
const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
|
|
81979
82015
|
class Requires {
|
|
82016
|
+
reg;
|
|
81980
82017
|
constructor(reg) {
|
|
81981
82018
|
this.reg = reg;
|
|
81982
82019
|
}
|
|
@@ -83803,6 +83840,7 @@ const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/
|
|
|
83803
83840
|
const unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ "./node_modules/@abaplint/transpiler/build/src/unique_identifier.js");
|
|
83804
83841
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
83805
83842
|
class DoTranspiler {
|
|
83843
|
+
syIndexBackup;
|
|
83806
83844
|
constructor(syIndexBackup) {
|
|
83807
83845
|
this.syIndexBackup = syIndexBackup;
|
|
83808
83846
|
}
|
|
@@ -83977,6 +84015,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
83977
84015
|
exports.EndDoTranspiler = void 0;
|
|
83978
84016
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
83979
84017
|
class EndDoTranspiler {
|
|
84018
|
+
syIndexBackup;
|
|
83980
84019
|
constructor(syIndexBackup) {
|
|
83981
84020
|
this.syIndexBackup = syIndexBackup;
|
|
83982
84021
|
}
|
|
@@ -84176,6 +84215,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
84176
84215
|
exports.EndWhileTranspiler = void 0;
|
|
84177
84216
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
84178
84217
|
class EndWhileTranspiler {
|
|
84218
|
+
syIndexBackup;
|
|
84179
84219
|
constructor(syIndexBackup) {
|
|
84180
84220
|
this.syIndexBackup = syIndexBackup;
|
|
84181
84221
|
}
|
|
@@ -85263,10 +85303,10 @@ const unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ "./n
|
|
|
85263
85303
|
const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/@abaplint/transpiler/build/src/expressions/index.js");
|
|
85264
85304
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
85265
85305
|
class LoopTranspiler {
|
|
85306
|
+
unique = "";
|
|
85307
|
+
injectFrom = undefined;
|
|
85308
|
+
skipInto = undefined;
|
|
85266
85309
|
constructor(options) {
|
|
85267
|
-
this.unique = "";
|
|
85268
|
-
this.injectFrom = undefined;
|
|
85269
|
-
this.skipInto = undefined;
|
|
85270
85310
|
this.injectFrom = options?.injectFrom;
|
|
85271
85311
|
this.skipInto = options?.skipInto;
|
|
85272
85312
|
}
|
|
@@ -86238,11 +86278,19 @@ exports.RaiseTranspiler = RaiseTranspiler;
|
|
|
86238
86278
|
|
|
86239
86279
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
86240
86280
|
exports.RaiseEventTranspiler = void 0;
|
|
86281
|
+
const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
|
|
86282
|
+
const traversal_1 = __webpack_require__(/*! ../traversal */ "./node_modules/@abaplint/transpiler/build/src/traversal.js");
|
|
86241
86283
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
86284
|
+
const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/@abaplint/transpiler/build/src/expressions/index.js");
|
|
86242
86285
|
class RaiseEventTranspiler {
|
|
86243
86286
|
transpile(node, traversal) {
|
|
86244
|
-
|
|
86245
|
-
|
|
86287
|
+
const eventName = traversal_1.Traversal.escapeNamespace(node.findFirstExpression(abaplint.Expressions.EventName)?.concatTokens())?.toLowerCase().replace("~", "$");
|
|
86288
|
+
const parameters = node.findFirstExpression(abaplint.Expressions.ParameterListS);
|
|
86289
|
+
let extra = "";
|
|
86290
|
+
if (parameters) {
|
|
86291
|
+
extra = "," + new expressions_1.ParameterListSTranspiler().transpile(parameters, traversal).getCode();
|
|
86292
|
+
}
|
|
86293
|
+
return new chunk_1.Chunk().append(`await abap.statements.raiseEvent(this.${eventName}, this.me${extra});`, node, traversal);
|
|
86246
86294
|
}
|
|
86247
86295
|
}
|
|
86248
86296
|
exports.RaiseEventTranspiler = RaiseEventTranspiler;
|
|
@@ -87071,20 +87119,62 @@ const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/
|
|
|
87071
87119
|
class SetHandlerTranspiler {
|
|
87072
87120
|
transpile(node, traversal) {
|
|
87073
87121
|
const methods = [];
|
|
87122
|
+
let className = undefined;
|
|
87123
|
+
let eventName = undefined;
|
|
87074
87124
|
for (const m of node.findDirectExpressions(abaplint.Expressions.MethodSource)) {
|
|
87075
|
-
methods.push(new expressions_1.MethodSourceTranspiler().transpile(m, traversal).getCode());
|
|
87125
|
+
methods.push(new expressions_1.MethodSourceTranspiler().transpile(m, traversal).getCode().replace("await ", ""));
|
|
87126
|
+
if (className === undefined) {
|
|
87127
|
+
const nameToken = m.getFirstToken();
|
|
87128
|
+
const scope = traversal.findCurrentScopeByToken(nameToken);
|
|
87129
|
+
const method = traversal.findMethodReference(nameToken, scope);
|
|
87130
|
+
if (method?.def.isEventHandler() !== true) {
|
|
87131
|
+
throw new Error(`SetHandlerTranspiler: Method "${nameToken.getStr()}" is not an event handler`);
|
|
87132
|
+
}
|
|
87133
|
+
const def = traversal.findClassDefinition(method.def.getClassName(), scope);
|
|
87134
|
+
if (def === undefined) {
|
|
87135
|
+
throw new Error(`SetHandlerTranspiler: Class "${method.def.getClassName()}" not found`);
|
|
87136
|
+
}
|
|
87137
|
+
eventName = method.def.getEventName();
|
|
87138
|
+
className = this.findEventClass(def, eventName, traversal, scope);
|
|
87139
|
+
}
|
|
87076
87140
|
}
|
|
87077
87141
|
let f = undefined;
|
|
87078
87142
|
const forExpression = node.findExpressionAfterToken("FOR");
|
|
87079
|
-
if (forExpression) {
|
|
87143
|
+
if (forExpression instanceof abaplint.Expressions.Source) {
|
|
87080
87144
|
f = new expressions_1.SourceTranspiler().transpile(forExpression, traversal).getCode();
|
|
87081
87145
|
}
|
|
87082
|
-
|
|
87146
|
+
else {
|
|
87147
|
+
f = `"ALL"`;
|
|
87148
|
+
}
|
|
87149
|
+
let activation = "";
|
|
87083
87150
|
const activationExpression = node.findExpressionAfterToken("ACTIVATION");
|
|
87084
87151
|
if (activationExpression) {
|
|
87085
|
-
activation = new expressions_1.SourceTranspiler().transpile(activationExpression, traversal).getCode();
|
|
87152
|
+
activation = ", " + new expressions_1.SourceTranspiler().transpile(activationExpression, traversal).getCode();
|
|
87153
|
+
}
|
|
87154
|
+
return new chunk_1.Chunk().append(`abap.statements.setHandler({EVENT_NAME: "${eventName}", EVENT_CLASS: "${className}"}, [${methods.join(",")}], ${f}${activation});`, node, traversal);
|
|
87155
|
+
}
|
|
87156
|
+
findEventClass(def, eventName, traversal, scope) {
|
|
87157
|
+
let current = def;
|
|
87158
|
+
while (current !== undefined) {
|
|
87159
|
+
for (const event of current.getEvents()) {
|
|
87160
|
+
if (event.getName().toUpperCase() === eventName?.toUpperCase()) {
|
|
87161
|
+
return traversal.buildInternalName(current.getName(), current);
|
|
87162
|
+
}
|
|
87163
|
+
}
|
|
87164
|
+
for (const implementing of current.getImplementing()) {
|
|
87165
|
+
const idef = traversal.findInterfaceDefinition(implementing.name, scope);
|
|
87166
|
+
if (idef === undefined) {
|
|
87167
|
+
continue;
|
|
87168
|
+
}
|
|
87169
|
+
for (const event of idef.getEvents()) {
|
|
87170
|
+
if (event.getName().toUpperCase() === eventName?.toUpperCase()) {
|
|
87171
|
+
return traversal.buildInternalName(idef.getName(), idef);
|
|
87172
|
+
}
|
|
87173
|
+
}
|
|
87174
|
+
}
|
|
87175
|
+
current = traversal.findClassDefinition(current.getSuperClass(), scope);
|
|
87086
87176
|
}
|
|
87087
|
-
|
|
87177
|
+
throw new Error(`Transpiler: Event "${eventName}" not found in class "${def.getName()}"`);
|
|
87088
87178
|
}
|
|
87089
87179
|
}
|
|
87090
87180
|
exports.SetHandlerTranspiler = SetHandlerTranspiler;
|
|
@@ -87815,6 +87905,7 @@ const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abap
|
|
|
87815
87905
|
const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/@abaplint/transpiler/build/src/expressions/index.js");
|
|
87816
87906
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
87817
87907
|
class WhenTranspiler {
|
|
87908
|
+
u;
|
|
87818
87909
|
constructor(u) {
|
|
87819
87910
|
this.u = u;
|
|
87820
87911
|
}
|
|
@@ -87850,6 +87941,7 @@ const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/
|
|
|
87850
87941
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
87851
87942
|
const unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ "./node_modules/@abaplint/transpiler/build/src/unique_identifier.js");
|
|
87852
87943
|
class WhileTranspiler {
|
|
87944
|
+
syIndexBackup;
|
|
87853
87945
|
constructor(syIndexBackup) {
|
|
87854
87946
|
this.syIndexBackup = syIndexBackup;
|
|
87855
87947
|
}
|
|
@@ -89412,8 +89504,12 @@ const expressions_1 = __webpack_require__(/*! ./expressions */ "./node_modules/@
|
|
|
89412
89504
|
const keywords_1 = __webpack_require__(/*! ./keywords */ "./node_modules/@abaplint/transpiler/build/src/keywords.js");
|
|
89413
89505
|
const feature_flags_1 = __webpack_require__(/*! ./feature_flags */ "./node_modules/@abaplint/transpiler/build/src/feature_flags.js");
|
|
89414
89506
|
class Traversal {
|
|
89507
|
+
spaghetti;
|
|
89508
|
+
file;
|
|
89509
|
+
obj;
|
|
89510
|
+
reg;
|
|
89511
|
+
options;
|
|
89415
89512
|
constructor(spaghetti, file, obj, reg, options) {
|
|
89416
|
-
this.scopeCache = undefined;
|
|
89417
89513
|
this.spaghetti = spaghetti;
|
|
89418
89514
|
this.file = file;
|
|
89419
89515
|
this.obj = obj;
|
|
@@ -89469,6 +89565,7 @@ class Traversal {
|
|
|
89469
89565
|
}
|
|
89470
89566
|
return undefined;
|
|
89471
89567
|
}
|
|
89568
|
+
scopeCache = undefined;
|
|
89472
89569
|
findCurrentScopeByToken(token) {
|
|
89473
89570
|
const filename = this.file.getFilename();
|
|
89474
89571
|
if (this.scopeCache
|
|
@@ -89873,6 +89970,7 @@ this.INTERNAL_ID = abap.internalIdCounter++;\n`;
|
|
|
89873
89970
|
for (const i of def.getImplementing()) {
|
|
89874
89971
|
ret += this.dataFromInterfaces(i.name, scope, cName);
|
|
89875
89972
|
ret += this.aliasesFromInterfaces(i.name, scope, cName);
|
|
89973
|
+
ret += this.eventsFromInterfaces(i.name, scope);
|
|
89876
89974
|
}
|
|
89877
89975
|
// handle aliases after initialization of carrier variables
|
|
89878
89976
|
for (const a of def.getAliases() || []) {
|
|
@@ -89882,6 +89980,27 @@ this.INTERNAL_ID = abap.internalIdCounter++;\n`;
|
|
|
89882
89980
|
for (const c of def.getAttributes()?.getConstants() || []) {
|
|
89883
89981
|
ret += "this." + Traversal.escapeNamespace(c.getName().toLowerCase()) + " = " + cName + "." + Traversal.escapeNamespace(c.getName().toLowerCase()) + ";\n";
|
|
89884
89982
|
}
|
|
89983
|
+
for (const e of def.getEvents() || []) {
|
|
89984
|
+
const name = this.buildInternalName(def.getName(), def);
|
|
89985
|
+
ret += "this." + Traversal.escapeNamespace(e.getName().toLowerCase()) + " = {\"EVENT_NAME\": \"" + e.getName().toUpperCase() + "\", \"EVENT_CLASS\": \"" + name + "\"};\n";
|
|
89986
|
+
}
|
|
89987
|
+
return ret;
|
|
89988
|
+
}
|
|
89989
|
+
eventsFromInterfaces(name, scope) {
|
|
89990
|
+
let ret = "";
|
|
89991
|
+
const intf = this.findInterfaceDefinition(name, scope);
|
|
89992
|
+
if (intf === undefined) {
|
|
89993
|
+
return ret;
|
|
89994
|
+
}
|
|
89995
|
+
for (const e of intf.getEvents() || []) {
|
|
89996
|
+
const fname = Traversal.escapeNamespace(e.getName().toLowerCase());
|
|
89997
|
+
const iname = Traversal.escapeNamespace(intf?.getName().toLowerCase());
|
|
89998
|
+
const name = this.buildInternalName(intf.getName(), intf);
|
|
89999
|
+
ret += "this." + iname + "$" + fname + " = {\"EVENT_NAME\": \"" + e.getName().toUpperCase() + "\", \"EVENT_CLASS\": \"" + name + "\"};\n";
|
|
90000
|
+
}
|
|
90001
|
+
for (const i of intf.getImplementing() || []) {
|
|
90002
|
+
ret += this.eventsFromInterfaces(i.name, scope);
|
|
90003
|
+
}
|
|
89885
90004
|
return ret;
|
|
89886
90005
|
}
|
|
89887
90006
|
findInterfaceDefinition(name, scope) {
|
|
@@ -90173,6 +90292,8 @@ var UnknownTypesEnum;
|
|
|
90173
90292
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
90174
90293
|
exports.UniqueIdentifier = void 0;
|
|
90175
90294
|
class UniqueIdentifier {
|
|
90295
|
+
static counter = 0;
|
|
90296
|
+
static indexBackup = 0;
|
|
90176
90297
|
static reset() {
|
|
90177
90298
|
this.counter = 0;
|
|
90178
90299
|
}
|
|
@@ -90194,8 +90315,6 @@ class UniqueIdentifier {
|
|
|
90194
90315
|
}
|
|
90195
90316
|
}
|
|
90196
90317
|
exports.UniqueIdentifier = UniqueIdentifier;
|
|
90197
|
-
UniqueIdentifier.counter = 0;
|
|
90198
|
-
UniqueIdentifier.indexBackup = 0;
|
|
90199
90318
|
//# sourceMappingURL=unique_identifier.js.map
|
|
90200
90319
|
|
|
90201
90320
|
/***/ }),
|
|
@@ -90543,6 +90662,7 @@ exports.config = {
|
|
|
90543
90662
|
// todo, make sure nothing is overloaded, eg "lines()", there is a rule for this in abaplint now
|
|
90544
90663
|
// hmm this ^ is okay? since lines will be prefixed with "abap.builtin"?
|
|
90545
90664
|
class Validation {
|
|
90665
|
+
options;
|
|
90546
90666
|
constructor(options) {
|
|
90547
90667
|
this.options = options;
|
|
90548
90668
|
}
|
|
@@ -101495,6 +101615,7 @@ const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abap
|
|
|
101495
101615
|
const config_1 = __webpack_require__(/*! ./config */ "./build/config.js");
|
|
101496
101616
|
const file_operations_1 = __webpack_require__(/*! ./file_operations */ "./build/file_operations.js");
|
|
101497
101617
|
class Progress {
|
|
101618
|
+
bar;
|
|
101498
101619
|
set(total, _text) {
|
|
101499
101620
|
this.bar = new ProgressBar(":percent - :elapseds - :text", { total, renderThrottle: 100 });
|
|
101500
101621
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.1",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"author": "abaplint",
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@abaplint/core": "^2.113.
|
|
31
|
-
"@abaplint/transpiler": "^2.
|
|
30
|
+
"@abaplint/core": "^2.113.151",
|
|
31
|
+
"@abaplint/transpiler": "^2.11.1",
|
|
32
32
|
"@types/glob": "^8.1.0",
|
|
33
33
|
"@types/node": "^22.17.0",
|
|
34
34
|
"@types/progress": "^2.0.7",
|