@abaplint/core 2.89.11 → 2.89.14

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.
@@ -8,11 +8,17 @@ const inline_field_definition_1 = require("./inline_field_definition");
8
8
  const unknown_type_1 = require("../../types/basic/unknown_type");
9
9
  const _scope_type_1 = require("../_scope_type");
10
10
  const reduce_next_1 = require("./reduce_next");
11
+ const let_1 = require("./let");
11
12
  class ReduceBody {
12
13
  runSyntax(node, scope, filename) {
13
14
  if (node === undefined) {
14
15
  return;
15
16
  }
17
+ let scoped = false;
18
+ const letNode = node.findDirectExpression(Expressions.Let);
19
+ if (letNode) {
20
+ scoped = new let_1.Let().runSyntax(letNode, scope, filename);
21
+ }
16
22
  for (const i of node.findDirectExpressions(Expressions.InlineFieldDefinition)) {
17
23
  new inline_field_definition_1.InlineFieldDefinition().runSyntax(i, scope, filename);
18
24
  }
@@ -25,6 +31,9 @@ class ReduceBody {
25
31
  for (const s of node.findDirectExpressions(Expressions.ReduceNext)) {
26
32
  new reduce_next_1.ReduceNext().runSyntax(s, scope, filename);
27
33
  }
34
+ if (scoped === true) {
35
+ scope.pop(node.getLastToken().getEnd());
36
+ }
28
37
  while (scope.getType() === _scope_type_1.ScopeType.For) {
29
38
  scope.pop(node.getLastToken().getEnd());
30
39
  }
@@ -8,6 +8,7 @@ const basic_1 = require("../../types/basic");
8
8
  const _typed_identifier_1 = require("../../types/_typed_identifier");
9
9
  const _reference_1 = require("../_reference");
10
10
  const enum_type_1 = require("../../types/basic/enum_type");
11
+ const _scope_type_1 = require("../_scope_type");
11
12
  class TypeEnum {
12
13
  runSyntax(node, scope, filename) {
13
14
  var _a;
@@ -48,7 +49,12 @@ class TypeEnum {
48
49
  }
49
50
  const name = begin.findFirstExpression(Expressions.NamespaceSimpleName);
50
51
  if (name) {
51
- const id = new _typed_identifier_1.TypedIdentifier(name.getFirstToken(), filename, new enum_type_1.EnumType(), ["enum" /* Enum */]);
52
+ let qualifiedName = name.concatTokens();
53
+ if (scope.getType() === _scope_type_1.ScopeType.ClassDefinition
54
+ || scope.getType() === _scope_type_1.ScopeType.Interface) {
55
+ qualifiedName = scope.getName() + "=>" + qualifiedName;
56
+ }
57
+ const id = new _typed_identifier_1.TypedIdentifier(name.getFirstToken(), filename, new enum_type_1.EnumType(qualifiedName), ["enum" /* Enum */]);
52
58
  scope.addType(id);
53
59
  types.push(id);
54
60
  }
@@ -10,7 +10,7 @@ class EnumType extends _abstract_type_1.AbstractType {
10
10
  return false;
11
11
  }
12
12
  toABAP() {
13
- return "enum";
13
+ return this.getQualifiedName() || "enum";
14
14
  }
15
15
  containsVoid() {
16
16
  return false;
@@ -60,7 +60,8 @@ class Indent {
60
60
  || type instanceof Statements.EndCatch
61
61
  || (this.options.selectionScreenBlockIndentation === true
62
62
  && type instanceof Statements.SelectionScreen
63
- && statement.concatTokens().toUpperCase().includes("END OF BLOCK"))
63
+ && (statement.concatTokens().toUpperCase().includes("END OF BLOCK") ||
64
+ statement.concatTokens().toUpperCase().includes("END OF LINE")))
64
65
  || type instanceof Statements.ElseIf
65
66
  || type instanceof Statements.EndFunction
66
67
  || type instanceof Statements.EndInterface
@@ -149,7 +150,8 @@ class Indent {
149
150
  || type instanceof Statements.TestSeam
150
151
  || (this.options.selectionScreenBlockIndentation === true
151
152
  && type instanceof Statements.SelectionScreen
152
- && statement.concatTokens().toUpperCase().includes("BEGIN OF BLOCK"))
153
+ && (statement.concatTokens().toUpperCase().includes("BEGIN OF BLOCK") ||
154
+ statement.concatTokens().toUpperCase().includes("BEGIN OF LINE")))
153
155
  || type instanceof Statements.StartOfSelection
154
156
  || type instanceof Statements.AtSelectionScreen
155
157
  || type instanceof Statements.AtLineSelection
@@ -68,7 +68,7 @@ class Registry {
68
68
  }
69
69
  static abaplintVersion() {
70
70
  // magic, see build script "version.sh"
71
- return "2.89.11";
71
+ return "2.89.14";
72
72
  }
73
73
  getDDICReferences() {
74
74
  return this.references;
@@ -1139,6 +1139,10 @@ ${indentation} output = ${topTarget}.`;
1139
1139
  if (reduceBody === undefined) {
1140
1140
  continue;
1141
1141
  }
1142
+ const letNode = reduceBody.findDirectExpression(Expressions.Let);
1143
+ if (letNode) {
1144
+ body += this.outlineLet(letNode, indentation, highSyntax, lowFile);
1145
+ }
1142
1146
  for (const init of reduceBody.findDirectExpressions(Expressions.InlineFieldDefinition)) {
1143
1147
  name = init.getFirstToken().getStr();
1144
1148
  const s = (_a = init.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.89.11",
3
+ "version": "2.89.14",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
@@ -48,14 +48,14 @@
48
48
  "@microsoft/api-extractor": "^7.23.0",
49
49
  "@types/chai": "^4.3.1",
50
50
  "@types/mocha": "^9.1.1",
51
- "@types/node": "^17.0.27",
51
+ "@types/node": "^17.0.30",
52
52
  "chai": "^4.3.6",
53
53
  "eslint": "^8.14.0",
54
- "mocha": "^9.2.2",
54
+ "mocha": "^10.0.0",
55
55
  "c8": "^7.11.2",
56
56
  "source-map-support": "^0.5.21",
57
57
  "ts-json-schema-generator": "^1.0.0",
58
- "typescript": "^4.6.3"
58
+ "typescript": "^4.6.4"
59
59
  },
60
60
  "dependencies": {
61
61
  "fast-xml-parser": "^4.0.7",