@abaplint/core 2.120.42 → 2.120.43

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.
@@ -5628,9 +5628,11 @@ declare type ParsedDataDefinition = {
5628
5628
  sqlViewName: string | undefined;
5629
5629
  definitionName: string | undefined;
5630
5630
  description: string | undefined;
5631
+ /** name is the name of the element, nameInSource the name in the prefixed source, if aliased via "as" */
5631
5632
  fields: {
5632
5633
  key: boolean;
5633
5634
  name: string;
5635
+ nameInSource?: string;
5634
5636
  prefix: string;
5635
5637
  annotations: string[];
5636
5638
  }[];
@@ -13,7 +13,7 @@ class Write {
13
13
  const to = (0, combi_1.seq)("TO", expressions_1.Target);
14
14
  const options = (0, combi_1.per)(mask, to, (0, combi_1.seq)("EXPONENT", expressions_1.Source), "NO-GROUPING", "NO-ZERO", "CENTERED", (0, combi_1.seq)("INPUT", (0, combi_1.opt)(onOff)), "NO-GAP", "LEFT-JUSTIFIED", as, (0, combi_1.seq)("FRAMES", onOff), (0, combi_1.seq)("HOTSPOT", (0, combi_1.opt)(onOff)), "RIGHT-JUSTIFIED", (0, combi_1.seq)("TIME ZONE", expressions_1.Source), (0, combi_1.seq)("UNDER", expressions_1.Source), (0, combi_1.seq)("STYLE", expressions_1.Source), (0, combi_1.seq)("ROUND", expressions_1.Source), (0, combi_1.seq)("QUICKINFO", expressions_1.Source), "ENVIRONMENT TIME FORMAT", dateFormat, (0, combi_1.seq)("UNIT", expressions_1.Source), (0, combi_1.seq)("INTENSIFIED", (0, combi_1.opt)(onOff)), (0, combi_1.seq)("INDEX", expressions_1.Source), (0, combi_1.seq)("DECIMALS", expressions_1.Source), (0, combi_1.seq)("INVERSE", (0, combi_1.opt)(onOff)), expressions_1.Color, (0, combi_1.seq)("CURRENCY", expressions_1.Source), "RESET", "NO-SIGN");
15
15
  // Need to refactor all this sometime,
16
- const ret = (0, combi_1.seq)("WRITE", (0, combi_1.alt)((0, combi_1.seq)("AT /", (0, combi_1.opt)(expressions_1.Source), (0, combi_1.opt)("NO-GAP")), (0, combi_1.seq)((0, combi_1.opt)(expressions_1.WriteOffsetLength), (0, combi_1.alt)(expressions_1.Source, expressions_1.Dynamic, "/"), (0, combi_1.opt)(options))));
16
+ const ret = (0, combi_1.seq)("WRITE", (0, combi_1.alt)((0, combi_1.seq)("AT /", (0, combi_1.opt)(expressions_1.Source), (0, combi_1.opt)(options)), (0, combi_1.seq)((0, combi_1.opt)(expressions_1.WriteOffsetLength), (0, combi_1.alt)(expressions_1.Source, expressions_1.Dynamic, "/"), (0, combi_1.opt)(options))));
17
17
  return (0, combi_1.verNotLang)(version_1.LanguageVersion.Cloud, ret);
18
18
  }
19
19
  }
@@ -5,6 +5,7 @@ const basic_1 = require("../abap/types/basic");
5
5
  const ddic_1 = require("../ddic");
6
6
  class CDSDetermineTypes {
7
7
  parseType(reg, parsedData, ddlsName) {
8
+ var _a;
8
9
  const ddic = new ddic_1.DDIC(reg);
9
10
  if ((parsedData === null || parsedData === void 0 ? void 0 : parsedData.fields.length) === 0) {
10
11
  return basic_1.VoidType.get("DDLS:todo");
@@ -41,10 +42,11 @@ class CDSDetermineTypes {
41
42
  });
42
43
  continue;
43
44
  }
45
+ const nameInSource = (_a = f.nameInSource) !== null && _a !== void 0 ? _a : f.name;
44
46
  const lookup = ddic.lookupTableOrView(source.name);
45
47
  if (lookup.type) {
46
48
  if (lookup.type instanceof basic_1.StructureType) {
47
- const type = lookup.type.getComponentByName(f.name);
49
+ const type = lookup.type.getComponentByName(nameInSource);
48
50
  if (type) {
49
51
  components.push({
50
52
  name: f.name,
@@ -54,7 +56,7 @@ class CDSDetermineTypes {
54
56
  else {
55
57
  components.push({
56
58
  name: f.name,
57
- type: new basic_1.UnknownType(f.name + " not found in " + source.name + ", CDSDetermineTypes"),
59
+ type: new basic_1.UnknownType(nameInSource + " not found in " + source.name + ", CDSDetermineTypes"),
58
60
  });
59
61
  }
60
62
  }
@@ -138,19 +138,18 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
138
138
  }
139
139
  for (const e of (expr === null || expr === void 0 ? void 0 : expr.findDirectExpressions(expressions_1.CDSElement)) || []) {
140
140
  let prefix = "";
141
+ let nameInSource = undefined;
141
142
  let found = (_a = e.findDirectExpression(expressions_1.CDSAs)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(expressions_1.CDSName);
142
- if (found === undefined) {
143
- const list = (_b = e.findDirectExpression(expressions_1.CDSPrefixedName)) === null || _b === void 0 ? void 0 : _b.findAllExpressions(expressions_1.CDSName);
144
- if (list) {
145
- if (e.concatTokens().toUpperCase().includes(" REDIRECTED TO ")) {
146
- found = list[0];
147
- }
148
- else {
149
- found = list[list.length - 1];
150
- if (list.length > 1) {
151
- prefix = list[0].concatTokens();
152
- }
153
- }
143
+ const list = (_b = e.findDirectExpression(expressions_1.CDSPrefixedName)) === null || _b === void 0 ? void 0 : _b.findAllExpressions(expressions_1.CDSName);
144
+ if (list !== undefined) {
145
+ const redirected = list.length > 1 && e.concatTokens().toUpperCase().includes(" REDIRECTED TO ");
146
+ if (list.length > 1 && redirected === false) {
147
+ // "prefix.field" is looked up as "field" in "prefix", also when aliased via "as"
148
+ prefix = list[0].concatTokens();
149
+ nameInSource = list[list.length - 1].concatTokens();
150
+ }
151
+ if (found === undefined) {
152
+ found = redirected === true ? list[0] : list[list.length - 1];
154
153
  }
155
154
  }
156
155
  if (found === undefined) {
@@ -172,6 +171,7 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
172
171
  }
173
172
  this.parsedData.fields.push({
174
173
  name: name,
174
+ nameInSource: nameInSource,
175
175
  annotations: annotations,
176
176
  prefix: prefix,
177
177
  key: e.findDirectTokenByText("KEY") !== undefined,
@@ -75,7 +75,7 @@ class Registry {
75
75
  }
76
76
  static abaplintVersion() {
77
77
  // magic, see build script "version.js"
78
- return "2.120.42";
78
+ return "2.120.43";
79
79
  }
80
80
  getDDICReferences() {
81
81
  return this.ddicReferences;
@@ -46,6 +46,8 @@ class XMLConsistencyConf extends _basic_rule_config_1.BasicRuleConfig {
46
46
  super(...arguments);
47
47
  /** Problem severity for text and translation length checks */
48
48
  this.textAndTranslationLengthSeverity = severity_1.Severity.Error;
49
+ /** Problem severity for data element(DTEL) field checks */
50
+ this.dataElementSeverity = severity_1.Severity.Error;
49
51
  }
50
52
  }
51
53
  exports.XMLConsistencyConf = XMLConsistencyConf;
@@ -254,7 +256,7 @@ class XMLConsistency {
254
256
  }
255
257
  checkRequiredField(file, fieldName, value) {
256
258
  if (value === undefined || value === "") {
257
- return issue_1.Issue.atRow(file, 1, `Missing required field ${fieldName} in DD04V`, this.getMetadata().key, this.conf.severity);
259
+ return issue_1.Issue.atRow(file, 1, `Missing required field ${fieldName} in DD04V`, this.getMetadata().key, this.conf.dataElementSeverity);
258
260
  }
259
261
  return undefined;
260
262
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.120.42",
3
+ "version": "2.120.43",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",