@abaplint/cli 2.119.51 → 2.119.52
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/cli.js +45 -32
- package/package.json +2 -2
package/build/cli.js
CHANGED
|
@@ -2618,14 +2618,13 @@ class Combi {
|
|
|
2618
2618
|
return res;
|
|
2619
2619
|
}
|
|
2620
2620
|
// assumption: no pragmas supplied in tokens input
|
|
2621
|
-
static run(runnable, tokens, versionOrRelease, languageVersion = version_1.LanguageVersion.Normal
|
|
2622
|
-
this.openABAP = openABAP || versionOrRelease === version_1.Version.OpenABAP;
|
|
2621
|
+
static run(runnable, tokens, versionOrRelease, languageVersion = version_1.LanguageVersion.Normal) {
|
|
2623
2622
|
this.langVer = languageVersion;
|
|
2624
2623
|
if (typeof versionOrRelease === "string") {
|
|
2625
|
-
this.release =
|
|
2624
|
+
this.release = (0, version_1.versionToABAPRelease)(versionOrRelease);
|
|
2626
2625
|
}
|
|
2627
2626
|
else {
|
|
2628
|
-
this.release =
|
|
2627
|
+
this.release = versionOrRelease;
|
|
2629
2628
|
}
|
|
2630
2629
|
const input = new result_1.Result(tokens, 0);
|
|
2631
2630
|
try {
|
|
@@ -2658,14 +2657,13 @@ class Combi {
|
|
|
2658
2657
|
return this.langVer;
|
|
2659
2658
|
}
|
|
2660
2659
|
static isOpenABAP() {
|
|
2661
|
-
return this.
|
|
2660
|
+
return this.release === version_1.Release["open-abap"];
|
|
2662
2661
|
}
|
|
2663
2662
|
}
|
|
2664
2663
|
exports.Combi = Combi;
|
|
2665
2664
|
// todo, change this class to be instantiated, constructor(runnable) ?
|
|
2666
2665
|
Combi.release = version_1.Release.v758;
|
|
2667
2666
|
Combi.langVer = version_1.LanguageVersion.Normal;
|
|
2668
|
-
Combi.openABAP = false;
|
|
2669
2667
|
// -----------------------------------------------------------------------------
|
|
2670
2668
|
function str(s) {
|
|
2671
2669
|
if (s.indexOf(" ") > 0 || s.indexOf("-") > 0) {
|
|
@@ -11148,13 +11146,12 @@ class WorkArea {
|
|
|
11148
11146
|
}
|
|
11149
11147
|
}
|
|
11150
11148
|
class StatementParser {
|
|
11151
|
-
constructor(release, reg, languageVersion = version_1.LanguageVersion.Normal
|
|
11149
|
+
constructor(release, reg, languageVersion = version_1.LanguageVersion.Normal) {
|
|
11152
11150
|
if (!StatementParser.map) {
|
|
11153
11151
|
StatementParser.map = new StatementMap();
|
|
11154
11152
|
}
|
|
11155
11153
|
this.release = release;
|
|
11156
11154
|
this.languageVersion = languageVersion;
|
|
11157
|
-
this.openABAP = openABAP;
|
|
11158
11155
|
this.reg = reg;
|
|
11159
11156
|
}
|
|
11160
11157
|
/** input is one full object */
|
|
@@ -11311,7 +11308,7 @@ class StatementParser {
|
|
|
11311
11308
|
return new nodes_1.StatementNode(new _statement_1.Empty()).setChildren(this.tokensToNodes(tokens));
|
|
11312
11309
|
}
|
|
11313
11310
|
for (const st of StatementParser.map.lookup(filtered[0].getStr())) {
|
|
11314
|
-
const match = combi_1.Combi.run(st.matcher, filtered, this.release, this.languageVersion
|
|
11311
|
+
const match = combi_1.Combi.run(st.matcher, filtered, this.release, this.languageVersion);
|
|
11315
11312
|
if (match) {
|
|
11316
11313
|
const last = tokens[tokens.length - 1];
|
|
11317
11314
|
match.push(new nodes_1.TokenNode(last));
|
|
@@ -11321,7 +11318,7 @@ class StatementParser {
|
|
|
11321
11318
|
}
|
|
11322
11319
|
// next try the statements without specific keywords
|
|
11323
11320
|
for (const st of StatementParser.map.lookup("")) {
|
|
11324
|
-
const match = combi_1.Combi.run(st.matcher, filtered, this.release, this.languageVersion
|
|
11321
|
+
const match = combi_1.Combi.run(st.matcher, filtered, this.release, this.languageVersion);
|
|
11325
11322
|
if (match) {
|
|
11326
11323
|
const last = tokens[tokens.length - 1];
|
|
11327
11324
|
match.push(new nodes_1.TokenNode(last));
|
|
@@ -33276,10 +33273,18 @@ class Select {
|
|
|
33276
33273
|
for (const s of node.findDirectExpressions(Expressions.SQLSource)) {
|
|
33277
33274
|
sql_source_1.SQLSource.runSyntax(s, input);
|
|
33278
33275
|
}
|
|
33276
|
+
const upToWhere = node.findDirectExpression(Expressions.SQLCond);
|
|
33277
|
+
const isCloud = input.scope.getLanguageVersion() === version_1.LanguageVersion.Cloud;
|
|
33279
33278
|
for (const up of node.findDirectExpressions(Expressions.SQLUpTo)) {
|
|
33279
|
+
// in classic Open SQL (INTO before WHERE) "UP TO" is allowed before INTO,
|
|
33280
|
+
// in strict Open SQL (INTO after WHERE) "UP TO" must be placed after INTO
|
|
33281
|
+
const intoAfterWhere = upToWhere !== undefined
|
|
33282
|
+
&& intoExpression !== undefined
|
|
33283
|
+
&& intoExpression.getFirstToken().getStart().isAfter(upToWhere.getFirstToken().getStart());
|
|
33280
33284
|
if (intoExpression
|
|
33281
33285
|
&& this.isStrictMode(node, input)
|
|
33282
|
-
&& (
|
|
33286
|
+
&& (isCloud || (this.upToUsesHostVariable(up) && intoAfterWhere))
|
|
33287
|
+
&& (selectLoop === false || isCloud)
|
|
33283
33288
|
&& from.getFirstToken().getStart().isBefore(up.getFirstToken().getStart())
|
|
33284
33289
|
&& up.getFirstToken().getStart().isBefore(intoExpression.getFirstToken().getStart())) {
|
|
33285
33290
|
const message = `The addition "UP TO n ROWS" must only be placed after the INTO/APPENDING clause.`;
|
|
@@ -33317,6 +33322,10 @@ class Select {
|
|
|
33317
33322
|
input.scope.pop(node.getLastToken().getEnd());
|
|
33318
33323
|
}
|
|
33319
33324
|
}
|
|
33325
|
+
static upToUsesHostVariable(up) {
|
|
33326
|
+
var _a;
|
|
33327
|
+
return ((_a = up.findFirstExpression(Expressions.SQLSource)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr()) === "@";
|
|
33328
|
+
}
|
|
33320
33329
|
static buildUpToRowsFix(node, input, up, intoExpression) {
|
|
33321
33330
|
const tokens = node.getTokens();
|
|
33322
33331
|
const upLast = up.getLastToken();
|
|
@@ -47399,19 +47408,17 @@ const structure_parser_1 = __webpack_require__(/*! ./3_structures/structure_pars
|
|
|
47399
47408
|
const version_1 = __webpack_require__(/*! ../version */ "../core/build/src/version.js");
|
|
47400
47409
|
class ABAPParser {
|
|
47401
47410
|
constructor(optionsOrRelease, globalMacros, reg) {
|
|
47402
|
-
var _a, _b, _c
|
|
47411
|
+
var _a, _b, _c;
|
|
47403
47412
|
if (optionsOrRelease === undefined || ABAPParser.isRelease(optionsOrRelease)) {
|
|
47404
47413
|
this.release = optionsOrRelease !== null && optionsOrRelease !== void 0 ? optionsOrRelease : version_1.defaultRelease;
|
|
47405
47414
|
this.languageVersion = version_1.LanguageVersion.Normal;
|
|
47406
|
-
this.openABAP = false;
|
|
47407
47415
|
this.globalMacros = globalMacros !== null && globalMacros !== void 0 ? globalMacros : [];
|
|
47408
47416
|
this.reg = reg;
|
|
47409
47417
|
}
|
|
47410
47418
|
else {
|
|
47411
47419
|
this.release = (_a = optionsOrRelease.release) !== null && _a !== void 0 ? _a : version_1.defaultRelease;
|
|
47412
47420
|
this.languageVersion = (_b = optionsOrRelease.languageVersion) !== null && _b !== void 0 ? _b : version_1.LanguageVersion.Normal;
|
|
47413
|
-
this.
|
|
47414
|
-
this.globalMacros = (_d = optionsOrRelease.globalMacros) !== null && _d !== void 0 ? _d : [];
|
|
47421
|
+
this.globalMacros = (_c = optionsOrRelease.globalMacros) !== null && _c !== void 0 ? _c : [];
|
|
47415
47422
|
this.reg = optionsOrRelease.reg;
|
|
47416
47423
|
}
|
|
47417
47424
|
}
|
|
@@ -47429,7 +47436,7 @@ class ABAPParser {
|
|
|
47429
47436
|
const lexingRuntime = Date.now() - b1;
|
|
47430
47437
|
// 2: statements
|
|
47431
47438
|
const b2 = Date.now();
|
|
47432
|
-
const statementResult = new statement_parser_1.StatementParser(this.release, this.reg, this.languageVersion
|
|
47439
|
+
const statementResult = new statement_parser_1.StatementParser(this.release, this.reg, this.languageVersion)
|
|
47433
47440
|
.run(lexerResult, this.globalMacros);
|
|
47434
47441
|
const statementsRuntime = Date.now() - b2;
|
|
47435
47442
|
// 3: structures
|
|
@@ -53994,7 +54001,7 @@ const artifacts_rules_1 = __webpack_require__(/*! ./artifacts_rules */ "../core/
|
|
|
53994
54001
|
const JSON5 = __importStar(__webpack_require__(/*! json5 */ "../core/node_modules/json5/dist/index.mjs"));
|
|
53995
54002
|
// assumption: this class is immutable
|
|
53996
54003
|
class Config {
|
|
53997
|
-
static getDefault(ver, langVer
|
|
54004
|
+
static getDefault(ver, langVer) {
|
|
53998
54005
|
const rules = {};
|
|
53999
54006
|
const sorted = artifacts_rules_1.ArtifactsRules.getRules().sort((a, b) => {
|
|
54000
54007
|
return a.getMetadata().key.localeCompare(b.getMetadata().key);
|
|
@@ -54028,7 +54035,6 @@ class Config {
|
|
|
54028
54035
|
syntax: {
|
|
54029
54036
|
version,
|
|
54030
54037
|
languageVersion: langVer,
|
|
54031
|
-
openABAP,
|
|
54032
54038
|
errorNamespace: "^(Z|Y|LCL\_|TY\_|LIF\_)",
|
|
54033
54039
|
globalConstants: [],
|
|
54034
54040
|
globalMacros: [],
|
|
@@ -54120,7 +54126,7 @@ class Config {
|
|
|
54120
54126
|
return (0, version_1.versionToABAPRelease)(v);
|
|
54121
54127
|
}
|
|
54122
54128
|
getOpenABAP() {
|
|
54123
|
-
return this.
|
|
54129
|
+
return this.getRelease() === version_1.Release["open-abap"];
|
|
54124
54130
|
}
|
|
54125
54131
|
getVersion() {
|
|
54126
54132
|
const v = this.config.syntax.version;
|
|
@@ -54157,10 +54163,8 @@ class Config {
|
|
|
54157
54163
|
if (version === version_1.Version.Cloud) {
|
|
54158
54164
|
this.config.syntax.languageVersion = version_1.LanguageVersion.Cloud;
|
|
54159
54165
|
}
|
|
54160
|
-
|
|
54161
|
-
|
|
54162
|
-
this.config.syntax.openABAP = true;
|
|
54163
|
-
}
|
|
54166
|
+
// OpenABAP keeps its own version identity; open-abap-ness is derived from the
|
|
54167
|
+
// release in getOpenABAP() rather than a separate stored flag.
|
|
54164
54168
|
}
|
|
54165
54169
|
}
|
|
54166
54170
|
exports.Config = Config;
|
|
@@ -58531,12 +58535,12 @@ class ABAPObject extends _abstract_object_1.AbstractObject {
|
|
|
58531
58535
|
static is(x) {
|
|
58532
58536
|
return !!x && x instanceof ABAPObject;
|
|
58533
58537
|
}
|
|
58534
|
-
parse(release, globalMacros, reg, languageVersion = version_1.LanguageVersion.Normal
|
|
58538
|
+
parse(release, globalMacros, reg, languageVersion = version_1.LanguageVersion.Normal) {
|
|
58535
58539
|
if (this.isDirty() === false) {
|
|
58536
58540
|
return { updated: false, runtime: 0 };
|
|
58537
58541
|
}
|
|
58538
58542
|
const abapFiles = this.getFiles().filter(f => f.getFilename().endsWith(".abap"));
|
|
58539
|
-
const result = new abap_parser_1.ABAPParser({ release, globalMacros, reg, languageVersion
|
|
58543
|
+
const result = new abap_parser_1.ABAPParser({ release, globalMacros, reg, languageVersion }).parse(abapFiles);
|
|
58540
58544
|
this.parsed = result.output;
|
|
58541
58545
|
this.old = result.issues;
|
|
58542
58546
|
this.dirty = false;
|
|
@@ -58682,7 +58686,7 @@ class AbstractObject {
|
|
|
58682
58686
|
getParsingIssues() {
|
|
58683
58687
|
return this.old;
|
|
58684
58688
|
}
|
|
58685
|
-
parse(_release, _globalMacros, _reg, _languageVersion
|
|
58689
|
+
parse(_release, _globalMacros, _reg, _languageVersion) {
|
|
58686
58690
|
return { updated: false, runtime: 0 };
|
|
58687
58691
|
}
|
|
58688
58692
|
getName() {
|
|
@@ -67988,7 +67992,7 @@ class Registry {
|
|
|
67988
67992
|
}
|
|
67989
67993
|
static abaplintVersion() {
|
|
67990
67994
|
// magic, see build script "version.js"
|
|
67991
|
-
return "2.119.
|
|
67995
|
+
return "2.119.52";
|
|
67992
67996
|
}
|
|
67993
67997
|
getDDICReferences() {
|
|
67994
67998
|
return this.ddicReferences;
|
|
@@ -68236,7 +68240,7 @@ class Registry {
|
|
|
68236
68240
|
// todo, refactor, this is a mess, see where-used, a lot of the code should be in this method instead
|
|
68237
68241
|
parsePrivate(input) {
|
|
68238
68242
|
const config = this.getConfig();
|
|
68239
|
-
const result = input.parse(config.getRelease(), config.getSyntaxSetttings().globalMacros, this, config.getLanguageVersion()
|
|
68243
|
+
const result = input.parse(config.getRelease(), config.getSyntaxSetttings().globalMacros, this, config.getLanguageVersion());
|
|
68240
68244
|
ParsingPerformance.push(input, result);
|
|
68241
68245
|
}
|
|
68242
68246
|
isDirty() {
|
|
@@ -97796,6 +97800,12 @@ const releaseDefsRaw = [
|
|
|
97796
97800
|
["v700", { abap: "700", kernel: 700, op: 700, cloud: null, ce: null }],
|
|
97797
97801
|
["v701", { abap: "701", kernel: 701, op: 701, cloud: null, ce: null }],
|
|
97798
97802
|
["v702", { abap: "702", kernel: 702, op: 702, cloud: null, ce: null }],
|
|
97803
|
+
// OpenABAP: not a real SAP release. A dialect that is "702 baseline + a curated set
|
|
97804
|
+
// of newer features" (opted in per-statement via AlsoIn.OpenABAP). Placed right after
|
|
97805
|
+
// v702 on purpose: its ordinal must behave exactly like v702 for releaseAtLeast() gates
|
|
97806
|
+
// (nothing else gates between v702 and v710), while staying a distinct identity so
|
|
97807
|
+
// open-abap can be detected without a separate boolean flag.
|
|
97808
|
+
["open-abap", { abap: "open-abap", kernel: null, op: null, cloud: null, ce: null }],
|
|
97799
97809
|
["v710", { abap: "710", kernel: 710, op: 710, cloud: null, ce: null }],
|
|
97800
97810
|
["v711", { abap: "711", kernel: 711, op: 711, cloud: null, ce: null }],
|
|
97801
97811
|
["v720", { abap: "720", kernel: 720, op: 720, cloud: null, ce: null }],
|
|
@@ -97870,10 +97880,13 @@ const releaseDefsRaw = [
|
|
|
97870
97880
|
];
|
|
97871
97881
|
/** All known releases in chronological order. Declaration order IS the ordering. */
|
|
97872
97882
|
exports.ReleaseList = releaseDefsRaw.map(([name, r], i) => Object.freeze(Object.assign(Object.assign({}, r), { name, ordinal: i })));
|
|
97883
|
+
/** Base lookup, keyed by the raw release name (e.g. `"v762"`, `"Newest"`). */
|
|
97884
|
+
const byName = Object.fromEntries(releaseDefsRaw.map(([name], i) => [name, exports.ReleaseList[i]]));
|
|
97873
97885
|
/** Lookup table keyed by release name (e.g. `Release.v740sp05`, `Release.Newest`). */
|
|
97874
|
-
exports.Release = Object.freeze(Object.assign(Object.assign({},
|
|
97875
|
-
// Deprecated aliases: on-prem v750–v758 map to last cloud row at that op
|
|
97876
|
-
|
|
97886
|
+
exports.Release = Object.freeze(Object.assign(Object.assign({}, byName), {
|
|
97887
|
+
// Deprecated aliases: on-prem v750–v758 map to last cloud row at that op.
|
|
97888
|
+
// Referenced by cloud name (not array index) so inserting rows can't silently repoint them.
|
|
97889
|
+
v750: byName["v762"], v751: byName["v765"], v752: byName["v769"], v753: byName["v773"], v754: byName["v777"], v755: byName["v781"], v756: byName["v785"], v757: byName["v789"], v758: byName["v793"], v816: byName["v916"] }));
|
|
97877
97890
|
/**
|
|
97878
97891
|
* Is `running` at least as new as `required`?
|
|
97879
97892
|
* Comparison is purely by ordinal (declaration order in ReleaseList).
|
|
@@ -97902,7 +97915,7 @@ const byDeprecated = Object.freeze({
|
|
|
97902
97915
|
[Version.v758]: exports.Release["v758"],
|
|
97903
97916
|
[Version.v816]: exports.Release["v816"],
|
|
97904
97917
|
[Version.Cloud]: exports.Release["Newest"], // Cloud → Newest sentinel
|
|
97905
|
-
[Version.OpenABAP]: exports.Release["
|
|
97918
|
+
[Version.OpenABAP]: exports.Release["open-abap"], // OpenABAP is its own release identity (702 baseline + curated features)
|
|
97906
97919
|
});
|
|
97907
97920
|
function versionToABAPRelease(v) {
|
|
97908
97921
|
const found = byDeprecated[v];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.119.
|
|
3
|
+
"version": "2.119.52",
|
|
4
4
|
"description": "abaplint - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"homepage": "https://abaplint.org",
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@abaplint/core": "^2.119.
|
|
42
|
+
"@abaplint/core": "^2.119.52",
|
|
43
43
|
"@types/chai": "^4.3.20",
|
|
44
44
|
"@types/minimist": "^1.2.5",
|
|
45
45
|
"@types/mocha": "^10.0.10",
|