@abaplint/core 2.113.183 → 2.113.185

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.
@@ -13,7 +13,7 @@ class Select extends combi_1.Expression {
13
13
  const where = (0, combi_1.seq)("WHERE", _1.SQLCond);
14
14
  const offset = (0, combi_1.ver)(version_1.Version.v751, (0, combi_1.seq)("OFFSET", _1.SQLSource));
15
15
  const bypass = (0, combi_1.str)("BYPASSING BUFFER");
16
- const fields = (0, combi_1.ver)(version_1.Version.v750, _1.SQLFields);
16
+ const fields = (0, combi_1.ver)(version_1.Version.v750, _1.SQLFields, version_1.Version.OpenABAP);
17
17
  // todo, HINTS cannot be anywhere, need an expression dedicated for strict sql
18
18
  const perm = (0, combi_1.per)(_1.SQLFrom, into, _1.SQLForAllEntries, where, _1.SQLOrderBy, sql_up_to_1.SQLUpTo, offset, _1.SQLClient, _1.SQLHaving, bypass, sql_group_by_1.SQLGroupBy, fields, _1.DatabaseConnection, _1.SQLHints);
19
19
  const permSingle = (0, combi_1.per)(_1.SQLFrom, (0, combi_1.altPrio)(sql_into_structure_1.SQLIntoStructure, _1.SQLIntoList), where, _1.SQLClient, bypass, sql_group_by_1.SQLGroupBy, fields, _1.DatabaseConnection, _1.SQLHints);
@@ -29,7 +29,7 @@ class Source extends combi_1.Expression {
29
29
  const conv = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("CONV", _1.TypeNameOrInfer, lparenNoSpace, _1.ConvBody, rparenNoSpace, (0, combi_1.optPrio)(after)), version_1.Version.OpenABAP);
30
30
  const swit = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("SWITCH", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.SwitchBody, rparenNoSpace, (0, combi_1.optPrio)(after)));
31
31
  const value = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("VALUE", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.ValueBody, rparenNoSpace, (0, combi_1.optPrio)(after)), version_1.Version.OpenABAP);
32
- const cond = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("COND", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.CondBody, rparenNoSpace, (0, combi_1.optPrio)(after)));
32
+ const cond = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("COND", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.CondBody, rparenNoSpace, (0, combi_1.optPrio)(after)), version_1.Version.OpenABAP);
33
33
  const reff = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("REF", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), Source, (0, combi_1.optPrio)("OPTIONAL"), rparen), version_1.Version.OpenABAP);
34
34
  const exact = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("EXACT", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), Source, rparen, (0, combi_1.optPrio)(after)));
35
35
  const filter = (0, combi_1.ver)(version_1.Version.v740sp08, (0, combi_1.seq)("FILTER", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.FilterBody, rparen));
@@ -113,7 +113,7 @@ class FieldChain {
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
- table_expression_1.TableExpression.runSyntax(current, input);
116
+ table_expression_1.TableExpression.runSyntax(current, input, context);
117
117
  if (!(context instanceof basic_1.VoidType)) {
118
118
  context = context.getRowType();
119
119
  }
@@ -1,16 +1,39 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TableExpression = void 0;
4
+ const nodes_1 = require("../../nodes");
4
5
  const Expressions = require("../../2_statements/expressions");
5
6
  const source_1 = require("./source");
7
+ const basic_1 = require("../../types/basic");
8
+ const component_chain_1 = require("./component_chain");
6
9
  class TableExpression {
7
- static runSyntax(node, input) {
10
+ static runSyntax(node, input, rowType) {
8
11
  if (node === undefined) {
9
12
  return;
10
13
  }
11
- for (const s of node.findDirectExpressions(Expressions.Source)) {
14
+ let context = rowType;
15
+ if (context instanceof basic_1.TableType) {
16
+ context = context.getRowType();
17
+ }
18
+ if (node.getChildren().length === 3) {
19
+ const s = node.findDirectExpression(Expressions.Source);
20
+ source_1.Source.runSyntax(s, input, context);
21
+ }
22
+ else if (node.findDirectTokenByText("INDEX")) {
23
+ const s = node.findDirectExpression(Expressions.Source);
12
24
  source_1.Source.runSyntax(s, input);
13
25
  }
26
+ else {
27
+ let fieldType = undefined;
28
+ for (const c of node.getChildren()) {
29
+ if (c instanceof nodes_1.ExpressionNode && c.get() instanceof Expressions.ComponentChainSimple) {
30
+ fieldType = component_chain_1.ComponentChain.runSyntax(context, c, input);
31
+ }
32
+ else if (c instanceof nodes_1.ExpressionNode && c.get() instanceof Expressions.Source) {
33
+ source_1.Source.runSyntax(c, input, fieldType);
34
+ }
35
+ }
36
+ }
14
37
  }
15
38
  }
16
39
  exports.TableExpression = TableExpression;
@@ -101,7 +101,7 @@ class Target {
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
- table_expression_1.TableExpression.runSyntax(current, input);
104
+ table_expression_1.TableExpression.runSyntax(current, input, context);
105
105
  if (!(context instanceof basic_1.VoidType)) {
106
106
  context = context.getRowType();
107
107
  }
@@ -67,7 +67,7 @@ class Registry {
67
67
  }
68
68
  static abaplintVersion() {
69
69
  // magic, see build script "version.sh"
70
- return "2.113.183";
70
+ return "2.113.185";
71
71
  }
72
72
  getDDICReferences() {
73
73
  return this.ddicReferences;
@@ -76,7 +76,9 @@ ENDFORM.`,
76
76
  continue;
77
77
  }
78
78
  const prev = statements[i - 1];
79
- if (prev && prev.get() instanceof Statements.Return) {
79
+ if (prev
80
+ && prev.get() instanceof Statements.Return
81
+ && prev.getChildren().length === 2) {
80
82
  if (this.conf.allowEmpty === true && statementCounter === 2) {
81
83
  continue;
82
84
  }
@@ -87,6 +89,7 @@ ENDFORM.`,
87
89
  const prevprev = statements[i - 2];
88
90
  if (prev && prevprev
89
91
  && prevprev.get() instanceof Statements.Return
92
+ && prevprev.getChildren().length === 2
90
93
  && prev.get() instanceof Statements.EndIf) {
91
94
  const fix = edit_helper_1.EditHelper.deleteStatement(file, prevprev);
92
95
  issues.push(issue_1.Issue.atStatement(file, prevprev, message, this.getMetadata().key, this.getConfig().severity, fix));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.113.183",
3
+ "version": "2.113.185",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",