@abaplint/core 2.120.29 → 2.120.30

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.
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Color = void 0;
4
4
  const combi_1 = require("../combi");
5
- const source_1 = require("./source");
5
+ const simple_source3_1 = require("./simple_source3");
6
6
  class Color extends combi_1.Expression {
7
7
  getRunnable() {
8
- const eq = (0, combi_1.seq)("=", source_1.Source);
8
+ const eq = (0, combi_1.seq)("=", simple_source3_1.SimpleSource3);
9
9
  const integers = (0, combi_1.altPrio)("1", "2", "3", "4", "5", "6", "7");
10
10
  const texts = (0, combi_1.altPrio)("COL_BACKGROUND", "COL_HEADING", "COL_NORMAL", "COL_TOTAL", "COL_KEY", "COL_POSITIVE", "COL_NEGATIVE", "COL_GROUP");
11
11
  const value = (0, combi_1.alt)(eq, (0, combi_1.altPrio)("ON", "OFF", "COLOR OFF", (0, combi_1.altPrio)(integers, texts)));
@@ -50,6 +50,7 @@ const types_1 = require("../types");
50
50
  const expressions_1 = require("../2_statements/expressions");
51
51
  const _builtin_1 = require("./_builtin");
52
52
  const position_1 = require("../../position");
53
+ const _syntax_input_1 = require("./_syntax_input");
53
54
  class BasicTypes {
54
55
  constructor(input) {
55
56
  this.input = input;
@@ -990,6 +991,13 @@ class BasicTypes {
990
991
  }
991
992
  const chain = val.findFirstExpression(Expressions.SimpleFieldChain);
992
993
  if (chain) {
994
+ // todo, hardcoded for now, should be a generic check that the chain is a constant
995
+ const concat = chain.concatTokens().toUpperCase();
996
+ if (concat === "SY-DATUM" || concat === "SY-UZEIT") {
997
+ const message = "VALUE, " + concat.toLowerCase() + " is not a constant";
998
+ this.input.issues.push((0, _syntax_input_1.syntaxIssue)(this.input, chain.getFirstToken(), message));
999
+ return undefined;
1000
+ }
993
1001
  return this.resolveConstantValue(chain);
994
1002
  }
995
1003
  throw new Error("findValue, unexpected");
@@ -7,13 +7,17 @@ const expressions_1 = require("../../2_statements/expressions");
7
7
  const _syntax_input_1 = require("../_syntax_input");
8
8
  class Form {
9
9
  runSyntax(node, input) {
10
- var _a;
11
- const name = (_a = node.findDirectExpression(expressions_1.FormName)) === null || _a === void 0 ? void 0 : _a.concatTokens();
12
- if (name === undefined) {
10
+ const nameExpression = node.findDirectExpression(expressions_1.FormName);
11
+ const name = nameExpression === null || nameExpression === void 0 ? void 0 : nameExpression.concatTokens();
12
+ if (nameExpression === undefined || name === undefined) {
13
13
  const message = "Form, could not find name";
14
14
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
15
15
  return;
16
16
  }
17
+ if (name.length > 30) {
18
+ const message = "FORM name longer than 30 characters";
19
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, nameExpression.getFirstToken(), message));
20
+ }
17
21
  input.scope.push(_scope_type_1.ScopeType.Form, name, node.getFirstToken().getStart(), input.filename);
18
22
  const form = new form_definition_1.FormDefinition(node, input);
19
23
  input.scope.addList(form.getUsingParameters());
@@ -38,7 +38,7 @@ const Expressions = __importStar(require("../../2_statements/expressions"));
38
38
  const source_1 = require("../expressions/source");
39
39
  class Format {
40
40
  runSyntax(node, input) {
41
- for (const s of node.findAllExpressions(Expressions.Source)) {
41
+ for (const s of node.findAllExpressionsMulti([Expressions.Source, Expressions.SimpleSource3])) {
42
42
  source_1.Source.runSyntax(s, input);
43
43
  }
44
44
  }
@@ -62,6 +62,11 @@ class Parameter {
62
62
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
63
63
  return;
64
64
  }
65
+ if (this.hasUserCommand(node) && this.hasLength(node)) {
66
+ const message = "USER-COMMAND and LENGTH not possible together";
67
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
68
+ return;
69
+ }
65
70
  const bfound = new basic_types_1.BasicTypes(input).parseType(node);
66
71
  if (bfound) {
67
72
  input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, bfound));
@@ -73,6 +78,30 @@ class Parameter {
73
78
  const magicToken = new tokens_1.Identifier(nameToken.getStart(), magicName);
74
79
  input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(magicToken, input.filename, basic_1.VoidType.get("PARAMETER-MAGIC")));
75
80
  }
81
+ // "USER-COMMAND" is lexed as three tokens
82
+ hasUserCommand(node) {
83
+ const tokens = node.getTokens();
84
+ for (let i = 0; i < tokens.length - 2; i++) {
85
+ if (tokens[i].getStr().toUpperCase() === "USER"
86
+ && tokens[i + 1].getStr() === "-"
87
+ && tokens[i + 2].getStr().toUpperCase() === "COMMAND") {
88
+ return true;
89
+ }
90
+ }
91
+ return false;
92
+ }
93
+ // "VISIBLE LENGTH" is not the same as "LENGTH"
94
+ hasLength(node) {
95
+ var _a;
96
+ const tokens = node.getTokens();
97
+ for (let i = 0; i < tokens.length; i++) {
98
+ if (tokens[i].getStr().toUpperCase() === "LENGTH"
99
+ && ((_a = tokens[i - 1]) === null || _a === void 0 ? void 0 : _a.getStr().toUpperCase()) !== "VISIBLE") {
100
+ return true;
101
+ }
102
+ }
103
+ return false;
104
+ }
76
105
  }
77
106
  exports.Parameter = Parameter;
78
107
  //# sourceMappingURL=parameter.js.map
@@ -75,7 +75,7 @@ class Registry {
75
75
  }
76
76
  static abaplintVersion() {
77
77
  // magic, see build script "version.js"
78
- return "2.120.29";
78
+ return "2.120.30";
79
79
  }
80
80
  getDDICReferences() {
81
81
  return this.ddicReferences;
@@ -83,6 +83,7 @@ class CloudTypes {
83
83
  || obj instanceof Objects.BehaviorDefinition
84
84
  || obj instanceof Objects.BusinessCatalog
85
85
  || obj instanceof Objects.BusinessCatalogAppAssignment
86
+ || obj instanceof Objects.BusinessConfigurationMaintenanceObject
86
87
  || obj instanceof Objects.CDSMetadataExtension
87
88
  || obj instanceof Objects.Class
88
89
  || obj instanceof Objects.CDSType
@@ -99,11 +100,13 @@ class CloudTypes {
99
100
  || obj instanceof Objects.EventBinding
100
101
  || obj instanceof Objects.EventConsumer
101
102
  || obj instanceof Objects.FunctionGroup
103
+ || obj instanceof Objects.GatewayODataGroupAndAssignment
102
104
  || obj instanceof Objects.HttpService
103
105
  || obj instanceof Objects.IAMApp
104
106
  || obj instanceof Objects.InboundService
105
107
  || obj instanceof Objects.Interface
106
108
  || obj instanceof Objects.LockObject
109
+ || obj instanceof Objects.MaintenanceAndTransportObject
107
110
  || obj instanceof Objects.MessageClass
108
111
  || obj instanceof Objects.NumberRange
109
112
  || obj instanceof Objects.OutboundService
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.120.29",
3
+ "version": "2.120.30",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",