@abaplint/core 2.113.91 → 2.113.92

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.
@@ -6,14 +6,14 @@ const combi_1 = require("../../abap/2_statements/combi");
6
6
  const cds_integer_1 = require("./cds_integer");
7
7
  class CDSArithmetics extends combi_1.Expression {
8
8
  getRunnable() {
9
- const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.opt)((0, combi_1.seq)(".", _1.CDSName)));
10
- const val = (0, combi_1.alt)(cds_integer_1.CDSInteger, name, _1.CDSFunction, _1.CDSCase, _1.CDSCast, _1.CDSString);
9
+ const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.optPrio)((0, combi_1.seq)(".", _1.CDSName)));
10
+ const val = (0, combi_1.altPrio)(cds_integer_1.CDSInteger, _1.CDSFunction, _1.CDSCase, _1.CDSCast, _1.CDSString, name);
11
11
  const operator = (0, combi_1.altPrio)("+", "-", "*", "/");
12
12
  const operatorValue = (0, combi_1.seq)(operator, val);
13
- const paren = (0, combi_1.seq)("(", val, (0, combi_1.plus)(operatorValue), ")");
14
- const noParen = (0, combi_1.seq)(val, (0, combi_1.plus)(operatorValue));
13
+ const paren = (0, combi_1.seq)("(", val, (0, combi_1.plusPrio)(operatorValue), ")");
14
+ const noParen = (0, combi_1.seq)(val, (0, combi_1.plusPrio)(operatorValue));
15
15
  // todo: this is pretty bad, it needs a rewrite
16
- return (0, combi_1.altPrio)((0, combi_1.seq)(paren, (0, combi_1.plus)(operatorValue)), paren, noParen);
16
+ return (0, combi_1.altPrio)((0, combi_1.seq)(paren, (0, combi_1.plusPrio)(operatorValue)), paren, noParen);
17
17
  }
18
18
  }
19
19
  exports.CDSArithmetics = CDSArithmetics;
@@ -6,10 +6,10 @@ const combi_1 = require("../../abap/2_statements/combi");
6
6
  class CDSCase extends combi_1.Expression {
7
7
  getRunnable() {
8
8
  const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.optPrio)((0, combi_1.seq)(".", _1.CDSName)));
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", (0, combi_1.alt)(name, _1.CDSFunction), (0, combi_1.plusPrio)((0, combi_1.seq)("WHEN", value, "THEN", value)), "ELSE", value, "END");
11
- const complex = (0, combi_1.seq)("CASE", (0, combi_1.plusPrio)((0, combi_1.seq)("WHEN", _1.CDSCondition, "THEN", value)), (0, combi_1.opt)((0, combi_1.seq)("ELSE", value)), "END");
12
- return (0, combi_1.altPrio)(simple, complex);
9
+ const value = (0, combi_1.altPrio)(_1.CDSFunction, _1.CDSString, CDSCase, _1.CDSCast, _1.CDSArithmetics, name);
10
+ const simple = (0, combi_1.seq)((0, combi_1.altPrio)(_1.CDSFunction, name), (0, combi_1.plusPrio)((0, combi_1.seq)("WHEN", value, "THEN", value)), "ELSE", value);
11
+ const complex = (0, combi_1.seq)((0, combi_1.plusPrio)((0, combi_1.seq)("WHEN", _1.CDSCondition, "THEN", value)), (0, combi_1.optPrio)((0, combi_1.seq)("ELSE", value)));
12
+ return (0, combi_1.seq)("CASE", (0, combi_1.altPrio)(complex, simple), "END");
13
13
  }
14
14
  }
15
15
  exports.CDSCase = CDSCase;
@@ -5,8 +5,8 @@ const _1 = require(".");
5
5
  const combi_1 = require("../../abap/2_statements/combi");
6
6
  class CDSCast extends combi_1.Expression {
7
7
  getRunnable() {
8
- const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.opt)((0, combi_1.seq)(".", _1.CDSName)));
9
- return (0, combi_1.seq)("CAST", "(", (0, combi_1.alt)(name, _1.CDSFunction, _1.CDSCase, _1.CDSAggregate, CDSCast, _1.CDSString, _1.CDSArithmetics), "AS", _1.CDSType, (0, combi_1.opt)((0, combi_1.seq)("PRESERVING", "TYPE")), ")");
8
+ const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.optPrio)((0, combi_1.seq)(".", _1.CDSName)));
9
+ return (0, combi_1.seq)("CAST", "(", (0, combi_1.altPrio)(_1.CDSFunction, _1.CDSCase, _1.CDSAggregate, CDSCast, _1.CDSString, _1.CDSArithmetics, name), "AS", _1.CDSType, (0, combi_1.optPrio)((0, combi_1.seq)("PRESERVING", "TYPE")), ")");
10
10
  }
11
11
  }
12
12
  exports.CDSCast = CDSCast;
@@ -20,11 +20,25 @@ class Help {
20
20
  }
21
21
  const obj = reg.findObjectForFile(file);
22
22
  if (obj instanceof objects_1.DataDefinition) {
23
- return "Data definition, dump todo";
23
+ return this.dumpDDLS(obj, reg);
24
24
  }
25
25
  return "Unhandled object type: " + obj.getType();
26
26
  }
27
27
  /////////////////////////////////////////////////
28
+ static dumpDDLS(obj, reg) {
29
+ let content = "";
30
+ content += "<h1>" + obj.getType + " " + obj.getName() + "</h1>\n";
31
+ content += obj.getDescription() + "\n";
32
+ content += obj.getParsingIssues().map(i => i.getMessage()).join("<br>\n");
33
+ content += `<hr>\n`;
34
+ const parsed = obj.getParsedData();
35
+ parsed === null || parsed === void 0 ? true : delete parsed.tree;
36
+ content += `<pre>` + JSON.stringify(parsed, null, 2) + "</pre>\n";
37
+ content += `<hr>\n`;
38
+ content += `<pre>` + obj.parseType(reg).toText(0) + "</pre>\n";
39
+ content += `<hr>\n`;
40
+ return content;
41
+ }
28
42
  static dumpABAP(file, reg, textDocument, position) {
29
43
  let content = "";
30
44
  content = `
@@ -67,7 +67,7 @@ class Registry {
67
67
  }
68
68
  static abaplintVersion() {
69
69
  // magic, see build script "version.sh"
70
- return "2.113.91";
70
+ return "2.113.92";
71
71
  }
72
72
  getDDICReferences() {
73
73
  return this.ddicReferences;
@@ -37,7 +37,7 @@ DATA lt_bar TYPE STANDARD TABLE OF ty.`,
37
37
  runParsed(file) {
38
38
  const issues = [];
39
39
  for (const statement of file.getStatements()) {
40
- if (!(statement.get() instanceof Statements.Data)) {
40
+ if (!(statement.get() instanceof Statements.Data || statement.get() instanceof Statements.Type)) {
41
41
  continue;
42
42
  }
43
43
  const tt = statement.findFirstExpression(Expressions.TypeTable);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.113.91",
3
+ "version": "2.113.92",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",