@abaplint/core 2.113.33 → 2.113.35

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.
@@ -5108,6 +5108,7 @@ declare type ParsedDataDefinition = {
5108
5108
  fields: {
5109
5109
  key: boolean;
5110
5110
  name: string;
5111
+ prefix: string;
5111
5112
  annotations: string[];
5112
5113
  }[];
5113
5114
  sources: {
@@ -5,7 +5,7 @@ const combi_1 = require("../combi");
5
5
  const tokens_1 = require("../../1_lexer/tokens");
6
6
  class DefinitionName extends combi_1.Expression {
7
7
  getRunnable() {
8
- const r = (0, combi_1.regex)(/^((\w*\/\w+\/)|(\w*\/\w+\/)?[\w\*$%]+)$/);
8
+ const r = (0, combi_1.regex)(/^&|&?((\w*\/\w+\/)|(\w*\/\w+\/)?[\w\*$%]+)$/);
9
9
  return (0, combi_1.seq)(r, (0, combi_1.starPrio)((0, combi_1.seq)((0, combi_1.tok)(tokens_1.Dash), (0, combi_1.optPrio)(r))), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.DashW)));
10
10
  }
11
11
  }
@@ -17,7 +17,7 @@ class SQLCompare extends combi_1.Expression {
17
17
  const arith = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.plusPrio)((0, combi_1.seq)((0, combi_1.altPrio)("+", "-", "*", "/"), _1.SQLFieldName)));
18
18
  const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeftW), _1.Source, (0, combi_1.tok)(tokens_1.WParenRightW));
19
19
  const at = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), (0, combi_1.altPrio)(_1.SimpleSource3, paren)));
20
- const rett = (0, combi_1.seq)((0, combi_1.altPrio)(_1.SQLFunction, (0, combi_1.seq)((0, combi_1.altPrio)(_1.SQLPath, _1.SQLFieldName), (0, combi_1.optPrio)(arith)), at), (0, combi_1.altPrio)((0, combi_1.seq)(_1.SQLCompareOperator, (0, combi_1.altPrio)(sub, source)), (0, combi_1.seq)((0, combi_1.optPrio)("NOT"), (0, combi_1.altPrio)(_1.SQLIn, like, between)), nul));
20
+ const rett = (0, combi_1.seq)((0, combi_1.altPrio)(_1.SQLFunction, _1.ConstantString, (0, combi_1.seq)((0, combi_1.altPrio)(_1.SQLPath, _1.SQLFieldName), (0, combi_1.optPrio)(arith)), at), (0, combi_1.altPrio)((0, combi_1.seq)(_1.SQLCompareOperator, (0, combi_1.altPrio)(sub, source)), (0, combi_1.seq)((0, combi_1.optPrio)("NOT"), (0, combi_1.altPrio)(_1.SQLIn, like, between)), nul));
21
21
  const exists = (0, combi_1.seq)("EXISTS", subSelect);
22
22
  return (0, combi_1.altPrio)(exists, _1.Dynamic, rett);
23
23
  }
@@ -3,9 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SQLHaving = void 0;
4
4
  const combi_1 = require("../combi");
5
5
  const dynamic_1 = require("./dynamic");
6
+ const sql_aggregation_1 = require("./sql_aggregation");
7
+ const sql_compare_operator_1 = require("./sql_compare_operator");
8
+ const sql_source_1 = require("./sql_source");
6
9
  class SQLHaving extends combi_1.Expression {
7
10
  getRunnable() {
8
- const having = (0, combi_1.seq)("HAVING", dynamic_1.Dynamic);
11
+ const cond = (0, combi_1.seq)(sql_aggregation_1.SQLAggregation, sql_compare_operator_1.SQLCompareOperator, sql_source_1.SQLSource);
12
+ const having = (0, combi_1.seq)("HAVING", (0, combi_1.altPrio)(dynamic_1.Dynamic, cond));
9
13
  return having;
10
14
  }
11
15
  }
@@ -15,7 +15,8 @@ class CallFunction {
15
15
  const separate = (0, combi_1.str)("AS SEPARATE UNIT");
16
16
  const keeping = (0, combi_1.str)("KEEPING LOGICAL UNIT OF WORK");
17
17
  const options = (0, combi_1.per)(starting, update, background, expressions_1.Destination, calling, performing, separate, keeping);
18
- const dynamic = (0, combi_1.seq)("PARAMETER-TABLE", expressions_1.Source, (0, combi_1.opt)((0, combi_1.seq)("EXCEPTION-TABLE", expressions_1.Source)));
18
+ const ex = (0, combi_1.seq)("EXCEPTION-TABLE", expressions_1.Source);
19
+ const dynamic = (0, combi_1.alt)((0, combi_1.seq)("PARAMETER-TABLE", expressions_1.Source, (0, combi_1.opt)(ex)), ex);
19
20
  const call = (0, combi_1.seq)("CALL", (0, combi_1.altPrio)("FUNCTION", (0, combi_1.verNot)(version_1.Version.Cloud, "CUSTOMER-FUNCTION")), expressions_1.FunctionName, (0, combi_1.opt)(options), (0, combi_1.alt)(expressions_1.FunctionParameters, dynamic));
20
21
  return call;
21
22
  }
@@ -18,10 +18,12 @@ class NewPage {
18
18
  const keep = (0, combi_1.seq)("KEEP IN SPOOL", expressions_1.Source);
19
19
  const layout = (0, combi_1.seq)("LAYOUT", expressions_1.Source);
20
20
  const listAuth = (0, combi_1.seq)("LIST AUTHORITY", expressions_1.Source);
21
+ const department = (0, combi_1.seq)("DEPARTMENT", expressions_1.Source);
22
+ const receiver = (0, combi_1.seq)("RECEIVER", expressions_1.Source);
21
23
  const dataset = (0, combi_1.seq)("LIST DATASET", expressions_1.Source);
22
24
  const name = (0, combi_1.seq)("LIST NAME", expressions_1.Source);
23
25
  const newList = (0, combi_1.seq)("NEW LIST IDENTIFICATION", expressions_1.Source);
24
- const ret = (0, combi_1.seq)("NEW-PAGE", (0, combi_1.opt)((0, combi_1.per)(print, (0, combi_1.alt)("NO-TITLE", "WITH-TITLE"), (0, combi_1.alt)("NO-HEADING", "WITH-HEADING"), "NO DIALOG", parameters, listAuth, immediately, dataset, coverPage, newList, keep, name, layout, destination, coverText, archive, "NEW-SECTION", lineCount, line)));
26
+ const ret = (0, combi_1.seq)("NEW-PAGE", (0, combi_1.opt)((0, combi_1.per)(print, (0, combi_1.alt)("NO-TITLE", "WITH-TITLE"), (0, combi_1.alt)("NO-HEADING", "WITH-HEADING"), "NO DIALOG", parameters, listAuth, immediately, dataset, coverPage, newList, keep, department, name, layout, destination, receiver, coverText, archive, "NEW-SECTION", lineCount, line)));
25
27
  return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
26
28
  }
27
29
  }
@@ -10,7 +10,7 @@ class ScrollList {
10
10
  const line = (0, combi_1.seq)("LINE", expressions_1.Source);
11
11
  const column = (0, combi_1.seq)("TO COLUMN", expressions_1.Source);
12
12
  const to = (0, combi_1.seq)("TO", (0, combi_1.alt)("FIRST PAGE", "LAST PAGE", (0, combi_1.seq)("PAGE", expressions_1.Source)));
13
- const ret = (0, combi_1.seq)("SCROLL LIST", (0, combi_1.per)(index, (0, combi_1.alt)(to, "BACKWARD", "FORWARD"), column, line));
13
+ const ret = (0, combi_1.seq)("SCROLL LIST", (0, combi_1.per)(index, (0, combi_1.alt)(to, "BACKWARD", "FORWARD"), (0, combi_1.alt)("LEFT", "RIGHT"), column, line));
14
14
  return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
15
15
  }
16
16
  }
@@ -2,20 +2,71 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CDSDetermineTypes = void 0;
4
4
  const basic_1 = require("../abap/types/basic");
5
+ const ddic_1 = require("../ddic");
5
6
  class CDSDetermineTypes {
6
- parseType(_reg, parsedData) {
7
+ parseType(reg, parsedData) {
8
+ const ddic = new ddic_1.DDIC(reg);
7
9
  if ((parsedData === null || parsedData === void 0 ? void 0 : parsedData.fields.length) === 0) {
8
10
  return new basic_1.VoidType("DDLS:todo");
9
11
  }
10
12
  else {
11
13
  const components = [];
12
14
  for (const f of (parsedData === null || parsedData === void 0 ? void 0 : parsedData.fields) || []) {
13
- components.push({
14
- name: f.name,
15
- type: new basic_1.VoidType("DDLS:fieldname"),
16
- });
15
+ if (f.prefix !== "") {
16
+ const source = parsedData.sources.find((s) => { var _a; return ((_a = s.as) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === f.prefix.toUpperCase(); });
17
+ if ((source === null || source === void 0 ? void 0 : source.name) === undefined) {
18
+ components.push({
19
+ name: f.name,
20
+ type: new basic_1.UnknownType("CDS parser error, unknown source"),
21
+ });
22
+ continue;
23
+ }
24
+ const lookup = ddic.lookupTableOrView(source.name);
25
+ if (lookup.type) {
26
+ if (lookup.type instanceof basic_1.StructureType) {
27
+ const type = lookup.type.getComponentByName(f.name);
28
+ if (type) {
29
+ components.push({
30
+ name: f.name,
31
+ type: type,
32
+ });
33
+ }
34
+ else {
35
+ components.push({
36
+ name: f.name,
37
+ type: new basic_1.UnknownType(f.name + " not found in " + source.name + ", CDSDetermineTypes"),
38
+ });
39
+ }
40
+ }
41
+ else {
42
+ // its void or unknown
43
+ components.push({
44
+ name: f.name,
45
+ type: lookup.type,
46
+ });
47
+ }
48
+ }
49
+ else if (reg.inErrorNamespace(source.name)) {
50
+ components.push({
51
+ name: f.name,
52
+ type: new basic_1.UnknownType(source.name + " not found, CDSDetermineTypes"),
53
+ });
54
+ }
55
+ else {
56
+ components.push({
57
+ name: f.name,
58
+ type: new basic_1.VoidType(source.name),
59
+ });
60
+ }
61
+ }
62
+ else {
63
+ components.push({
64
+ name: f.name,
65
+ type: new basic_1.VoidType("DDLS:fieldname"),
66
+ });
67
+ }
17
68
  }
18
- return new basic_1.StructureType(components);
69
+ return new basic_1.StructureType(components, parsedData.definitionName, parsedData.definitionName, parsedData.description);
19
70
  }
20
71
  }
21
72
  }
@@ -126,6 +126,7 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
126
126
  expr = tree.findFirstExpression(expressions_1.CDSDefineProjection);
127
127
  }
128
128
  for (const e of (expr === null || expr === void 0 ? void 0 : expr.findDirectExpressions(expressions_1.CDSElement)) || []) {
129
+ let prefix = "";
129
130
  let found = (_a = e.findDirectExpression(expressions_1.CDSAs)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(expressions_1.CDSName);
130
131
  if (found === undefined) {
131
132
  const list = e.findAllExpressions(expressions_1.CDSName);
@@ -134,6 +135,9 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
134
135
  }
135
136
  else {
136
137
  found = list[list.length - 1];
138
+ if (list.length > 1) {
139
+ prefix = list[0].concatTokens();
140
+ }
137
141
  }
138
142
  }
139
143
  if (found === undefined) {
@@ -150,6 +154,7 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
150
154
  this.parsedData.fields.push({
151
155
  name: name,
152
156
  annotations: annotations,
157
+ prefix: prefix,
153
158
  key: e.findDirectTokenByText("KEY") !== undefined,
154
159
  });
155
160
  }
@@ -67,7 +67,7 @@ class Registry {
67
67
  }
68
68
  static abaplintVersion() {
69
69
  // magic, see build script "version.sh"
70
- return "2.113.33";
70
+ return "2.113.35";
71
71
  }
72
72
  getDDICReferences() {
73
73
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.113.33",
3
+ "version": "2.113.35",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
@@ -53,10 +53,10 @@
53
53
  "@microsoft/api-extractor": "^7.47.11",
54
54
  "@types/chai": "^4.3.20",
55
55
  "@types/mocha": "^10.0.9",
56
- "@types/node": "^22.8.1",
56
+ "@types/node": "^22.8.7",
57
57
  "chai": "^4.5.0",
58
- "eslint": "^9.13.0",
59
- "mocha": "^10.7.3",
58
+ "eslint": "^9.14.0",
59
+ "mocha": "^10.8.2",
60
60
  "c8": "^10.1.2",
61
61
  "source-map-support": "^0.5.21",
62
62
  "ts-json-schema-generator": "^2.3.0",