@abaplint/transpiler-cli 2.7.152 → 2.7.153
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 +83 -68
- package/package.json +4 -4
package/build/bundle.js
CHANGED
|
@@ -20323,11 +20323,10 @@ class CurrentScope {
|
|
|
20323
20323
|
this.addNamedIdentifier(identifier.getName(), identifier);
|
|
20324
20324
|
}
|
|
20325
20325
|
addDeferred(token) {
|
|
20326
|
-
var _a;
|
|
20327
20326
|
if (token === undefined) {
|
|
20328
20327
|
return;
|
|
20329
20328
|
}
|
|
20330
|
-
|
|
20329
|
+
this.current.getData().deferred[token.getStr().toUpperCase()] = token;
|
|
20331
20330
|
}
|
|
20332
20331
|
addListPrefix(identifiers, prefix) {
|
|
20333
20332
|
for (const id of identifiers) {
|
|
@@ -20632,6 +20631,7 @@ const Statements = __webpack_require__(/*! ../2_statements/statements */ "./node
|
|
|
20632
20631
|
const Expressions = __webpack_require__(/*! ../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
20633
20632
|
const visibility_1 = __webpack_require__(/*! ../4_file_information/visibility */ "./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js");
|
|
20634
20633
|
// todo, think some of the public methods can be made private
|
|
20634
|
+
// todo: changet this class to static? for performance
|
|
20635
20635
|
class ObjectOriented {
|
|
20636
20636
|
constructor(scope) {
|
|
20637
20637
|
this.scope = scope;
|
|
@@ -22296,7 +22296,7 @@ class BasicTypes {
|
|
|
22296
22296
|
}
|
|
22297
22297
|
// todo, rewrite this method
|
|
22298
22298
|
resolveTypeChain(expr) {
|
|
22299
|
-
var _a;
|
|
22299
|
+
var _a, _b, _c, _d;
|
|
22300
22300
|
const chainText = expr.concatTokens().toUpperCase();
|
|
22301
22301
|
if (chainText.includes("-")) {
|
|
22302
22302
|
// workaround for stuff like "sy-repid"
|
|
@@ -22335,7 +22335,10 @@ class BasicTypes {
|
|
|
22335
22335
|
if (foundType === undefined) {
|
|
22336
22336
|
return new Types.UnknownType("Could not resolve type " + chainText);
|
|
22337
22337
|
}
|
|
22338
|
-
|
|
22338
|
+
const token = (_a = expr.getChildren()[2]) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
22339
|
+
if (token) {
|
|
22340
|
+
this.scope.addReference(token, foundId, _reference_1.ReferenceType.TypeReference, this.filename);
|
|
22341
|
+
}
|
|
22339
22342
|
}
|
|
22340
22343
|
else {
|
|
22341
22344
|
// lookup in local and global scope
|
|
@@ -22354,7 +22357,10 @@ class BasicTypes {
|
|
|
22354
22357
|
if (byName === undefined || foundType === undefined) {
|
|
22355
22358
|
return new Types.UnknownType(subs[0] + " not found in class or interface");
|
|
22356
22359
|
}
|
|
22357
|
-
|
|
22360
|
+
const token = (_b = expr.getChildren()[2]) === null || _b === void 0 ? void 0 : _b.getFirstToken();
|
|
22361
|
+
if (token) {
|
|
22362
|
+
this.scope.addReference(token, byName, _reference_1.ReferenceType.TypeReference, this.filename);
|
|
22363
|
+
}
|
|
22358
22364
|
}
|
|
22359
22365
|
}
|
|
22360
22366
|
else if (className && chainText.includes("->")) {
|
|
@@ -22380,7 +22386,10 @@ class BasicTypes {
|
|
|
22380
22386
|
if (byName === undefined || foundType === undefined) {
|
|
22381
22387
|
return new Types.UnknownType(typeName + " not found in class or interface");
|
|
22382
22388
|
}
|
|
22383
|
-
|
|
22389
|
+
const token = (_c = expr.getChildren()[2]) === null || _c === void 0 ? void 0 : _c.getFirstToken();
|
|
22390
|
+
if (token) {
|
|
22391
|
+
this.scope.addReference(token, byName, _reference_1.ReferenceType.TypeReference, this.filename);
|
|
22392
|
+
}
|
|
22384
22393
|
}
|
|
22385
22394
|
else {
|
|
22386
22395
|
return new Types.UnknownType("Not an object reference, " + className + ", " + id.constructor.name);
|
|
@@ -22397,7 +22406,7 @@ class BasicTypes {
|
|
|
22397
22406
|
const found = this.scope.findType(subs[0]);
|
|
22398
22407
|
foundType = found === null || found === void 0 ? void 0 : found.getType();
|
|
22399
22408
|
if (foundType === undefined) {
|
|
22400
|
-
const typePoolType = (
|
|
22409
|
+
const typePoolType = (_d = this.scope.findTypePoolType(subs[0])) === null || _d === void 0 ? void 0 : _d.getType();
|
|
22401
22410
|
if (typePoolType) {
|
|
22402
22411
|
// this.scope.addReference(typeName.getFirstToken(), typePoolType, ReferenceType.TypeReference, this.filename);
|
|
22403
22412
|
foundType = typePoolType;
|
|
@@ -22525,7 +22534,7 @@ class BasicTypes {
|
|
|
22525
22534
|
return undefined;
|
|
22526
22535
|
}
|
|
22527
22536
|
const name = chain.getFirstToken().getStr();
|
|
22528
|
-
if (chain.
|
|
22537
|
+
if (chain.getChildren().length === 1) {
|
|
22529
22538
|
if (name.toUpperCase() === "OBJECT") {
|
|
22530
22539
|
return new Types.GenericObjectReferenceType();
|
|
22531
22540
|
}
|
|
@@ -23216,14 +23225,15 @@ class Constant {
|
|
|
23216
23225
|
if (node.findDirectExpression(expressions_1.Integer)) {
|
|
23217
23226
|
return basic_1.IntegerType.get({ derivedFromConstant: true });
|
|
23218
23227
|
}
|
|
23219
|
-
|
|
23220
|
-
|
|
23228
|
+
const first = node.getFirstToken().getStr();
|
|
23229
|
+
if (first.startsWith("'")) {
|
|
23230
|
+
let len = first.length - 2;
|
|
23221
23231
|
if (len <= 0) {
|
|
23222
23232
|
len = 1;
|
|
23223
23233
|
}
|
|
23224
23234
|
return new basic_1.CharacterType(len, { derivedFromConstant: true });
|
|
23225
23235
|
}
|
|
23226
|
-
else if (
|
|
23236
|
+
else if (first.startsWith("`")) {
|
|
23227
23237
|
return basic_1.StringType.get({ derivedFromConstant: true });
|
|
23228
23238
|
}
|
|
23229
23239
|
else {
|
|
@@ -23553,11 +23563,10 @@ const source_field_1 = __webpack_require__(/*! ./source_field */ "./node_modules
|
|
|
23553
23563
|
class FieldChain {
|
|
23554
23564
|
runSyntax(node, scope, filename, refType) {
|
|
23555
23565
|
var _a, _b, _c, _d, _e;
|
|
23556
|
-
const children = node.getChildren()
|
|
23557
|
-
let contextName = children[0].concatTokens();
|
|
23566
|
+
const children = node.getChildren();
|
|
23558
23567
|
let context = undefined;
|
|
23559
23568
|
try {
|
|
23560
|
-
context = this.findTop(children
|
|
23569
|
+
context = this.findTop(children[0], scope, filename, refType);
|
|
23561
23570
|
}
|
|
23562
23571
|
catch (error) {
|
|
23563
23572
|
const concat = node.concatTokens();
|
|
@@ -23576,9 +23585,8 @@ class FieldChain {
|
|
|
23576
23585
|
}
|
|
23577
23586
|
throw error;
|
|
23578
23587
|
}
|
|
23579
|
-
|
|
23580
|
-
|
|
23581
|
-
const current = children.shift();
|
|
23588
|
+
for (let i = 1; i < children.length; i++) {
|
|
23589
|
+
const current = children[i];
|
|
23582
23590
|
if (current === undefined) {
|
|
23583
23591
|
break;
|
|
23584
23592
|
}
|
|
@@ -23593,7 +23601,11 @@ class FieldChain {
|
|
|
23593
23601
|
&& !(context instanceof basic_1.TableType && context.isWithHeader())
|
|
23594
23602
|
&& !(context instanceof basic_1.VoidType)) {
|
|
23595
23603
|
if (context instanceof basic_1.TableType && context.isWithHeader() === false) {
|
|
23596
|
-
|
|
23604
|
+
let contextName = "";
|
|
23605
|
+
for (let j = 0; j < i; j++) {
|
|
23606
|
+
contextName += children[j].concatTokens();
|
|
23607
|
+
}
|
|
23608
|
+
if (scope.isAllowHeaderUse(contextName)) {
|
|
23597
23609
|
// FOR ALL ENTRIES workaround
|
|
23598
23610
|
context = context.getRowType();
|
|
23599
23611
|
if (!(context instanceof basic_1.StructureType) && !(context instanceof basic_1.VoidType)) {
|
|
@@ -24378,7 +24390,7 @@ class MethodCallChain {
|
|
|
24378
24390
|
if (first.get() instanceof Expressions.MethodCall) {
|
|
24379
24391
|
children.unshift(first);
|
|
24380
24392
|
}
|
|
24381
|
-
let previous =
|
|
24393
|
+
let previous = undefined;
|
|
24382
24394
|
while (children.length > 0) {
|
|
24383
24395
|
const current = children.shift();
|
|
24384
24396
|
if (current === undefined) {
|
|
@@ -24399,7 +24411,7 @@ class MethodCallChain {
|
|
|
24399
24411
|
}
|
|
24400
24412
|
}
|
|
24401
24413
|
else {
|
|
24402
|
-
if (previous === "=>" && (method === null || method === void 0 ? void 0 : method.isStatic()) === false) {
|
|
24414
|
+
if (previous && previous.getFirstToken().getStr() === "=>" && (method === null || method === void 0 ? void 0 : method.isStatic()) === false) {
|
|
24403
24415
|
throw new Error("Method \"" + methodName + "\" not static");
|
|
24404
24416
|
}
|
|
24405
24417
|
const extra = {
|
|
@@ -24439,7 +24451,7 @@ class MethodCallChain {
|
|
|
24439
24451
|
else if (current instanceof nodes_1.ExpressionNode && current.get() instanceof Expressions.AttributeName) {
|
|
24440
24452
|
context = new attribute_name_1.AttributeName().runSyntax(context, current, scope, filename);
|
|
24441
24453
|
}
|
|
24442
|
-
previous = current
|
|
24454
|
+
previous = current;
|
|
24443
24455
|
}
|
|
24444
24456
|
return context;
|
|
24445
24457
|
}
|
|
@@ -26769,7 +26781,7 @@ class ScopeData {
|
|
|
26769
26781
|
forms: [], // todo, refactor to object
|
|
26770
26782
|
types: {},
|
|
26771
26783
|
extraLikeTypes: {},
|
|
26772
|
-
deferred:
|
|
26784
|
+
deferred: {},
|
|
26773
26785
|
references: [],
|
|
26774
26786
|
sqlConversion: [],
|
|
26775
26787
|
};
|
|
@@ -26815,10 +26827,9 @@ class SpaghettiScopeNode extends ScopeData {
|
|
|
26815
26827
|
findDeferred(name) {
|
|
26816
26828
|
let search = this;
|
|
26817
26829
|
while (search !== undefined) {
|
|
26818
|
-
|
|
26819
|
-
|
|
26820
|
-
|
|
26821
|
-
}
|
|
26830
|
+
const found = search.getData().deferred[name.toUpperCase()];
|
|
26831
|
+
if (found) {
|
|
26832
|
+
return new _identifier_1.Identifier(found, search.identifier.filename);
|
|
26822
26833
|
}
|
|
26823
26834
|
search = search.getParent();
|
|
26824
26835
|
}
|
|
@@ -27313,25 +27324,26 @@ exports.AuthorityCheck = AuthorityCheck;
|
|
|
27313
27324
|
|
|
27314
27325
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
27315
27326
|
exports.Call = void 0;
|
|
27316
|
-
const
|
|
27327
|
+
const nodes_1 = __webpack_require__(/*! ../../nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
|
|
27317
27328
|
const method_call_chain_1 = __webpack_require__(/*! ../expressions/method_call_chain */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_call_chain.js");
|
|
27318
27329
|
const method_source_1 = __webpack_require__(/*! ../expressions/method_source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_source.js");
|
|
27319
27330
|
const method_call_body_1 = __webpack_require__(/*! ../expressions/method_call_body */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_call_body.js");
|
|
27320
27331
|
const void_type_1 = __webpack_require__(/*! ../../types/basic/void_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/void_type.js");
|
|
27321
27332
|
class Call {
|
|
27322
27333
|
runSyntax(node, scope, filename) {
|
|
27323
|
-
const
|
|
27324
|
-
if (
|
|
27325
|
-
|
|
27334
|
+
const children = node.getChildren();
|
|
27335
|
+
if (children.length === 2) {
|
|
27336
|
+
const first = children[0];
|
|
27337
|
+
new method_call_chain_1.MethodCallChain().runSyntax(first, scope, filename);
|
|
27326
27338
|
return;
|
|
27327
27339
|
}
|
|
27328
|
-
const methodSource =
|
|
27340
|
+
const methodSource = children[2];
|
|
27329
27341
|
if (methodSource === undefined) {
|
|
27330
27342
|
throw new Error("Call, child MethodSource not found");
|
|
27331
27343
|
}
|
|
27332
27344
|
const methodDef = new method_source_1.MethodSource().runSyntax(methodSource, scope, filename);
|
|
27333
|
-
const body =
|
|
27334
|
-
if (body) {
|
|
27345
|
+
const body = children[3];
|
|
27346
|
+
if (body instanceof nodes_1.ExpressionNode) {
|
|
27335
27347
|
// todo, resolve the method definition above and pass, if possible, in case of dynamic pass void
|
|
27336
27348
|
new method_call_body_1.MethodCallBody().runSyntax(body, scope, filename, methodDef || new void_type_1.VoidType("CallTODO"));
|
|
27337
27349
|
}
|
|
@@ -33503,6 +33515,7 @@ class ExpressionNode extends _abstract_node_1.AbstractNode {
|
|
|
33503
33515
|
}
|
|
33504
33516
|
return str;
|
|
33505
33517
|
}
|
|
33518
|
+
// todo: delete this method?, its slow
|
|
33506
33519
|
getTokens() {
|
|
33507
33520
|
const tokens = [];
|
|
33508
33521
|
for (const c of this.getChildren()) {
|
|
@@ -33599,8 +33612,9 @@ class ExpressionNode extends _abstract_node_1.AbstractNode {
|
|
|
33599
33612
|
return ret;
|
|
33600
33613
|
}
|
|
33601
33614
|
findDirectTokenByText(text) {
|
|
33615
|
+
const search = text.toUpperCase();
|
|
33602
33616
|
for (const child of this.getChildren()) {
|
|
33603
|
-
if (child instanceof token_node_1.TokenNode && child.get().getStr().toUpperCase() ===
|
|
33617
|
+
if (child instanceof token_node_1.TokenNode && child.get().getStr().toUpperCase() === search) {
|
|
33604
33618
|
return child.get();
|
|
33605
33619
|
}
|
|
33606
33620
|
}
|
|
@@ -36228,29 +36242,29 @@ class ClassDefinition extends _identifier_1.Identifier {
|
|
|
36228
36242
|
const name = def.findDirectExpression(Expressions.ClassName).getFirstToken();
|
|
36229
36243
|
super(name, filename);
|
|
36230
36244
|
scope.addClassDefinition(this);
|
|
36231
|
-
this.node = node;
|
|
36232
36245
|
this.events = [];
|
|
36233
36246
|
this.implementing = [];
|
|
36247
|
+
this.globalValue = def.findFirstExpression(Expressions.ClassGlobal) !== undefined;
|
|
36248
|
+
this.finalValue = def.findFirstExpression(Expressions.ClassFinal) !== undefined;
|
|
36234
36249
|
scope.push(_scope_type_1.ScopeType.ClassDefinition, name.getStr(), name.getStart(), filename);
|
|
36235
36250
|
this.superClass = this.findSuper(def, filename, scope);
|
|
36236
36251
|
this.friends = this.findFriends(def, filename, scope);
|
|
36237
|
-
this.parse(filename, scope);
|
|
36252
|
+
this.parse(filename, scope, node);
|
|
36238
36253
|
const helper = new _object_oriented_1.ObjectOriented(scope);
|
|
36239
36254
|
helper.fromSuperClassesAndInterfaces(this);
|
|
36240
36255
|
helper.addAliasedTypes(this.aliases);
|
|
36241
|
-
this.attributes = new class_attributes_1.Attributes(
|
|
36256
|
+
this.attributes = new class_attributes_1.Attributes(node, this.filename, scope);
|
|
36242
36257
|
this.types = this.attributes.getTypes();
|
|
36243
|
-
const events =
|
|
36258
|
+
const events = node.findAllStatements(Statements.Events);
|
|
36244
36259
|
for (const e of events) {
|
|
36245
36260
|
this.events.push(new event_definition_1.EventDefinition(e, visibility_1.Visibility.Public, this.filename, scope)); // todo, all these are not Public
|
|
36246
36261
|
}
|
|
36247
|
-
this.methodDefs = new method_definitions_1.MethodDefinitions(
|
|
36262
|
+
this.methodDefs = new method_definitions_1.MethodDefinitions(node, this.filename, scope);
|
|
36248
36263
|
scope.pop(node.getLastToken().getEnd());
|
|
36249
|
-
const
|
|
36250
|
-
const concat = cdef.concatTokens().toUpperCase();
|
|
36264
|
+
const concat = def.concatTokens().toUpperCase();
|
|
36251
36265
|
this.testing = concat.includes(" FOR TESTING");
|
|
36252
36266
|
this.sharedMemory = concat.includes(" SHARED MEMORY ENABLED");
|
|
36253
|
-
this.abstract = (
|
|
36267
|
+
this.abstract = (def === null || def === void 0 ? void 0 : def.findDirectTokenByText("ABSTRACT")) !== undefined;
|
|
36254
36268
|
// perform checks after everything has been initialized
|
|
36255
36269
|
this.checkMethodsFromSuperClasses(scope);
|
|
36256
36270
|
}
|
|
@@ -36273,10 +36287,10 @@ class ClassDefinition extends _identifier_1.Identifier {
|
|
|
36273
36287
|
return this.attributes;
|
|
36274
36288
|
}
|
|
36275
36289
|
isGlobal() {
|
|
36276
|
-
return this.
|
|
36290
|
+
return this.globalValue;
|
|
36277
36291
|
}
|
|
36278
36292
|
isFinal() {
|
|
36279
|
-
return this.
|
|
36293
|
+
return this.finalValue;
|
|
36280
36294
|
}
|
|
36281
36295
|
getImplementing() {
|
|
36282
36296
|
return this.implementing;
|
|
@@ -36355,10 +36369,10 @@ class ClassDefinition extends _identifier_1.Identifier {
|
|
|
36355
36369
|
}
|
|
36356
36370
|
}
|
|
36357
36371
|
}
|
|
36358
|
-
parse(filename, scope) {
|
|
36372
|
+
parse(filename, scope, inputNode) {
|
|
36359
36373
|
var _a;
|
|
36360
|
-
for (const node of
|
|
36361
|
-
const partial = node.
|
|
36374
|
+
for (const node of inputNode.findAllStatements(Statements.InterfaceDef)) {
|
|
36375
|
+
const partial = node.findDirectTokenByText("PARTIALLY") !== undefined;
|
|
36362
36376
|
const token = (_a = node.findFirstExpression(Expressions.InterfaceName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
36363
36377
|
if (token === undefined) {
|
|
36364
36378
|
throw new Error("ClassDefinition, unable to find interface token");
|
|
@@ -36376,7 +36390,7 @@ class ClassDefinition extends _identifier_1.Identifier {
|
|
|
36376
36390
|
scope.addReference(token, undefined, _reference_1.ReferenceType.ObjectOrientedUnknownReference, filename, { ooName: name.toUpperCase(), ooType: "INTF" });
|
|
36377
36391
|
}
|
|
36378
36392
|
}
|
|
36379
|
-
this.aliases = new aliases_1.Aliases(
|
|
36393
|
+
this.aliases = new aliases_1.Aliases(inputNode, this.filename, scope);
|
|
36380
36394
|
}
|
|
36381
36395
|
}
|
|
36382
36396
|
exports.ClassDefinition = ClassDefinition;
|
|
@@ -36739,11 +36753,11 @@ class InterfaceDefinition extends _identifier_1.Identifier {
|
|
|
36739
36753
|
const name = node.findFirstStatement(Statements.Interface).findFirstExpression(Expressions.InterfaceName).getFirstToken();
|
|
36740
36754
|
super(name, filename);
|
|
36741
36755
|
scope.addInterfaceDefinition(this);
|
|
36742
|
-
this.node = node;
|
|
36743
36756
|
this.events = [];
|
|
36744
36757
|
this.implementing = [];
|
|
36758
|
+
this.globalValue = node.findFirstExpression(Expressions.ClassGlobal) !== undefined;
|
|
36745
36759
|
scope.push(_scope_type_1.ScopeType.Interface, name.getStr(), node.getFirstToken().getStart(), filename);
|
|
36746
|
-
this.parse(scope, filename);
|
|
36760
|
+
this.parse(scope, filename, node);
|
|
36747
36761
|
scope.pop(node.getLastToken().getEnd());
|
|
36748
36762
|
}
|
|
36749
36763
|
getSuperClass() {
|
|
@@ -36765,21 +36779,21 @@ class InterfaceDefinition extends _identifier_1.Identifier {
|
|
|
36765
36779
|
return this.typeDefinitions;
|
|
36766
36780
|
}
|
|
36767
36781
|
isLocal() {
|
|
36768
|
-
return !this.
|
|
36782
|
+
return !this.globalValue;
|
|
36769
36783
|
}
|
|
36770
36784
|
isGlobal() {
|
|
36771
|
-
return this.
|
|
36785
|
+
return this.globalValue;
|
|
36772
36786
|
}
|
|
36773
36787
|
getMethodDefinitions() {
|
|
36774
36788
|
return this.methodDefinitions;
|
|
36775
36789
|
}
|
|
36776
36790
|
/////////////////
|
|
36777
|
-
parse(scope, filename) {
|
|
36791
|
+
parse(scope, filename, node) {
|
|
36778
36792
|
var _a;
|
|
36779
36793
|
// todo, proper sequencing, the statements should be processed line by line
|
|
36780
|
-
this.attributes = new class_attributes_1.Attributes(
|
|
36794
|
+
this.attributes = new class_attributes_1.Attributes(node, this.filename, scope);
|
|
36781
36795
|
this.typeDefinitions = this.attributes.getTypes();
|
|
36782
|
-
this.aliases = new aliases_1.Aliases(
|
|
36796
|
+
this.aliases = new aliases_1.Aliases(node, this.filename, scope);
|
|
36783
36797
|
// todo, cleanup aliases, vs "object_oriented.ts" vs "class_implementation.ts"
|
|
36784
36798
|
for (const a of this.aliases.getAll()) {
|
|
36785
36799
|
const [objName, fieldName] = a.getComponent().split("~");
|
|
@@ -36800,15 +36814,15 @@ class InterfaceDefinition extends _identifier_1.Identifier {
|
|
|
36800
36814
|
}
|
|
36801
36815
|
}
|
|
36802
36816
|
}
|
|
36803
|
-
this.methodDefinitions = new method_definitions_1.MethodDefinitions(
|
|
36817
|
+
this.methodDefinitions = new method_definitions_1.MethodDefinitions(node, this.filename, scope);
|
|
36804
36818
|
if (this.methodDefinitions.getByName("CONSTRUCTOR") !== undefined) {
|
|
36805
36819
|
throw new Error("Interfaces cannot have constructor methods");
|
|
36806
36820
|
}
|
|
36807
|
-
const events =
|
|
36821
|
+
const events = node.findAllStatements(Statements.Events);
|
|
36808
36822
|
for (const e of events) {
|
|
36809
36823
|
this.events.push(new event_definition_1.EventDefinition(e, visibility_1.Visibility.Public, this.filename, scope));
|
|
36810
36824
|
}
|
|
36811
|
-
for (const i of
|
|
36825
|
+
for (const i of node.findAllStatements(Statements.InterfaceDef)) {
|
|
36812
36826
|
const token = (_a = i.findDirectExpression(Expressions.InterfaceName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
36813
36827
|
const name = token === null || token === void 0 ? void 0 : token.getStr();
|
|
36814
36828
|
if (name) {
|
|
@@ -37234,7 +37248,7 @@ class MethodParameters {
|
|
|
37234
37248
|
const importing = node.findFirstExpression(Expressions.MethodDefImporting);
|
|
37235
37249
|
if (importing) {
|
|
37236
37250
|
this.add(this.importing, importing, scope, ["importing" /* IdentifierMeta.MethodImporting */], abstractMethod);
|
|
37237
|
-
if (importing.
|
|
37251
|
+
if (importing.findDirectTokenByText("PREFERRED")) {
|
|
37238
37252
|
this.preferred = importing.getLastToken().getStr().toUpperCase();
|
|
37239
37253
|
if (this.preferred.startsWith("!")) {
|
|
37240
37254
|
this.preferred = this.preferred.substring(1);
|
|
@@ -37265,10 +37279,11 @@ class MethodParameters {
|
|
|
37265
37279
|
}
|
|
37266
37280
|
this.importing.push(new _typed_identifier_1.TypedIdentifier(foo.getFirstToken(), filename, new basic_1.VoidType("RapMethodParameter"), ["importing" /* IdentifierMeta.MethodImporting */]));
|
|
37267
37281
|
}
|
|
37268
|
-
|
|
37269
|
-
|
|
37270
|
-
||
|
|
37271
|
-
||
|
|
37282
|
+
const concat = node.concatTokens().toUpperCase();
|
|
37283
|
+
if (concat.includes(" FOR VALIDATE ")
|
|
37284
|
+
|| concat.includes(" FOR BEHAVIOR ")
|
|
37285
|
+
|| concat.includes(" FOR FEATURES ")
|
|
37286
|
+
|| concat.includes(" FOR MODIFY ")) {
|
|
37272
37287
|
const token = isRap.getFirstToken();
|
|
37273
37288
|
this.exporting.push(new _typed_identifier_1.TypedIdentifier(new identifier_1.Identifier(token.getStart(), "failed"), filename, new basic_1.VoidType("RapMethodParameter"), ["exporting" /* IdentifierMeta.MethodExporting */]));
|
|
37274
37289
|
this.exporting.push(new _typed_identifier_1.TypedIdentifier(new identifier_1.Identifier(token.getStart(), "mapped"), filename, new basic_1.VoidType("RapMethodParameter"), ["exporting" /* IdentifierMeta.MethodExporting */]));
|
|
@@ -37294,14 +37309,14 @@ class MethodParameters {
|
|
|
37294
37309
|
}
|
|
37295
37310
|
}
|
|
37296
37311
|
add(target, source, scope, meta, abstractMethod) {
|
|
37297
|
-
var _a;
|
|
37312
|
+
var _a, _b;
|
|
37298
37313
|
for (const opt of source.findAllExpressions(Expressions.MethodParamOptional)) {
|
|
37299
37314
|
const p = opt.findDirectExpression(Expressions.MethodParam);
|
|
37300
37315
|
if (p === undefined) {
|
|
37301
37316
|
continue;
|
|
37302
37317
|
}
|
|
37303
37318
|
const extraMeta = [];
|
|
37304
|
-
if (
|
|
37319
|
+
if (p.getFirstToken().getStr().toUpperCase() === "VALUE" && ((_a = p.getChildren()[1]) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr()) === "(") {
|
|
37305
37320
|
extraMeta.push("pass_by_value" /* IdentifierMeta.PassByValue */);
|
|
37306
37321
|
}
|
|
37307
37322
|
else if (meta.includes("importing" /* IdentifierMeta.MethodImporting */)) {
|
|
@@ -37313,14 +37328,14 @@ class MethodParameters {
|
|
|
37313
37328
|
const id = new method_param_1.MethodParam().runSyntax(p, scope, this.filename, [...meta, ...extraMeta]);
|
|
37314
37329
|
scope.addIdentifier(id);
|
|
37315
37330
|
target.push(id);
|
|
37316
|
-
if (opt.
|
|
37331
|
+
if (opt.findDirectTokenByText("OPTIONAL")) {
|
|
37317
37332
|
const name = target[target.length - 1].getName().toUpperCase();
|
|
37318
37333
|
this.optional.push(name);
|
|
37319
37334
|
}
|
|
37320
37335
|
else if (opt.findFirstExpression(Expressions.Default)) {
|
|
37321
37336
|
const name = target[target.length - 1].getName().toUpperCase();
|
|
37322
37337
|
this.optional.push(name);
|
|
37323
|
-
const val = (
|
|
37338
|
+
const val = (_b = opt.findFirstExpression(Expressions.Default)) === null || _b === void 0 ? void 0 : _b.getLastChild();
|
|
37324
37339
|
if (val && val instanceof nodes_1.ExpressionNode) {
|
|
37325
37340
|
this.defaults[name] = val;
|
|
37326
37341
|
}
|
|
@@ -50096,7 +50111,7 @@ class Registry {
|
|
|
50096
50111
|
}
|
|
50097
50112
|
static abaplintVersion() {
|
|
50098
50113
|
// magic, see build script "version.sh"
|
|
50099
|
-
return "2.105.
|
|
50114
|
+
return "2.105.14";
|
|
50100
50115
|
}
|
|
50101
50116
|
getDDICReferences() {
|
|
50102
50117
|
return this.ddicReferences;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.153",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"author": "abaplint",
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@abaplint/transpiler": "^2.7.
|
|
29
|
+
"@abaplint/transpiler": "^2.7.153",
|
|
30
30
|
"@types/glob": "^8.1.0",
|
|
31
31
|
"glob": "=7.2.0",
|
|
32
32
|
"@types/progress": "^2.0.7",
|
|
33
|
-
"@types/node": "^20.11.
|
|
34
|
-
"@abaplint/core": "^2.105.
|
|
33
|
+
"@types/node": "^20.11.10",
|
|
34
|
+
"@abaplint/core": "^2.105.14",
|
|
35
35
|
"progress": "^2.0.3",
|
|
36
36
|
"webpack": "^5.90.0",
|
|
37
37
|
"webpack-cli": "^5.1.4",
|