@abaplint/cli 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.
Files changed (2) hide show
  1. package/build/cli.js +51 -7
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -3781,10 +3781,10 @@ exports.ClassName = ClassName;
3781
3781
  Object.defineProperty(exports, "__esModule", ({ value: true }));
3782
3782
  exports.Color = void 0;
3783
3783
  const combi_1 = __webpack_require__(/*! ../combi */ "../core/build/src/abap/2_statements/combi.js");
3784
- const source_1 = __webpack_require__(/*! ./source */ "../core/build/src/abap/2_statements/expressions/source.js");
3784
+ const simple_source3_1 = __webpack_require__(/*! ./simple_source3 */ "../core/build/src/abap/2_statements/expressions/simple_source3.js");
3785
3785
  class Color extends combi_1.Expression {
3786
3786
  getRunnable() {
3787
- const eq = (0, combi_1.seq)("=", source_1.Source);
3787
+ const eq = (0, combi_1.seq)("=", simple_source3_1.SimpleSource3);
3788
3788
  const integers = (0, combi_1.altPrio)("1", "2", "3", "4", "5", "6", "7");
3789
3789
  const texts = (0, combi_1.altPrio)("COL_BACKGROUND", "COL_HEADING", "COL_NORMAL", "COL_TOTAL", "COL_KEY", "COL_POSITIVE", "COL_NEGATIVE", "COL_GROUP");
3790
3790
  const value = (0, combi_1.alt)(eq, (0, combi_1.altPrio)("ON", "OFF", "COLOR OFF", (0, combi_1.altPrio)(integers, texts)));
@@ -28153,6 +28153,7 @@ const types_1 = __webpack_require__(/*! ../types */ "../core/build/src/abap/type
28153
28153
  const expressions_1 = __webpack_require__(/*! ../2_statements/expressions */ "../core/build/src/abap/2_statements/expressions/index.js");
28154
28154
  const _builtin_1 = __webpack_require__(/*! ./_builtin */ "../core/build/src/abap/5_syntax/_builtin.js");
28155
28155
  const position_1 = __webpack_require__(/*! ../../position */ "../core/build/src/position.js");
28156
+ const _syntax_input_1 = __webpack_require__(/*! ./_syntax_input */ "../core/build/src/abap/5_syntax/_syntax_input.js");
28156
28157
  class BasicTypes {
28157
28158
  constructor(input) {
28158
28159
  this.input = input;
@@ -29093,6 +29094,13 @@ class BasicTypes {
29093
29094
  }
29094
29095
  const chain = val.findFirstExpression(Expressions.SimpleFieldChain);
29095
29096
  if (chain) {
29097
+ // todo, hardcoded for now, should be a generic check that the chain is a constant
29098
+ const concat = chain.concatTokens().toUpperCase();
29099
+ if (concat === "SY-DATUM" || concat === "SY-UZEIT") {
29100
+ const message = "VALUE, " + concat.toLowerCase() + " is not a constant";
29101
+ this.input.issues.push((0, _syntax_input_1.syntaxIssue)(this.input, chain.getFirstToken(), message));
29102
+ return undefined;
29103
+ }
29096
29104
  return this.resolveConstantValue(chain);
29097
29105
  }
29098
29106
  throw new Error("findValue, unexpected");
@@ -40606,13 +40614,17 @@ const expressions_1 = __webpack_require__(/*! ../../2_statements/expressions */
40606
40614
  const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "../core/build/src/abap/5_syntax/_syntax_input.js");
40607
40615
  class Form {
40608
40616
  runSyntax(node, input) {
40609
- var _a;
40610
- const name = (_a = node.findDirectExpression(expressions_1.FormName)) === null || _a === void 0 ? void 0 : _a.concatTokens();
40611
- if (name === undefined) {
40617
+ const nameExpression = node.findDirectExpression(expressions_1.FormName);
40618
+ const name = nameExpression === null || nameExpression === void 0 ? void 0 : nameExpression.concatTokens();
40619
+ if (nameExpression === undefined || name === undefined) {
40612
40620
  const message = "Form, could not find name";
40613
40621
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
40614
40622
  return;
40615
40623
  }
40624
+ if (name.length > 30) {
40625
+ const message = "FORM name longer than 30 characters";
40626
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, nameExpression.getFirstToken(), message));
40627
+ }
40616
40628
  input.scope.push(_scope_type_1.ScopeType.Form, name, node.getFirstToken().getStart(), input.filename);
40617
40629
  const form = new form_definition_1.FormDefinition(node, input);
40618
40630
  input.scope.addList(form.getUsingParameters());
@@ -40672,7 +40684,7 @@ const Expressions = __importStar(__webpack_require__(/*! ../../2_statements/expr
40672
40684
  const source_1 = __webpack_require__(/*! ../expressions/source */ "../core/build/src/abap/5_syntax/expressions/source.js");
40673
40685
  class Format {
40674
40686
  runSyntax(node, input) {
40675
- for (const s of node.findAllExpressions(Expressions.Source)) {
40687
+ for (const s of node.findAllExpressionsMulti([Expressions.Source, Expressions.SimpleSource3])) {
40676
40688
  source_1.Source.runSyntax(s, input);
40677
40689
  }
40678
40690
  }
@@ -43497,6 +43509,11 @@ class Parameter {
43497
43509
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
43498
43510
  return;
43499
43511
  }
43512
+ if (this.hasUserCommand(node) && this.hasLength(node)) {
43513
+ const message = "USER-COMMAND and LENGTH not possible together";
43514
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
43515
+ return;
43516
+ }
43500
43517
  const bfound = new basic_types_1.BasicTypes(input).parseType(node);
43501
43518
  if (bfound) {
43502
43519
  input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, bfound));
@@ -43508,6 +43525,30 @@ class Parameter {
43508
43525
  const magicToken = new tokens_1.Identifier(nameToken.getStart(), magicName);
43509
43526
  input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(magicToken, input.filename, basic_1.VoidType.get("PARAMETER-MAGIC")));
43510
43527
  }
43528
+ // "USER-COMMAND" is lexed as three tokens
43529
+ hasUserCommand(node) {
43530
+ const tokens = node.getTokens();
43531
+ for (let i = 0; i < tokens.length - 2; i++) {
43532
+ if (tokens[i].getStr().toUpperCase() === "USER"
43533
+ && tokens[i + 1].getStr() === "-"
43534
+ && tokens[i + 2].getStr().toUpperCase() === "COMMAND") {
43535
+ return true;
43536
+ }
43537
+ }
43538
+ return false;
43539
+ }
43540
+ // "VISIBLE LENGTH" is not the same as "LENGTH"
43541
+ hasLength(node) {
43542
+ var _a;
43543
+ const tokens = node.getTokens();
43544
+ for (let i = 0; i < tokens.length; i++) {
43545
+ if (tokens[i].getStr().toUpperCase() === "LENGTH"
43546
+ && ((_a = tokens[i - 1]) === null || _a === void 0 ? void 0 : _a.getStr().toUpperCase()) !== "VISIBLE") {
43547
+ return true;
43548
+ }
43549
+ }
43550
+ return false;
43551
+ }
43511
43552
  }
43512
43553
  exports.Parameter = Parameter;
43513
43554
  //# sourceMappingURL=parameter.js.map
@@ -69962,7 +70003,7 @@ class Registry {
69962
70003
  }
69963
70004
  static abaplintVersion() {
69964
70005
  // magic, see build script "version.js"
69965
- return "2.120.29";
70006
+ return "2.120.30";
69966
70007
  }
69967
70008
  getDDICReferences() {
69968
70009
  return this.ddicReferences;
@@ -75401,6 +75442,7 @@ class CloudTypes {
75401
75442
  || obj instanceof Objects.BehaviorDefinition
75402
75443
  || obj instanceof Objects.BusinessCatalog
75403
75444
  || obj instanceof Objects.BusinessCatalogAppAssignment
75445
+ || obj instanceof Objects.BusinessConfigurationMaintenanceObject
75404
75446
  || obj instanceof Objects.CDSMetadataExtension
75405
75447
  || obj instanceof Objects.Class
75406
75448
  || obj instanceof Objects.CDSType
@@ -75417,11 +75459,13 @@ class CloudTypes {
75417
75459
  || obj instanceof Objects.EventBinding
75418
75460
  || obj instanceof Objects.EventConsumer
75419
75461
  || obj instanceof Objects.FunctionGroup
75462
+ || obj instanceof Objects.GatewayODataGroupAndAssignment
75420
75463
  || obj instanceof Objects.HttpService
75421
75464
  || obj instanceof Objects.IAMApp
75422
75465
  || obj instanceof Objects.InboundService
75423
75466
  || obj instanceof Objects.Interface
75424
75467
  || obj instanceof Objects.LockObject
75468
+ || obj instanceof Objects.MaintenanceAndTransportObject
75425
75469
  || obj instanceof Objects.MessageClass
75426
75470
  || obj instanceof Objects.NumberRange
75427
75471
  || obj instanceof Objects.OutboundService
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.120.29",
3
+ "version": "2.120.30",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "homepage": "https://abaplint.org",
41
41
  "devDependencies": {
42
- "@abaplint/core": "^2.120.29",
42
+ "@abaplint/core": "^2.120.30",
43
43
  "@types/chai": "^4.3.20",
44
44
  "@types/minimist": "^1.2.5",
45
45
  "@types/mocha": "^10.0.10",