@abaplint/core 2.91.34 → 2.91.37

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.
@@ -615,6 +615,10 @@ declare class CDSDefineAbstract extends Expression {
615
615
  getRunnable(): IStatementRunnable;
616
616
  }
617
617
 
618
+ declare class CDSDefineProjection extends Expression {
619
+ getRunnable(): IStatementRunnable;
620
+ }
621
+
618
622
  declare class CDSDefineView extends Expression {
619
623
  getRunnable(): IStatementRunnable;
620
624
  }
@@ -2014,6 +2018,7 @@ declare namespace ExpressionsCDS {
2014
2018
  CDSComposition,
2015
2019
  CDSCondition,
2016
2020
  CDSDefineAbstract,
2021
+ CDSDefineProjection,
2017
2022
  CDSDefineView,
2018
2023
  CDSElement,
2019
2024
  CDSFunction,
@@ -80,6 +80,11 @@ class CDSLexer {
80
80
  build = result.add(build, row, col);
81
81
  continue;
82
82
  }
83
+ else if (mode === Mode.Default && next === "-" && nextNext === "-") {
84
+ mode = Mode.SingleLineComment;
85
+ build = result.add(build, row, col);
86
+ continue;
87
+ }
83
88
  // multi line comment handling
84
89
  if (mode === Mode.MultiLineComment) {
85
90
  if (next === "\n") {
@@ -118,6 +123,9 @@ class CDSLexer {
118
123
  case ")":
119
124
  case "[":
120
125
  case "]":
126
+ case "=":
127
+ case "<":
128
+ case ">":
121
129
  case "+":
122
130
  case "-":
123
131
  case "*":
@@ -18,6 +18,9 @@ class CDSParser {
18
18
  if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {
19
19
  res = combi_1.Combi.run(new Expressions.CDSDefineAbstract(), tokens, version_1.defaultVersion);
20
20
  }
21
+ if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {
22
+ res = combi_1.Combi.run(new Expressions.CDSDefineProjection(), tokens, version_1.defaultVersion);
23
+ }
21
24
  if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {
22
25
  return undefined;
23
26
  }
@@ -5,7 +5,8 @@ const _1 = require(".");
5
5
  const combi_1 = require("../../abap/2_statements/combi");
6
6
  class CDSAggregate extends combi_1.Expression {
7
7
  getRunnable() {
8
- const value = (0, combi_1.alt)(_1.CDSName, _1.CDSCast, _1.CDSCase);
8
+ const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.opt)((0, combi_1.seq)(".", _1.CDSName)));
9
+ const value = (0, combi_1.alt)(name, _1.CDSCast, _1.CDSCase);
9
10
  return (0, combi_1.seq)((0, combi_1.alt)("MAX", "MIN", "SUM", "AVG", "COUNT"), "(", (0, combi_1.opt)("DISTINCT"), value, ")");
10
11
  }
11
12
  }
@@ -7,7 +7,7 @@ class CDSCase extends combi_1.Expression {
7
7
  getRunnable() {
8
8
  const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.opt)((0, combi_1.seq)(".", _1.CDSName)));
9
9
  const value = (0, combi_1.alt)(name, _1.CDSString, _1.CDSFunction, CDSCase, _1.CDSCast, _1.CDSArithmetics);
10
- const simple = (0, combi_1.seq)("CASE", name, (0, combi_1.plus)((0, combi_1.seq)("WHEN", value, "THEN", value)), "ELSE", value, "END");
10
+ const simple = (0, combi_1.seq)("CASE", (0, combi_1.alt)(name, _1.CDSFunction), (0, combi_1.plus)((0, combi_1.seq)("WHEN", value, "THEN", value)), "ELSE", value, "END");
11
11
  const complex = (0, combi_1.seq)("CASE", (0, combi_1.plus)((0, combi_1.seq)("WHEN", _1.CDSCondition, "THEN", value)), (0, combi_1.opt)((0, combi_1.seq)("ELSE", value)), "END");
12
12
  return (0, combi_1.alt)(simple, complex);
13
13
  }
@@ -6,7 +6,7 @@ const combi_1 = require("../../abap/2_statements/combi");
6
6
  class CDSCondition extends combi_1.Expression {
7
7
  getRunnable() {
8
8
  const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.opt)((0, combi_1.seq)(".", (0, combi_1.alt)(_1.CDSName, _1.CDSString))));
9
- const eq = (0, combi_1.seq)(name, (0, combi_1.alt)("=", "<>", "<", ">", ">=", "<=", "LIKE", "NOT LIKE"), (0, combi_1.alt)(name, _1.CDSFunction, _1.CDSString));
9
+ const eq = (0, combi_1.seq)(name, (0, combi_1.alt)("=", (0, combi_1.seq)("!", "="), (0, combi_1.seq)("<", ">"), "<", ">", (0, combi_1.seq)(">", "="), (0, combi_1.seq)("<", "="), "LIKE", "NOT LIKE"), (0, combi_1.alt)(name, _1.CDSFunction, _1.CDSString));
10
10
  const isInitial = (0, combi_1.seq)(name, "IS INITIAL");
11
11
  const isNotInitial = (0, combi_1.seq)(name, "IS NOT INITIAL");
12
12
  const isNull = (0, combi_1.seq)(name, "IS NULL");
@@ -6,7 +6,7 @@ const combi_1 = require("../../abap/2_statements/combi");
6
6
  const cds_name_1 = require("./cds_name");
7
7
  class CDSDefineAbstract extends combi_1.Expression {
8
8
  getRunnable() {
9
- const field = (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.str)("KEY"), cds_name_1.CDSName, ":", cds_name_1.CDSName, ";");
9
+ const field = (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.opt)((0, combi_1.str)("KEY")), cds_name_1.CDSName, ":", _1.CDSType, ";");
10
10
  return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.str)("DEFINE ABSTRACT ENTITY"), cds_name_1.CDSName, (0, combi_1.str)("{"), (0, combi_1.plus)(field), (0, combi_1.str)("}"), (0, combi_1.opt)(";"));
11
11
  }
12
12
  }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CDSDefineProjection = void 0;
4
+ const _1 = require(".");
5
+ const __1 = require("../..");
6
+ const combi_1 = require("../../abap/2_statements/combi");
7
+ class CDSDefineProjection extends combi_1.Expression {
8
+ getRunnable() {
9
+ return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), "DEFINE", (0, combi_1.opt)("ROOT"), "VIEW", (0, combi_1.ver)(__1.Version.v755, (0, combi_1.opt)("ENTITY")), _1.CDSName, "PROVIDER CONTRACT", _1.CDSName, "AS PROJECTION ON", _1.CDSName, (0, combi_1.str)("{"), (0, combi_1.plus)(_1.CDSElement), (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.str)("}"), (0, combi_1.opt)(";"));
10
+ }
11
+ }
12
+ exports.CDSDefineProjection = CDSDefineProjection;
13
+ //# sourceMappingURL=cds_define_projection.js.map
@@ -29,6 +29,7 @@ __exportStar(require("./cds_cast"), exports);
29
29
  __exportStar(require("./cds_composition"), exports);
30
30
  __exportStar(require("./cds_condition"), exports);
31
31
  __exportStar(require("./cds_define_abstract"), exports);
32
+ __exportStar(require("./cds_define_projection"), exports);
32
33
  __exportStar(require("./cds_define_view"), exports);
33
34
  __exportStar(require("./cds_element"), exports);
34
35
  __exportStar(require("./cds_function"), exports);
@@ -68,7 +68,7 @@ class Registry {
68
68
  }
69
69
  static abaplintVersion() {
70
70
  // magic, see build script "version.sh"
71
- return "2.91.34";
71
+ return "2.91.37";
72
72
  }
73
73
  getDDICReferences() {
74
74
  return this.references;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.91.34",
3
+ "version": "2.91.37",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
@@ -48,7 +48,7 @@
48
48
  "@microsoft/api-extractor": "^7.29.3",
49
49
  "@types/chai": "^4.3.3",
50
50
  "@types/mocha": "^9.1.1",
51
- "@types/node": "^18.7.9",
51
+ "@types/node": "^18.7.11",
52
52
  "chai": "^4.3.6",
53
53
  "eslint": "^8.22.0",
54
54
  "mocha": "^10.0.0",