@abaplint/core 2.84.6 → 2.84.10

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.
@@ -46,17 +46,18 @@ class ExpandMacros {
46
46
  let contents = [];
47
47
  for (let i = 0; i < statements.length; i++) {
48
48
  const statement = statements[i];
49
- if (statement.get() instanceof Statements.Define) {
49
+ const type = statement.get();
50
+ if (type instanceof Statements.Define) {
50
51
  // todo, will this break if first token is a pragma?
51
52
  name = statement.getTokens()[1].getStr();
52
53
  contents = [];
53
54
  }
54
55
  else if (name) {
55
- if (statement.get() instanceof Statements.EndOfDefinition) {
56
+ if (type instanceof Statements.EndOfDefinition) {
56
57
  this.macros.addMacro(name, contents);
57
58
  name = undefined;
58
59
  }
59
- else if (!(statement.get() instanceof _statement_1.Comment)) {
60
+ else if (!(type instanceof _statement_1.Comment)) {
60
61
  statements[i] = new statement_node_1.StatementNode(new _statement_1.MacroContent()).setChildren(this.tokensToNodes(statement.getTokens()));
61
62
  contents.push(statements[i]);
62
63
  }
@@ -67,7 +68,8 @@ class ExpandMacros {
67
68
  const result = [];
68
69
  let containsUnknown = false;
69
70
  for (const statement of statements) {
70
- if (statement.get() instanceof _statement_1.Unknown || statement.get() instanceof _statement_1.MacroCall) {
71
+ const type = statement.get();
72
+ if (type instanceof _statement_1.Unknown || type instanceof _statement_1.MacroCall) {
71
73
  const macroName = this.findName(statement.getTokens());
72
74
  if (macroName && this.macros.isMacro(macroName)) {
73
75
  result.push(new statement_node_1.StatementNode(new _statement_1.MacroCall()).setChildren(this.tokensToNodes(statement.getTokens())));
@@ -12,7 +12,7 @@ class TypeTable extends combi_1.Expression {
12
12
  const normal1 = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.alt)("STANDARD", "HASHED", "INDEX", "SORTED", "ANY")), "TABLE", (0, combi_1.opt)("OF"), (0, combi_1.opt)("REF TO"), (0, combi_1.opt)(_1.TypeName));
13
13
  const likeType = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.alt)("STANDARD", "HASHED", "INDEX", "SORTED", "ANY")), "TABLE OF", (0, combi_1.optPrio)("REF TO"), (0, combi_1.opt)(field_chain_1.FieldChain), (0, combi_1.opt)((0, combi_1.per)(header, initial, (0, combi_1.plusPrio)(type_table_key_1.TypeTableKey))));
14
14
  const rangeType = (0, combi_1.seq)("RANGE OF", _1.TypeName, (0, combi_1.opt)(header), (0, combi_1.opt)(initial));
15
- const rangeLike = (0, combi_1.seq)("RANGE OF", _1.FieldSub, (0, combi_1.opt)(header), (0, combi_1.opt)(initial));
15
+ const rangeLike = (0, combi_1.seq)("RANGE OF", _1.SimpleFieldChain, (0, combi_1.opt)(header), (0, combi_1.opt)(initial));
16
16
  const typetable = (0, combi_1.seq)(normal1, (0, combi_1.opt)((0, combi_1.per)(header, initial, (0, combi_1.plusPrio)(type_table_key_1.TypeTableKey))));
17
17
  const occurs = (0, combi_1.seq)("OCCURS", _1.Integer);
18
18
  const oldType = (0, combi_1.seq)((0, combi_1.opt)("REF TO"), _1.TypeName, (0, combi_1.alt)((0, combi_1.seq)(occurs, (0, combi_1.opt)(header)), header));
@@ -282,7 +282,7 @@ class BasicTypes {
282
282
  return new Types.TableType(structure, options);
283
283
  }
284
284
  else if (text.startsWith("LIKE RANGE OF ")) {
285
- const sub = node.findFirstExpression(Expressions.FieldSub);
285
+ const sub = node.findFirstExpression(Expressions.SimpleFieldChain);
286
286
  found = this.resolveLikeName(sub);
287
287
  if (found === undefined) {
288
288
  return new Types.UnknownType("LIKE RANGE OF, could not resolve type");
@@ -7,7 +7,7 @@ const source_1 = require("./source");
7
7
  class StringTemplate {
8
8
  runSyntax(node, scope, filename) {
9
9
  for (const s of node.findAllExpressions(Expressions.Source)) {
10
- new source_1.Source().runSyntax(s, scope, filename);
10
+ new source_1.Source().runSyntax(s, scope, filename, new basic_1.StringType("STRING"));
11
11
  }
12
12
  return new basic_1.StringType();
13
13
  }
@@ -114,7 +114,7 @@ class FindGlobalDefinitions {
114
114
  obj.setDefinition(undefined);
115
115
  }
116
116
  }
117
- else if (obj instanceof class_1.Class) {
117
+ else {
118
118
  const found = struc === null || struc === void 0 ? void 0 : struc.findFirstStructure(Structures.ClassDefinition);
119
119
  if (struc && file && found) {
120
120
  try {
@@ -76,7 +76,10 @@ class ReadTable {
76
76
  */
77
77
  const t = target.findFirstExpression(Expressions.Target);
78
78
  if (t) {
79
- new target_1.Target().runSyntax(t, scope, filename);
79
+ const targetType = new target_1.Target().runSyntax(t, scope, filename);
80
+ if (_type_utils_1.TypeUtils.isAssignable(rowType, targetType) === false) {
81
+ throw new Error("Incompatible types");
82
+ }
80
83
  return;
81
84
  }
82
85
  }
@@ -30,6 +30,7 @@ class Diagnostics {
30
30
  end: { line: issue.getEnd().getRow() - 1, character: issue.getEnd().getCol() - 1 },
31
31
  },
32
32
  code: issue.getKey(),
33
+ codeDescription: { href: "https://rules.abaplint.org/" + issue.getKey() + "/" },
33
34
  message: issue.getMessage().toString(),
34
35
  source: "abaplint",
35
36
  };
@@ -41,7 +41,7 @@ class ABAPObject extends _abstract_object_1.AbstractObject {
41
41
  return undefined;
42
42
  }
43
43
  getMainABAPFile() {
44
- // todo, uris
44
+ // todo, uris, https://github.com/abaplint/abaplint/issues/673
45
45
  const search = this.getName().replace(/\//g, "#").toLowerCase() + "." + this.getType().toLowerCase() + ".abap";
46
46
  for (const file of this.getABAPFiles()) {
47
47
  if (file.getFilename().endsWith(search)) {
@@ -68,7 +68,7 @@ class Registry {
68
68
  }
69
69
  static abaplintVersion() {
70
70
  // magic, see build script "version.sh"
71
- return "2.84.6";
71
+ return "2.84.10";
72
72
  }
73
73
  getDDICReferences() {
74
74
  return this.references;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.84.6",
3
+ "version": "2.84.10",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
@@ -48,8 +48,8 @@
48
48
  "@microsoft/api-extractor": "^7.19.4",
49
49
  "@types/chai": "^4.3.0",
50
50
  "@types/mocha": "^9.1.0",
51
- "@types/node": "^17.0.12",
52
- "chai": "^4.3.5",
51
+ "@types/node": "^17.0.13",
52
+ "chai": "^4.3.6",
53
53
  "eslint": "^8.7.0",
54
54
  "mocha": "^9.2.0",
55
55
  "c8": "^7.11.0",