@abaplint/core 2.113.214 → 2.113.216

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.
@@ -108,13 +108,13 @@ class FieldChain {
108
108
  }
109
109
  else if (current instanceof nodes_1.ExpressionNode
110
110
  && current.get() instanceof Expressions.TableExpression) {
111
- if (!(context instanceof basic_1.TableType) && !(context instanceof basic_1.VoidType)) {
111
+ if (!(context instanceof basic_1.TableType) && !(context instanceof basic_1.VoidType) && !(context instanceof basic_1.UnknownType)) {
112
112
  const message = "Table expression, expected table";
113
113
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, current.getFirstToken(), message));
114
114
  return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
115
115
  }
116
116
  table_expression_1.TableExpression.runSyntax(current, input, context);
117
- if (!(context instanceof basic_1.VoidType)) {
117
+ if (!(context instanceof basic_1.VoidType) && !(context instanceof basic_1.UnknownType)) {
118
118
  context = context.getRowType();
119
119
  }
120
120
  }
@@ -17,9 +17,13 @@ const _syntax_input_1 = require("../_syntax_input");
17
17
  const isSimple = /^\w+$/;
18
18
  class Select {
19
19
  static runSyntax(node, input, skipImplicitInto = false) {
20
- var _a;
20
+ var _a, _b;
21
21
  const token = node.getFirstToken();
22
- const from = node.findDirectExpression(Expressions.SQLFrom);
22
+ let from = node.findDirectExpression(Expressions.SQLFrom);
23
+ if (from === undefined) {
24
+ // huh, sometimes the select expression is wrapped
25
+ from = node.findFirstExpression(Expressions.SQLFrom);
26
+ }
23
27
  const dbSources = from ? sql_from_1.SQLFrom.runSyntax(from, input) : [];
24
28
  if (from === undefined) {
25
29
  const message = `Missing FROM`;
@@ -34,7 +38,7 @@ class Select {
34
38
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
35
39
  return;
36
40
  }
37
- const isSingle = node.getChildren()[1].concatTokens().toUpperCase() === "SINGLE"
41
+ const isSingle = ((_a = node.getChildren()[1]) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase()) === "SINGLE"
38
42
  || node.get() instanceof Expressions.SelectLoop;
39
43
  this.checkFields(fields, dbSources, input, node);
40
44
  this.handleInto(node, input, fields, dbSources, isSingle);
@@ -51,7 +55,7 @@ class Select {
51
55
  && node.findDirectExpression(Expressions.SQLIntoTable) === undefined
52
56
  && node.findDirectExpression(Expressions.SQLIntoList) === undefined
53
57
  && node.findDirectExpression(Expressions.SQLIntoStructure) === undefined) {
54
- const fields = (_a = node.findFirstExpression(Expressions.SQLAggregation)) === null || _a === void 0 ? void 0 : _a.concatTokens();
58
+ const fields = (_b = node.findFirstExpression(Expressions.SQLAggregation)) === null || _b === void 0 ? void 0 : _b.concatTokens();
55
59
  const c = new RegExp(/^count\(\s*\*\s*\)$/, "i");
56
60
  if (fields === undefined || c.test(fields) === false) {
57
61
  const nameToken = from === null || from === void 0 ? void 0 : from.findDirectExpression(Expressions.SQLFromSource);
@@ -96,13 +96,13 @@ class Target {
96
96
  }
97
97
  else if (current instanceof nodes_1.ExpressionNode
98
98
  && current.get() instanceof Expressions.TableExpression) {
99
- if (!(context instanceof basic_1.TableType) && !(context instanceof basic_1.VoidType)) {
99
+ if (!(context instanceof basic_1.TableType) && !(context instanceof basic_1.VoidType) && !(context instanceof unknown_type_1.UnknownType)) {
100
100
  const message = "Table expression, expected table";
101
101
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
102
102
  return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
103
103
  }
104
104
  table_expression_1.TableExpression.runSyntax(current, input, context);
105
- if (!(context instanceof basic_1.VoidType)) {
105
+ if (!(context instanceof basic_1.VoidType) && !(context instanceof unknown_type_1.UnknownType)) {
106
106
  context = context.getRowType();
107
107
  }
108
108
  }
@@ -19,7 +19,7 @@ class Append {
19
19
  }
20
20
  const fsTarget = node.findExpressionAfterToken("ASSIGNING");
21
21
  if (fsTarget && fsTarget.get() instanceof Expressions.FSTarget) {
22
- if (!(targetType instanceof basic_1.TableType) && !(targetType instanceof basic_1.VoidType)) {
22
+ if (!(targetType instanceof basic_1.TableType) && !(targetType instanceof basic_1.VoidType) && !(targetType instanceof basic_1.UnknownType)) {
23
23
  const message = "APPEND to non table type, " + (targetType === null || targetType === void 0 ? void 0 : targetType.constructor.name);
24
24
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
25
25
  return;
@@ -29,7 +29,7 @@ class Append {
29
29
  }
30
30
  const dataTarget = node.findExpressionAfterToken("INTO");
31
31
  if (dataTarget && node.concatTokens().toUpperCase().includes(" REFERENCE INTO DATA(")) {
32
- if (!(targetType instanceof basic_1.TableType) && !(targetType instanceof basic_1.VoidType)) {
32
+ if (!(targetType instanceof basic_1.TableType) && !(targetType instanceof basic_1.VoidType) && !(targetType instanceof basic_1.UnknownType)) {
33
33
  const message = "APPEND to non table type, " + (targetType === null || targetType === void 0 ? void 0 : targetType.constructor.name);
34
34
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
35
35
  return;
@@ -7,7 +7,7 @@ class CDSAggregate extends combi_1.Expression {
7
7
  getRunnable() {
8
8
  const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.star)((0, combi_1.seq)(".", _1.CDSName)));
9
9
  const value = (0, combi_1.alt)(name, "*", _1.CDSCast, _1.CDSCase, _1.CDSFunction);
10
- return (0, combi_1.seq)((0, combi_1.alt)("MAX", "MIN", "SUM", "AVG", "COUNT"), "(", (0, combi_1.opt)("DISTINCT"), value, ")");
10
+ return (0, combi_1.seq)((0, combi_1.altPrio)("MAX", "MIN", "SUM", "AVG", "COUNT"), "(", (0, combi_1.opt)("DISTINCT"), value, ")");
11
11
  }
12
12
  }
13
13
  exports.CDSAggregate = CDSAggregate;
@@ -7,7 +7,7 @@ const cds_annotation_simple_1 = require("./cds_annotation_simple");
7
7
  class CDSAnnotationArray extends combi_1.Expression {
8
8
  getRunnable() {
9
9
  const value = (0, combi_1.alt)(cds_annotation_simple_1.CDSAnnotationSimple, _1.CDSAnnotationObject, CDSAnnotationArray);
10
- const valueList = (0, combi_1.seq)("[", value, (0, combi_1.star)((0, combi_1.seq)(",", value)), "]");
10
+ const valueList = (0, combi_1.seq)("[", value, (0, combi_1.starPrio)((0, combi_1.seq)(",", value)), "]");
11
11
  return valueList;
12
12
  }
13
13
  }
@@ -7,9 +7,9 @@ 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
- const redirected = (0, combi_1.seq)(": REDIRECTED TO", (0, combi_1.opt)((0, combi_1.alt)("PARENT", "COMPOSITION CHILD")), _1.CDSName);
11
- const colonThing = (0, combi_1.seq)(":", (0, combi_1.alt)(_1.CDSName, _1.CDSType));
12
- return (0, combi_1.seq)((0, combi_1.starPrio)(_1.CDSAnnotation), (0, combi_1.optPrio)((0, combi_1.altPrio)("KEY", "VIRTUAL")), (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.CDSPrefixedName, (0, combi_1.opt)((0, combi_1.alt)(redirected, colonThing))), _1.CDSInteger), (0, combi_1.opt)(cds_as_1.CDSAs));
10
+ const redirected = (0, combi_1.seq)(": REDIRECTED TO", (0, combi_1.optPrio)((0, combi_1.altPrio)("PARENT", "COMPOSITION CHILD")), _1.CDSName);
11
+ const colonThing = (0, combi_1.seq)(":", (0, combi_1.alt)(_1.CDSName, _1.CDSType, "LOCALIZED"));
12
+ return (0, combi_1.seq)((0, combi_1.starPrio)(_1.CDSAnnotation), (0, combi_1.optPrio)((0, combi_1.altPrio)("KEY", "VIRTUAL")), (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.CDSPrefixedName, (0, combi_1.optPrio)(cds_as_1.CDSAs), (0, combi_1.optPrio)((0, combi_1.altPrio)(redirected, colonThing))), _1.CDSInteger), (0, combi_1.optPrio)(cds_as_1.CDSAs));
13
13
  }
14
14
  }
15
15
  exports.CDSElement = CDSElement;
@@ -67,7 +67,7 @@ class Registry {
67
67
  }
68
68
  static abaplintVersion() {
69
69
  // magic, see build script "version.sh"
70
- return "2.113.214";
70
+ return "2.113.216";
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.214",
3
+ "version": "2.113.216",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",