@abaplint/core 2.113.97 → 2.113.99

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.
@@ -7357,6 +7357,7 @@ export declare class VirtualPosition extends Position {
7357
7357
  readonly vcol: number;
7358
7358
  constructor(virtual: Position, row: number, col: number);
7359
7359
  equals(p: Position): boolean;
7360
+ isAfter(p: Position | VirtualPosition): boolean;
7360
7361
  }
7361
7362
 
7362
7363
  export declare enum Visibility {
@@ -7,7 +7,7 @@ const expressions_1 = require("../expressions");
7
7
  // todo, cloud, split?
8
8
  class Export {
9
9
  getMatcher() {
10
- const from = (0, combi_1.seq)("FROM", expressions_1.Source);
10
+ const from = (0, combi_1.seq)((0, combi_1.altPrio)("FROM", "="), expressions_1.Source);
11
11
  const client = (0, combi_1.seq)("CLIENT", expressions_1.Source);
12
12
  const id = (0, combi_1.seq)("ID", expressions_1.Source);
13
13
  const using = (0, combi_1.seq)("USING", expressions_1.Source);
@@ -19,7 +19,7 @@ class Export {
19
19
  const database = (0, combi_1.seq)("DATABASE", cluster, (0, combi_1.per)(from, client, id, using));
20
20
  const target = (0, combi_1.alt)(buffer, memory, database, table, shared);
21
21
  const left = (0, combi_1.alt)(expressions_1.FieldSub, expressions_1.FieldSymbol);
22
- const source = (0, combi_1.alt)((0, combi_1.plus)((0, combi_1.altPrio)(expressions_1.ParameterS, (0, combi_1.seq)(left, from), left)), expressions_1.Dynamic, expressions_1.Constant);
22
+ const source = (0, combi_1.alt)((0, combi_1.plus)((0, combi_1.altPrio)((0, combi_1.seq)(left, from), left)), expressions_1.Dynamic, expressions_1.Constant);
23
23
  const compression = (0, combi_1.seq)("COMPRESSION", (0, combi_1.alt)("ON", "OFF"));
24
24
  const hint = (0, combi_1.seq)("CODE PAGE HINT", expressions_1.Source);
25
25
  return (0, combi_1.seq)("EXPORT", source, "TO", target, (0, combi_1.opt)(compression), (0, combi_1.opt)(hint));
@@ -23,5 +23,6 @@ exports.DECLARATION_STUFF = [
23
23
  Statements.Parameter,
24
24
  Statements.SelectionScreen,
25
25
  Statements.ConstantBegin,
26
+ Statements.Define,
26
27
  ];
27
28
  //# sourceMappingURL=selection_events.js.map
@@ -7,7 +7,7 @@ const cds_integer_1 = require("./cds_integer");
7
7
  class CDSCondition extends combi_1.Expression {
8
8
  getRunnable() {
9
9
  const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.optPrio)((0, combi_1.seq)(".", (0, combi_1.altPrio)(_1.CDSString, _1.CDSName))));
10
- const left = (0, combi_1.altPrio)(_1.CDSString, _1.CDSFunction, name);
10
+ const left = (0, combi_1.altPrio)(_1.CDSString, _1.CDSFunction, _1.CDSAggregate, name);
11
11
  const operators = (0, combi_1.altPrio)("=", (0, combi_1.seq)("!", "="), (0, combi_1.seq)("<", ">"), (0, combi_1.seq)(">", "="), (0, combi_1.seq)("<", "="), "<", ">", "LIKE", "NOT LIKE");
12
12
  const compare = (0, combi_1.seq)(operators, (0, combi_1.altPrio)(left, cds_integer_1.CDSInteger));
13
13
  const is = (0, combi_1.seq)("IS", (0, combi_1.optPrio)("NOT"), (0, combi_1.altPrio)("INITIAL", "NULL"));
@@ -7,7 +7,7 @@ const cds_as_1 = require("./cds_as");
7
7
  const cds_cast_1 = require("./cds_cast");
8
8
  class CDSElement extends combi_1.Expression {
9
9
  getRunnable() {
10
- return (0, combi_1.seq)((0, combi_1.starPrio)(_1.CDSAnnotation), (0, combi_1.optPrio)("KEY"), (0, combi_1.altPrio)(_1.CDSAggregate, _1.CDSString, _1.CDSArithmetics, _1.CDSFunction, cds_cast_1.CDSCast, _1.CDSCase, (0, combi_1.seq)("(", _1.CDSCase, ")"), (0, combi_1.seq)(_1.CDSName, ": REDIRECTED TO", (0, combi_1.opt)((0, combi_1.alt)("PARENT", "COMPOSITION CHILD")), _1.CDSName), _1.CDSPrefixedName, (0, combi_1.regex)(/^\d+$/)), (0, combi_1.opt)(cds_as_1.CDSAs));
10
+ return (0, combi_1.seq)((0, combi_1.starPrio)(_1.CDSAnnotation), (0, combi_1.optPrio)("KEY"), (0, combi_1.altPrio)(_1.CDSAggregate, _1.CDSString, _1.CDSArithmetics, _1.CDSFunction, cds_cast_1.CDSCast, _1.CDSCase, (0, combi_1.seq)("(", _1.CDSCase, ")"), (0, combi_1.seq)(_1.CDSName, ": REDIRECTED TO", (0, combi_1.opt)((0, combi_1.alt)("PARENT", "COMPOSITION CHILD")), _1.CDSName), _1.CDSPrefixedName, _1.CDSInteger), (0, combi_1.opt)(cds_as_1.CDSAs));
11
11
  }
12
12
  }
13
13
  exports.CDSElement = CDSElement;
@@ -34,6 +34,13 @@ class CDSFunction extends combi_1.Expression {
34
34
  const abap_system_timezone = (0, combi_1.seq)("ABAP_SYSTEM_TIMEZONE", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
35
35
  const abap_user_timezone = (0, combi_1.seq)("ABAP_USER_TIMEZONE", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
36
36
  const mod = (0, combi_1.seq)("MOD", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
37
+ const replace = (0, combi_1.seq)("REPLACE", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
38
+ const lpad = (0, combi_1.seq)("LPAD", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
39
+ const rpad = (0, combi_1.seq)("RPAD", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
40
+ const instr = (0, combi_1.seq)("INSTR", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
41
+ const length = (0, combi_1.seq)("LENGTH", "(", _1.CDSFunctionInput, ")");
42
+ const ltrim = (0, combi_1.seq)("LTRIM", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
43
+ const rtrim = (0, combi_1.seq)("RTRIM", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
37
44
  const left = (0, combi_1.seq)("LEFT", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
38
45
  const right = (0, combi_1.seq)("RIGHT", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
39
46
  const conversionInput = (0, combi_1.seq)(_1.CDSName, "=", ">", _1.CDSFunctionInput);
@@ -41,7 +48,7 @@ class CDSFunction extends combi_1.Expression {
41
48
  const unitConversion = (0, combi_1.seq)("UNIT_CONVERSION", "(", conversionInputs, ")");
42
49
  const currencyConversion = (0, combi_1.seq)("CURRENCY_CONVERSION", "(", conversionInputs, ")");
43
50
  const decimalShift = (0, combi_1.seq)("DECIMAL_SHIFT", "(", conversionInputs, ")");
44
- return (0, combi_1.altPrio)(substring, coalesce, tstmp_to_dats, concat, tstmp_to_tims, upper, lower, abs, ceil, floor, round, div, division, concat_with_space, dats_is_valid, dats_days_between, tstmp_add_seconds, tstmp_seconds_between, tstmp_current_utctimestamp, tstmp_is_valid, abap_system_timezone, abap_user_timezone, bintohex, hextobin, dats_add_days, dats_add_months, tstmp_to_dst, dats_tims_to_tstmp, mod, left, right, unitConversion, currencyConversion, decimalShift);
51
+ return (0, combi_1.altPrio)(substring, coalesce, tstmp_to_dats, concat, tstmp_to_tims, upper, lower, abs, ceil, floor, round, div, division, concat_with_space, dats_is_valid, dats_days_between, tstmp_add_seconds, tstmp_seconds_between, tstmp_current_utctimestamp, tstmp_is_valid, abap_system_timezone, abap_user_timezone, bintohex, hextobin, dats_add_days, dats_add_months, tstmp_to_dst, dats_tims_to_tstmp, mod, left, right, lpad, rpad, instr, length, ltrim, rtrim, replace, unitConversion, currencyConversion, decimalShift);
45
52
  }
46
53
  }
47
54
  exports.CDSFunction = CDSFunction;
@@ -6,7 +6,7 @@ const combi_1 = require("../../abap/2_statements/combi");
6
6
  class CDSFunctionInput extends combi_1.Expression {
7
7
  getRunnable() {
8
8
  const qualified = (0, combi_1.seq)(_1.CDSName, (0, combi_1.opt)(_1.CDSParameters), (0, combi_1.starPrio)((0, combi_1.seq)(".", _1.CDSName, (0, combi_1.opt)(_1.CDSParameters))));
9
- const input = (0, combi_1.altPrio)(_1.CDSCast, _1.CDSFunction, _1.CDSArithmetics, _1.CDSCase, _1.CDSString, qualified, (0, combi_1.regex)(/^\d+$/));
9
+ const input = (0, combi_1.altPrio)(_1.CDSCast, _1.CDSFunction, _1.CDSArithmetics, _1.CDSCase, _1.CDSString, qualified, _1.CDSInteger);
10
10
  return input;
11
11
  }
12
12
  }
@@ -4,7 +4,7 @@ exports.CDSInteger = void 0;
4
4
  const combi_1 = require("../../abap/2_statements/combi");
5
5
  class CDSInteger extends combi_1.Expression {
6
6
  getRunnable() {
7
- return (0, combi_1.regex)(/^\d+$/);
7
+ return (0, combi_1.seq)((0, combi_1.opt)("-"), (0, combi_1.regex)(/^\d+$/));
8
8
  }
9
9
  }
10
10
  exports.CDSInteger = CDSInteger;
@@ -6,7 +6,9 @@ const combi_1 = require("../../abap/2_statements/combi");
6
6
  const cds_condition_1 = require("./cds_condition");
7
7
  class CDSJoin extends combi_1.Expression {
8
8
  getRunnable() {
9
- return (0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.altPrio)("LEFT OUTER TO ONE", "LEFT OUTER", "INNER")), "JOIN", _1.CDSSource, "ON", cds_condition_1.CDSCondition);
9
+ const cond = (0, combi_1.seq)(_1.CDSSource, "ON", cds_condition_1.CDSCondition);
10
+ const foo = (0, combi_1.altPrio)((0, combi_1.seq)("(", cond, ")"), cond);
11
+ return (0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.altPrio)("LEFT OUTER TO ONE", "LEFT OUTER", "INNER")), "JOIN", foo);
10
12
  }
11
13
  }
12
14
  exports.CDSJoin = CDSJoin;
@@ -67,7 +67,7 @@ class Registry {
67
67
  }
68
68
  static abaplintVersion() {
69
69
  // magic, see build script "version.sh"
70
- return "2.113.97";
70
+ return "2.113.99";
71
71
  }
72
72
  getDDICReferences() {
73
73
  return this.ddicReferences;
@@ -37,7 +37,9 @@ class CDSParserError {
37
37
  const hasError = object.hasParserError();
38
38
  const file = object.findSourceFile();
39
39
  if (hasError === true && file) {
40
- issues.push(issue_1.Issue.atRow(file, 1, "CDS Parser error", this.getMetadata().key, this.getConfig().severity));
40
+ const empty = file.getRaw().length === 0 ? ", empty file" : "";
41
+ const message = "CDS Parser error" + empty;
42
+ issues.push(issue_1.Issue.atRow(file, 1, message, this.getMetadata().key, this.getConfig().severity));
41
43
  }
42
44
  }
43
45
  return issues;
@@ -16,6 +16,26 @@ class VirtualPosition extends position_1.Position {
16
16
  const casted = p;
17
17
  return super.equals(this) && this.vrow === casted.vrow && this.vcol === casted.vcol;
18
18
  }
19
+ isAfter(p) {
20
+ if (p instanceof VirtualPosition) {
21
+ if (this.getRow() > p.getRow()) {
22
+ return true;
23
+ }
24
+ if (this.getRow() === p.getRow() && this.getCol() > p.getCol()) {
25
+ return true;
26
+ }
27
+ if (this.getRow() === p.getRow() && this.getCol() === p.getCol() && this.vrow > p.vrow) {
28
+ return true;
29
+ }
30
+ if (this.getRow() === p.getRow() && this.getCol() === p.getCol() && this.vrow === p.vrow && this.vcol > p.vcol) {
31
+ return true;
32
+ }
33
+ return false;
34
+ }
35
+ else {
36
+ return super.isAfter(p);
37
+ }
38
+ }
19
39
  }
20
40
  exports.VirtualPosition = VirtualPosition;
21
41
  //# sourceMappingURL=virtual_position.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.113.97",
3
+ "version": "2.113.99",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
@@ -53,9 +53,9 @@
53
53
  "@microsoft/api-extractor": "^7.49.1",
54
54
  "@types/chai": "^4.3.20",
55
55
  "@types/mocha": "^10.0.10",
56
- "@types/node": "^22.10.7",
56
+ "@types/node": "^22.10.10",
57
57
  "chai": "^4.5.0",
58
- "eslint": "^9.18.0",
58
+ "eslint": "^9.19.0",
59
59
  "mocha": "^11.1.0",
60
60
  "c8": "^10.1.3",
61
61
  "source-map-support": "^0.5.21",