@abaplint/transpiler-cli 2.13.93 → 2.13.95
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 +126 -24
- package/package.json +4 -4
package/build/bundle.js
CHANGED
|
@@ -605,9 +605,8 @@ const BUFS = new Set([
|
|
|
605
605
|
CH_DOT, CH_COMMA, CH_COLON, 40 /* ( */, 41 /* ) */, 91 /* [ */,
|
|
606
606
|
93 /* ] */, 43 /* + */, CH_AT
|
|
607
607
|
]);
|
|
608
|
-
// characters
|
|
609
|
-
//
|
|
610
|
-
// note that "(" is allowed, ie. text elements like 'text'(001)
|
|
608
|
+
// characters treated as separators after ping literals and string templates.
|
|
609
|
+
// Single-quoted text literals always end at their closing quote.
|
|
611
610
|
const AFTER_LITERAL = new Set([
|
|
612
611
|
EOF, CH_SPACE, CH_TAB, CH_NL, CH_DOT, CH_COMMA, CH_COLON, CH_DQUOTE,
|
|
613
612
|
40 /* ( */, 41 /* ) */, 91 /* [ */, 93 /* ] */
|
|
@@ -925,9 +924,7 @@ class Lexer {
|
|
|
925
924
|
&& ahead !== CH_QUOTE
|
|
926
925
|
&& this.buffer.countIsEven(CH_QUOTE)) {
|
|
927
926
|
// end of string
|
|
928
|
-
|
|
929
|
-
this.add();
|
|
930
|
-
}
|
|
927
|
+
this.add();
|
|
931
928
|
if (ahead === CH_DQUOTE) {
|
|
932
929
|
this.m = ModeComment;
|
|
933
930
|
}
|
|
@@ -3646,7 +3643,8 @@ class ExpandMacros {
|
|
|
3646
3643
|
for (const input of inputs) {
|
|
3647
3644
|
const search = "&" + i;
|
|
3648
3645
|
const reg = new RegExp(search, "g");
|
|
3649
|
-
|
|
3646
|
+
// a function replacement: "$`" and "$'" in the argument are text, not patterns
|
|
3647
|
+
str = str.replace(reg, () => input);
|
|
3650
3648
|
i++;
|
|
3651
3649
|
}
|
|
3652
3650
|
const file = new memory_file_1.MemoryFile("expand_macros.abap.prog", str);
|
|
@@ -6907,7 +6905,9 @@ const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/co
|
|
|
6907
6905
|
const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
6908
6906
|
class MethodDefExceptions extends combi_1.Expression {
|
|
6909
6907
|
getRunnable() {
|
|
6910
|
-
|
|
6908
|
+
// parameter section keywords cannot be exception names
|
|
6909
|
+
const name = (0, combi_1.seq)((0, combi_1.stopBefore1)("IMPORTING", "EXPORTING", "CHANGING", "RETURNING", "RAISING", "EXCEPTIONS"), _1.NamespaceSimpleName);
|
|
6910
|
+
const exceptions = (0, combi_1.seq)("EXCEPTIONS", (0, combi_1.plusPrio)(name));
|
|
6911
6911
|
return exceptions;
|
|
6912
6912
|
}
|
|
6913
6913
|
}
|
|
@@ -6979,7 +6979,9 @@ const class_name_1 = __webpack_require__(/*! ./class_name */ "./node_modules/@ab
|
|
|
6979
6979
|
class MethodDefRaising extends combi_1.Expression {
|
|
6980
6980
|
getRunnable() {
|
|
6981
6981
|
const resumable = (0, combi_1.seq)("RESUMABLE", (0, combi_1.tok)(tokens_1.ParenLeft), class_name_1.ClassName, (0, combi_1.tok)(tokens_1.ParenRightW));
|
|
6982
|
-
|
|
6982
|
+
// parameter section keywords cannot be exception names
|
|
6983
|
+
const name = (0, combi_1.seq)((0, combi_1.stopBefore1)("IMPORTING", "EXPORTING", "CHANGING", "RETURNING", "RAISING", "EXCEPTIONS"), class_name_1.ClassName);
|
|
6984
|
+
const raising = (0, combi_1.seq)("RAISING", (0, combi_1.plus)((0, combi_1.altPrio)(resumable, name)));
|
|
6983
6985
|
return raising;
|
|
6984
6986
|
}
|
|
6985
6987
|
}
|
|
@@ -17283,7 +17285,7 @@ class MethodDef {
|
|
|
17283
17285
|
(0, combi_1.seq)("VALIDATE ON SAVE IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("MODIFY", (0, combi_1.opt)("IMPORTING"), (0, combi_1.plus)((0, combi_1.seq)(expressions_1.MethodParamName, modify))), (0, combi_1.seq)("PRECHECK IMPORTING", expressions_1.MethodParamName, modify), (0, combi_1.seq)("DETERMINATION", expressions_1.TypeName, "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("VALIDATION", expressions_1.TypeName, "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("NUMBERING IMPORTING", expressions_1.MethodParamName, modify), (0, combi_1.seq)("READ IMPORTING", expressions_1.MethodParamName, (0, combi_1.altPrio)(forRead, forfunction)), (0, combi_1.seq)("FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.NamespaceSimpleName, "FOR", expressions_1.NamespaceSimpleName, result), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR CREATE", expressions_1.TypeName, expressions_1.MethodParamName, "FOR UPDATE", expressions_1.TypeName, expressions_1.MethodParamName, "FOR DELETE", expressions_1.TypeName), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR READ", expressions_1.TypeName, result), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR UPDATE", expressions_1.TypeName), (0, combi_1.seq)((0, combi_1.alt)("BEHAVIOR", "LOCK"), "IMPORTING", expressions_1.MethodParamName, "FOR LOCK", expressions_1.TypeName), (0, combi_1.seq)("DETERMINE", (0, combi_1.alt)("ON MODIFY", "ON SAVE"), "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("GLOBAL AUTHORIZATION IMPORTING REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)("GLOBAL FEATURES IMPORTING REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)((0, combi_1.seq)((0, combi_1.opt)("INSTANCE"), "AUTHORIZATION IMPORTING"), expressions_1.MethodParamName, "REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)("INSTANCE FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result));
|
|
17284
17286
|
// todo, this is only from version something
|
|
17285
17287
|
// AMDP OPTIONS clause blocked in KeyUser
|
|
17286
|
-
const amdp = (0, combi_1.verNotLang)(version_1.LanguageVersion.KeyUser, (0, combi_1.seq)("AMDP OPTIONS", (0, combi_1.
|
|
17288
|
+
const amdp = (0, combi_1.verNotLang)(version_1.LanguageVersion.KeyUser, (0, combi_1.seq)("AMDP OPTIONS", (0, combi_1.per)("READ-ONLY", (0, combi_1.seq)("CDS SESSION CLIENT", (0, combi_1.alt)("CURRENT", "DEPENDENT"))), (0, combi_1.optPrio)(expressions_1.MethodDefImporting), (0, combi_1.optPrio)(expressions_1.MethodDefExporting), (0, combi_1.optPrio)(expressions_1.MethodDefRaising)));
|
|
17287
17289
|
// FOR DDL OBJECT / FOR TABLE FUNCTION / FOR SCALAR FUNCTION blocked in KeyUser
|
|
17288
17290
|
const regular = (0, combi_1.seq)((0, combi_1.altPrio)("CLASS-METHODS", "METHODS"), expressions_1.MethodName, (0, combi_1.alt)((0, combi_1.seq)((0, combi_1.optPrio)(expressions_1.Abstract), (0, combi_1.optPrio)(def), expressions_1.EventHandler), parameters, testing, (0, combi_1.verNotLang)(version_1.LanguageVersion.KeyUser, (0, combi_1.seq)("FOR", behavior)), amdp, "NOT AT END OF MODE", (0, combi_1.optPrio)(expressions_1.Redefinition)));
|
|
17289
17291
|
// RAP event handlers are instance methods; CLASS-METHODS is not allowed.
|
|
@@ -17314,7 +17316,8 @@ class MethodImplementation {
|
|
|
17314
17316
|
const name = (0, combi_1.regex)(/[\w~]+/);
|
|
17315
17317
|
const kernel = (0, combi_1.seq)("KERNEL MODULE", (0, combi_1.plus)(name), (0, combi_1.optPrio)((0, combi_1.altPrio)("FAIL", "IGNORE")));
|
|
17316
17318
|
const using = (0, combi_1.seq)("USING", (0, combi_1.plus)(expressions_1.SimpleFieldChain));
|
|
17317
|
-
const
|
|
17319
|
+
const options = (0, combi_1.seq)("OPTIONS", (0, combi_1.per)("READ-ONLY", "SUPPRESS SYNTAX ERRORS", "DETERMINISTIC"));
|
|
17320
|
+
const database = (0, combi_1.seq)("DATABASE", (0, combi_1.alt)("PROCEDURE", "FUNCTION", "GRAPH WORKSPACE"), "FOR HDB", expressions_1.Language, (0, combi_1.opt)(options), (0, combi_1.opt)(using));
|
|
17318
17321
|
// BY DATABASE and BY KERNEL both blocked in KeyUser
|
|
17319
17322
|
const by = (0, combi_1.verNotLang)(version_1.LanguageVersion.KeyUser, (0, combi_1.seq)("BY", (0, combi_1.alt)(kernel, database)));
|
|
17320
17323
|
return (0, combi_1.seq)("METHOD", expressions_1.MethodName, (0, combi_1.optPrio)(by));
|
|
@@ -17385,7 +17388,7 @@ class ModifyEntities {
|
|
|
17385
17388
|
const mapped = (0, combi_1.seq)("MAPPED", expressions_1.Target);
|
|
17386
17389
|
const reported = (0, combi_1.seq)("REPORTED", expressions_1.Target);
|
|
17387
17390
|
const end = (0, combi_1.optPrio)((0, combi_1.per)(failed, result, mapped, reported));
|
|
17388
|
-
const entities = (0, combi_1.seq)((0, combi_1.optPrio)("AUGMENTING"), "ENTITIES OF", expressions_1.NamespaceSimpleName, (0, combi_1.
|
|
17391
|
+
const entities = (0, combi_1.seq)((0, combi_1.optPrio)("AUGMENTING"), "ENTITIES OF", expressions_1.NamespaceSimpleName, (0, combi_1.optPrio)((0, combi_1.altPrio)("IN LOCAL MODE", (0, combi_1.seq)((0, combi_1.opt)("FORWARDING"), "PRIVILEGED"))), (0, combi_1.plusPrio)((0, combi_1.seq)("ENTITY", expressions_1.NamespaceSimpleName, (0, combi_1.plus)(operation))));
|
|
17389
17392
|
const dynamic = (0, combi_1.seq)("ENTITIES", (0, combi_1.optPrio)((0, combi_1.altPrio)("IN LOCAL MODE", (0, combi_1.seq)((0, combi_1.opt)("FORWARDING"), "PRIVILEGED"))), "OPERATIONS", expressions_1.Source);
|
|
17390
17393
|
const create2 = (0, combi_1.seq)("CREATE", fieldsWith, (0, combi_1.opt)((0, combi_1.seq)("CREATE BY", expressions_1.EMLEntityPath, fieldsWith)));
|
|
17391
17394
|
const create3 = (0, combi_1.seq)("CREATE BY", expressions_1.EMLEntityPath, fieldsWith);
|
|
@@ -25483,6 +25486,12 @@ class BuiltIn {
|
|
|
25483
25486
|
}
|
|
25484
25487
|
return this.buildDefinition(def, name);
|
|
25485
25488
|
}
|
|
25489
|
+
static hasUnnamedArgument(name) {
|
|
25490
|
+
if (name === undefined) {
|
|
25491
|
+
return false;
|
|
25492
|
+
}
|
|
25493
|
+
return BuiltIn.unnamedArgument.has(name.toUpperCase());
|
|
25494
|
+
}
|
|
25486
25495
|
static isPredicate(name) {
|
|
25487
25496
|
if (name === undefined) {
|
|
25488
25497
|
return undefined;
|
|
@@ -26584,6 +26593,12 @@ BuiltIn.methods = {
|
|
|
26584
26593
|
return: basic_1.IntegerType.get(),
|
|
26585
26594
|
},
|
|
26586
26595
|
};
|
|
26596
|
+
// functions called with exactly one unnamed argument, all others take named arguments like "val"
|
|
26597
|
+
BuiltIn.unnamedArgument = new Set([
|
|
26598
|
+
"ABS", "ACOS", "ASIN", "ATAN", "BOOLC", "CEIL", "CHARLEN", "COS", "COSH", "DBMAXLEN", "EXP", "FLOOR",
|
|
26599
|
+
"FRAC", "LINES", "LOG", "LOG10", "NUMOFCHAR", "SIGN", "SIN", "SINH", "SQRT", "STRLEN", "TAN", "TANH",
|
|
26600
|
+
"TRUNC", "XSTRLEN"
|
|
26601
|
+
]);
|
|
26587
26602
|
//# sourceMappingURL=_builtin.js.map
|
|
26588
26603
|
|
|
26589
26604
|
/***/ },
|
|
@@ -38637,17 +38652,54 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
38637
38652
|
})();
|
|
38638
38653
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
38639
38654
|
exports.Case = void 0;
|
|
38655
|
+
exports.checkCaseOperand = checkCaseOperand;
|
|
38640
38656
|
const Expressions = __importStar(__webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js"));
|
|
38641
38657
|
const source_1 = __webpack_require__(/*! ../expressions/source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js");
|
|
38658
|
+
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
|
|
38659
|
+
const _builtin_1 = __webpack_require__(/*! ../_builtin */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js");
|
|
38660
|
+
const _object_oriented_1 = __webpack_require__(/*! ../_object_oriented */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js");
|
|
38661
|
+
const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
|
|
38662
|
+
const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
|
|
38642
38663
|
class Case {
|
|
38643
38664
|
runSyntax(node, input) {
|
|
38644
38665
|
// just recurse
|
|
38645
38666
|
for (const s of node.findDirectExpressions(Expressions.Source)) {
|
|
38646
38667
|
source_1.Source.runSyntax(s, input);
|
|
38668
|
+
checkCaseOperand(s, input);
|
|
38647
38669
|
}
|
|
38648
38670
|
}
|
|
38649
38671
|
}
|
|
38650
38672
|
exports.Case = Case;
|
|
38673
|
+
// Before 7.40 SP02 the operands of CASE and WHEN are enhanced functional operand positions: besides
|
|
38674
|
+
// data objects and functional methods, only built-in functions with exactly one unnamed argument are allowed
|
|
38675
|
+
function checkCaseOperand(source, input) {
|
|
38676
|
+
var _a, _b;
|
|
38677
|
+
if ((0, version_1.releaseAtLeast)(input.scope.getRelease(), version_1.Release.v740sp02)
|
|
38678
|
+
|| input.scope.getLanguageVersion() === version_1.LanguageVersion.Cloud
|
|
38679
|
+
|| input.scope.getOpenABAP()) {
|
|
38680
|
+
return;
|
|
38681
|
+
}
|
|
38682
|
+
const chain = source.findDirectExpression(Expressions.MethodCallChain);
|
|
38683
|
+
if (chain === undefined || source.getChildren().length !== 1 || chain.getChildren().length !== 1) {
|
|
38684
|
+
return;
|
|
38685
|
+
}
|
|
38686
|
+
const call = chain.findDirectExpression(Expressions.MethodCall);
|
|
38687
|
+
const nameToken = (_a = call === null || call === void 0 ? void 0 : call.findDirectExpression(Expressions.MethodName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
38688
|
+
const name = nameToken === null || nameToken === void 0 ? void 0 : nameToken.getStr();
|
|
38689
|
+
if (nameToken === undefined || _builtin_1.BuiltIn.searchBuiltin(name) === undefined || _builtin_1.BuiltIn.hasUnnamedArgument(name)) {
|
|
38690
|
+
return;
|
|
38691
|
+
}
|
|
38692
|
+
// a method of the enclosing class takes precedence over the built-in function
|
|
38693
|
+
const meType = (_b = input.scope.findVariable("me")) === null || _b === void 0 ? void 0 : _b.getType();
|
|
38694
|
+
if (meType instanceof basic_1.ObjectReferenceType) {
|
|
38695
|
+
const def = input.scope.findObjectDefinition(meType.getIdentifierName());
|
|
38696
|
+
if (new _object_oriented_1.ObjectOriented(input.scope).searchMethodName(def, name).method !== undefined) {
|
|
38697
|
+
return;
|
|
38698
|
+
}
|
|
38699
|
+
}
|
|
38700
|
+
const message = "Built-in function " + name + " not allowed as CASE/WHEN operand before v740sp02";
|
|
38701
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, nameToken, message));
|
|
38702
|
+
}
|
|
38651
38703
|
//# sourceMappingURL=case.js.map
|
|
38652
38704
|
|
|
38653
38705
|
/***/ },
|
|
@@ -40005,10 +40057,22 @@ const basic_types_1 = __webpack_require__(/*! ../basic_types */ "./node_modules/
|
|
|
40005
40057
|
const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
|
|
40006
40058
|
const _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifier */ "./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js");
|
|
40007
40059
|
const _reference_1 = __webpack_require__(/*! ../_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
|
|
40060
|
+
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
|
|
40008
40061
|
class CreateData {
|
|
40009
40062
|
runSyntax(node, input) {
|
|
40063
|
+
const likeLineOf = node.concatTokens().toUpperCase().includes(" LIKE LINE OF ");
|
|
40010
40064
|
for (const s of node.findDirectExpressions(Expressions.Source)) {
|
|
40011
|
-
source_1.Source.runSyntax(s, input);
|
|
40065
|
+
const sourceType = source_1.Source.runSyntax(s, input);
|
|
40066
|
+
if (likeLineOf === true
|
|
40067
|
+
&& sourceType !== undefined
|
|
40068
|
+
&& !(sourceType instanceof basic_1.TableType)
|
|
40069
|
+
&& !(sourceType instanceof basic_1.VoidType)
|
|
40070
|
+
&& !(sourceType instanceof basic_1.UnknownType)
|
|
40071
|
+
&& !(sourceType instanceof basic_1.AnyType)) {
|
|
40072
|
+
const message = `"${s.concatTokens()}" is not an internal table`;
|
|
40073
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
40074
|
+
return;
|
|
40075
|
+
}
|
|
40012
40076
|
}
|
|
40013
40077
|
for (const t of node.findDirectExpressions(Expressions.Target)) {
|
|
40014
40078
|
target_1.Target.runSyntax(t, input);
|
|
@@ -40193,6 +40257,11 @@ class CreateObject {
|
|
|
40193
40257
|
ooName = found.getVoided();
|
|
40194
40258
|
}
|
|
40195
40259
|
input.scope.addReference(t === null || t === void 0 ? void 0 : t.getFirstToken(), cdef, _reference_1.ReferenceType.ConstructorReference, input.filename, { ooName: ooName });
|
|
40260
|
+
if (type && type.get() instanceof Expressions.Dynamic) {
|
|
40261
|
+
// the class is only known at runtime, cdef is the static type of the target
|
|
40262
|
+
this.validateParameters(undefined, node, input);
|
|
40263
|
+
return;
|
|
40264
|
+
}
|
|
40196
40265
|
if (cdef !== undefined) {
|
|
40197
40266
|
const err = CreateObject.checkInstantiationAllowed(cdef, input);
|
|
40198
40267
|
if (err) {
|
|
@@ -47704,11 +47773,15 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
47704
47773
|
exports.When = void 0;
|
|
47705
47774
|
const Expressions = __importStar(__webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js"));
|
|
47706
47775
|
const source_1 = __webpack_require__(/*! ../expressions/source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js");
|
|
47776
|
+
const case_1 = __webpack_require__(/*! ./case */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/case.js");
|
|
47707
47777
|
class When {
|
|
47708
47778
|
runSyntax(node, input) {
|
|
47709
47779
|
for (const s of node.findAllExpressions(Expressions.Source)) {
|
|
47710
47780
|
source_1.Source.runSyntax(s, input);
|
|
47711
47781
|
}
|
|
47782
|
+
for (const s of node.findDirectExpressions(Expressions.Source)) {
|
|
47783
|
+
(0, case_1.checkCaseOperand)(s, input);
|
|
47784
|
+
}
|
|
47712
47785
|
}
|
|
47713
47786
|
}
|
|
47714
47787
|
exports.When = When;
|
|
@@ -71242,7 +71315,7 @@ class Registry {
|
|
|
71242
71315
|
}
|
|
71243
71316
|
static abaplintVersion() {
|
|
71244
71317
|
// magic, see build script "version.js"
|
|
71245
|
-
return "2.120.
|
|
71318
|
+
return "2.120.63";
|
|
71246
71319
|
}
|
|
71247
71320
|
getDDICReferences() {
|
|
71248
71321
|
return this.ddicReferences;
|
|
@@ -71875,12 +71948,13 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-on
|
|
|
71875
71948
|
return issues;
|
|
71876
71949
|
}
|
|
71877
71950
|
getAbapdoc(rows, pos) {
|
|
71951
|
+
var _a, _b, _c;
|
|
71878
71952
|
let previousRow = pos.getRow() - 2;
|
|
71879
|
-
let rowText = rows[previousRow].trim().toUpperCase();
|
|
71953
|
+
let rowText = ((_a = rows[previousRow]) !== null && _a !== void 0 ? _a : "").trim().toUpperCase();
|
|
71880
71954
|
const text = [];
|
|
71881
71955
|
if (rowText === "METHODS" || rowText === "CLASS-METHODS") {
|
|
71882
71956
|
previousRow--;
|
|
71883
|
-
rowText = rows[previousRow].trim().toUpperCase();
|
|
71957
|
+
rowText = ((_b = rows[previousRow]) !== null && _b !== void 0 ? _b : "").trim().toUpperCase();
|
|
71884
71958
|
}
|
|
71885
71959
|
text.push(rowText);
|
|
71886
71960
|
//we need to push the first row despite if it is actually an abapdoc or not
|
|
@@ -71888,7 +71962,7 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-on
|
|
|
71888
71962
|
if (rowText.trim().substring(0, 2) === "\"!") {
|
|
71889
71963
|
while (previousRow >= 0) {
|
|
71890
71964
|
previousRow--;
|
|
71891
|
-
rowText = rows[previousRow].trim().toUpperCase();
|
|
71965
|
+
rowText = ((_c = rows[previousRow]) !== null && _c !== void 0 ? _c : "").trim().toUpperCase();
|
|
71892
71966
|
if (rowText.trim().substring(0, 2) !== "\"!") {
|
|
71893
71967
|
break;
|
|
71894
71968
|
}
|
|
@@ -102352,6 +102426,8 @@ class XMLConsistencyConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
|
102352
102426
|
this.textAndTranslationLengthSeverity = severity_1.Severity.Error;
|
|
102353
102427
|
/** Problem severity for data element(DTEL) field checks */
|
|
102354
102428
|
this.dataElementSeverity = severity_1.Severity.Error;
|
|
102429
|
+
/** Problem severity for transparent table checks */
|
|
102430
|
+
this.transparentTableSeverity = severity_1.Severity.Error;
|
|
102355
102431
|
}
|
|
102356
102432
|
}
|
|
102357
102433
|
exports.XMLConsistencyConf = XMLConsistencyConf;
|
|
@@ -102639,11 +102715,11 @@ class XMLConsistency {
|
|
|
102639
102715
|
if (obj.getTableCategory() === Objects.TableCategory.Transparent) {
|
|
102640
102716
|
if (!((_c = obj.getDeliveryClass()) === null || _c === void 0 ? void 0 : _c.trim())) {
|
|
102641
102717
|
const message = `Transparent table must have delivery class(CONTFLAG in DD02V) set`;
|
|
102642
|
-
issues.push(issue_1.Issue.atRow(file, 1, message, this.getMetadata().key, this.conf.
|
|
102718
|
+
issues.push(issue_1.Issue.atRow(file, 1, message, this.getMetadata().key, this.conf.transparentTableSeverity));
|
|
102643
102719
|
}
|
|
102644
102720
|
if (!((_d = obj.getSizeCategory()) === null || _d === void 0 ? void 0 : _d.trim())) {
|
|
102645
102721
|
const message = `Transparent table must have size category(TABKAT in DD09L) set`;
|
|
102646
|
-
issues.push(issue_1.Issue.atRow(file, 1, message, this.getMetadata().key, this.conf.
|
|
102722
|
+
issues.push(issue_1.Issue.atRow(file, 1, message, this.getMetadata().key, this.conf.transparentTableSeverity));
|
|
102647
102723
|
}
|
|
102648
102724
|
}
|
|
102649
102725
|
return issues;
|
|
@@ -115665,11 +115741,14 @@ class DoTranspiler {
|
|
|
115665
115741
|
transpile(node, traversal) {
|
|
115666
115742
|
const found = node.findFirstExpression(abaplint.Expressions.Source);
|
|
115667
115743
|
if (found) {
|
|
115668
|
-
|
|
115744
|
+
// the count is converted to i, like any numeric expression position: an
|
|
115745
|
+
// f count read with get( ) gives its text 3,0000000000000000E+00, which
|
|
115746
|
+
// no loop counter compares with, and a p count of 2.4 means 2 passes
|
|
115747
|
+
const source = new expressions_1.SourceTranspiler(false).transpile(found, traversal).getCode();
|
|
115669
115748
|
const idSource = unique_identifier_1.UniqueIdentifier.get();
|
|
115670
115749
|
const id = unique_identifier_1.UniqueIdentifier.get();
|
|
115671
115750
|
return new chunk_1.Chunk(`const ${this.syIndexBackup} = abap.builtin.sy.get().index.get();
|
|
115672
|
-
const ${idSource} = ${source};
|
|
115751
|
+
const ${idSource} = new abap.types.Integer().set(${source}).get();
|
|
115673
115752
|
for (let ${id} = 0; ${id} < ${idSource}; ${id}++) {
|
|
115674
115753
|
abap.builtin.sy.get().index.set(${id} + 1);`);
|
|
115675
115754
|
}
|
|
@@ -117989,7 +118068,10 @@ class LoopTranspiler {
|
|
|
117989
118068
|
extra.push(`atLast: (last) => { ${this.atLast} = last; }`);
|
|
117990
118069
|
}
|
|
117991
118070
|
const topEquals = {};
|
|
117992
|
-
|
|
118071
|
+
// only a pure conjunction makes each top-level `=` a condition every row
|
|
118072
|
+
// has to meet: `a = 1 OR b = 2` narrows by neither
|
|
118073
|
+
const onlyAnd = whereNode?.getChildren().every(c => !(c instanceof abaplint.Nodes.TokenNode) || c.concatTokens().toUpperCase() !== "OR") ?? true;
|
|
118074
|
+
for (const compare of onlyAnd ? whereNode?.findDirectExpressions(abaplint.Expressions.ComponentCompare) || [] : []) {
|
|
117993
118075
|
const op = compare.findDirectExpression(abaplint.Expressions.CompareOperator)?.concatTokens().toUpperCase();
|
|
117994
118076
|
if (op !== "=" && op !== "EQ") {
|
|
117995
118077
|
continue;
|
|
@@ -122090,8 +122172,12 @@ class UpdateDatabaseTranspiler {
|
|
|
122090
122172
|
}
|
|
122091
122173
|
options.push(`"set": [${s.join(",")}]`);
|
|
122092
122174
|
}
|
|
122175
|
+
const fromTable = node.findExpressionAfterToken("TABLE");
|
|
122176
|
+
if (fromTable && fromTable.get() instanceof abaplint.Expressions.SQLSource) {
|
|
122177
|
+
options.push(`"table": ` + traversal.traverse(fromTable).getCode());
|
|
122178
|
+
}
|
|
122093
122179
|
const sourceExpression = node.findDirectExpression(abaplint.Expressions.SQLSource)?.findDirectExpression(abaplint.Expressions.SimpleSource3);
|
|
122094
|
-
if (sourceExpression) {
|
|
122180
|
+
if (sourceExpression && fromTable === undefined) {
|
|
122095
122181
|
const sqlSource = new expressions_1.SourceTranspiler(true).transpile(sourceExpression, traversal).getCode();
|
|
122096
122182
|
const tableName = node.findDirectExpression(abaplint.Expressions.DatabaseTable)?.concatTokens();
|
|
122097
122183
|
const tabl = traversal.findTable(tableName);
|
|
@@ -131464,7 +131550,23 @@ function pLimit(concurrency) {
|
|
|
131464
131550
|
},
|
|
131465
131551
|
map: {
|
|
131466
131552
|
async value(iterable, function_) {
|
|
131467
|
-
const promises =
|
|
131553
|
+
const promises = [];
|
|
131554
|
+
|
|
131555
|
+
try {
|
|
131556
|
+
Array.from(iterable, (value, index) => {
|
|
131557
|
+
const promise = generator(function_, value, index);
|
|
131558
|
+
promises.push(promise);
|
|
131559
|
+
return promise;
|
|
131560
|
+
});
|
|
131561
|
+
} catch (error) {
|
|
131562
|
+
// The iterable threw, so `Promise.all` never observes the already scheduled promises. Observe them here to avoid unhandled rejections.
|
|
131563
|
+
for (const promise of promises) {
|
|
131564
|
+
promise.catch(() => {}); // eslint-disable-line promise/prefer-await-to-then
|
|
131565
|
+
}
|
|
131566
|
+
|
|
131567
|
+
throw error;
|
|
131568
|
+
}
|
|
131569
|
+
|
|
131468
131570
|
return Promise.all(promises);
|
|
131469
131571
|
},
|
|
131470
131572
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.95",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
"author": "abaplint",
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@abaplint/core": "^2.120.
|
|
31
|
-
"@abaplint/transpiler": "^2.13.
|
|
30
|
+
"@abaplint/core": "^2.120.63",
|
|
31
|
+
"@abaplint/transpiler": "^2.13.95",
|
|
32
32
|
"@types/glob": "^9.0.0",
|
|
33
33
|
"@types/node": "^26.6.2",
|
|
34
34
|
"@types/progress": "^2.0.7",
|
|
35
35
|
"glob": "^13.0.6",
|
|
36
|
-
"p-limit": "^7.3.
|
|
36
|
+
"p-limit": "^7.3.3",
|
|
37
37
|
"progress": "^2.0.3",
|
|
38
38
|
"ts-json-schema-generator": "^2.9.0",
|
|
39
39
|
"typescript": "^6.0.3",
|