@abaplint/cli 2.120.43 → 2.120.45

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 +235 -31
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -24361,6 +24361,7 @@ exports.ABAPFileInformationParser = void 0;
24361
24361
  const Structures = __importStar(__webpack_require__(/*! ../3_structures/structures */ "../core/build/src/abap/3_structures/structures/index.js"));
24362
24362
  const Expressions = __importStar(__webpack_require__(/*! ../2_statements/expressions */ "../core/build/src/abap/2_statements/expressions/index.js"));
24363
24363
  const Statements = __importStar(__webpack_require__(/*! ../2_statements/statements */ "../core/build/src/abap/2_statements/statements/index.js"));
24364
+ const nodes_1 = __webpack_require__(/*! ../nodes */ "../core/build/src/abap/nodes/index.js");
24364
24365
  const _identifier_1 = __webpack_require__(/*! ./_identifier */ "../core/build/src/abap/4_file_information/_identifier.js");
24365
24366
  const Tokens = __importStar(__webpack_require__(/*! ../1_lexer/tokens */ "../core/build/src/abap/1_lexer/tokens/index.js"));
24366
24367
  const visibility_1 = __webpack_require__(/*! ./visibility */ "../core/build/src/abap/4_file_information/visibility.js");
@@ -24500,6 +24501,7 @@ class ABAPFileInformationParser {
24500
24501
  riskLevel,
24501
24502
  isAbstract: (cdef === null || cdef === void 0 ? void 0 : cdef.findDirectTokenByText("ABSTRACT")) !== undefined,
24502
24503
  isSharedMemory: concat.includes(" SHARED MEMORY ENABLED"),
24504
+ behaviorDefinitionName: this.findBehaviorDefinitionName(cdef),
24503
24505
  isFinal: found.findFirstExpression(Expressions.ClassFinal) !== undefined,
24504
24506
  aliases,
24505
24507
  attributes,
@@ -24509,6 +24511,20 @@ class ABAPFileInformationParser {
24509
24511
  return classes;
24510
24512
  }
24511
24513
  ///////////////////
24514
+ /** "FOR BEHAVIOR OF" and "FOR EVENTS OF" both use the BehaviorDefinitionName expression,
24515
+ * so look at the token two positions before the expression to tell them apart */
24516
+ findBehaviorDefinitionName(cdef) {
24517
+ const children = (cdef === null || cdef === void 0 ? void 0 : cdef.getChildren()) || [];
24518
+ for (let i = 2; i < children.length; i++) {
24519
+ const child = children[i];
24520
+ if (child instanceof nodes_1.ExpressionNode
24521
+ && child.get() instanceof Expressions.BehaviorDefinitionName
24522
+ && children[i - 2].concatTokens().toUpperCase() === "BEHAVIOR") {
24523
+ return child.concatTokens();
24524
+ }
24525
+ }
24526
+ return undefined;
24527
+ }
24512
24528
  getImplementing(input) {
24513
24529
  const ret = [];
24514
24530
  for (const node of input.findAllStatements(Statements.InterfaceDef)) {
@@ -26204,6 +26220,18 @@ class CurrentScope {
26204
26220
  }
26205
26221
  return undefined;
26206
26222
  }
26223
+ /** the BDEF from "FOR BEHAVIOR OF" of the enclosing global class, undefined if not a behavior pool */
26224
+ findBehaviorDefinition() {
26225
+ var _a;
26226
+ if (this.parentObj.getType() !== "CLAS") {
26227
+ return undefined;
26228
+ }
26229
+ const name = (_a = this.parentObj.getClassDefinition()) === null || _a === void 0 ? void 0 : _a.behaviorDefinitionName;
26230
+ if (name === undefined) {
26231
+ return undefined;
26232
+ }
26233
+ return this.reg.getObject("BDEF", name);
26234
+ }
26207
26235
  isBadiDef(name) {
26208
26236
  const upper = name.toUpperCase();
26209
26237
  for (const enhs of this.reg.getObjectsByType("ENHS")) {
@@ -28513,7 +28541,7 @@ class BasicTypes {
28513
28541
  return undefined;
28514
28542
  }
28515
28543
  parseTable(node, name) {
28516
- var _a, _b, _c, _d;
28544
+ var _a, _b, _c;
28517
28545
  const typename = node.findFirstExpression(Expressions.TypeName) || node.findFirstExpression(Expressions.EntityAssociation);
28518
28546
  const text = (_a = node.findFirstExpression(Expressions.TypeTable)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();
28519
28547
  if (text === undefined) {
@@ -28650,25 +28678,31 @@ class BasicTypes {
28650
28678
  return new Types.TableType(structure, options);
28651
28679
  }
28652
28680
  else if (typename && this.isRAPTableFor(text)) {
28653
- const name = typename.concatTokens();
28654
- const ddlsName = this.getRAPBaseEntityName(name);
28655
- const type = (_d = this.input.scope.getDDIC().lookupDDLS(ddlsName)) === null || _d === void 0 ? void 0 : _d.type;
28656
- if (type) {
28657
- return new Types.TableType(basic_1.VoidType.get("RAP-TODO"), options);
28658
- }
28659
- else if (this.isRAPDerivedEntityName(name)) {
28660
- return Types.VoidType.get(name);
28661
- }
28662
- else if (this.input.scope.getDDIC().inErrorNamespace(ddlsName)) {
28663
- return new Types.UnknownType(`DDLS ${ddlsName} not found`);
28664
- }
28665
- else {
28666
- return Types.VoidType.get(name);
28667
- }
28681
+ return this.rapTableFor(typename.concatTokens(), options);
28668
28682
  }
28669
28683
  // fallback to old style syntax, OCCURS etc
28670
28684
  return this.parseType(node, name);
28671
28685
  }
28686
+ /** type of a RAP derived table type, ie the "TABLE FOR LOCK zentity" part of a type */
28687
+ rapTableFor(entityName, options) {
28688
+ var _a;
28689
+ const ddlsName = this.resolveRAPAlias(this.getRAPBaseEntityName(entityName));
28690
+ if ((_a = this.input.scope.getDDIC().lookupDDLS(ddlsName)) === null || _a === void 0 ? void 0 : _a.type) {
28691
+ return new Types.TableType(basic_1.VoidType.get("RAP-TODO"), options !== null && options !== void 0 ? options : {
28692
+ withHeader: false,
28693
+ keyType: Types.TableKeyType.user,
28694
+ primaryKey: { name: "primary_key", type: basic_1.TableAccessType.standard, isUnique: false, keyFields: [] },
28695
+ secondary: [],
28696
+ });
28697
+ }
28698
+ else if (this.isRAPDerivedEntityName(entityName)) {
28699
+ return Types.VoidType.get(entityName);
28700
+ }
28701
+ else if (this.input.scope.getDDIC().inErrorNamespace(ddlsName)) {
28702
+ return new Types.UnknownType(`DDLS ${ddlsName} not found`);
28703
+ }
28704
+ return Types.VoidType.get(entityName);
28705
+ }
28672
28706
  parseType(node, qualifiedName) {
28673
28707
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
28674
28708
  const typeName = node.findFirstExpression(Expressions.TypeName);
@@ -28862,6 +28896,12 @@ class BasicTypes {
28862
28896
  const splitAt = Math.min(...candidates);
28863
28897
  return name.substring(0, splitAt);
28864
28898
  }
28899
+ /** inside a behavior pool the entities are referenced via the aliases defined in the BDEF */
28900
+ resolveRAPAlias(name) {
28901
+ var _a;
28902
+ var _b;
28903
+ return (_b = (_a = this.input.scope.findBehaviorDefinition()) === null || _a === void 0 ? void 0 : _a.findEntityNameByAlias(name)) !== null && _b !== void 0 ? _b : name;
28904
+ }
28865
28905
  isRAPDerivedEntityName(name) {
28866
28906
  return name.includes("\\") || name.includes("~");
28867
28907
  }
@@ -36307,6 +36347,19 @@ class ValueBody {
36307
36347
  const message = "VALUE, source type CharacterType not compatible with StringType";
36308
36348
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, s.getFirstToken(), message));
36309
36349
  }
36350
+ else if (this.insertsUsingTableKey(targetType)) {
36351
+ // only STANDARD tables append the rows, and thus allow padding of shorter c and x values
36352
+ const row = this.characterOrHexLength(rowType);
36353
+ const source = this.characterOrHexLength(sourceType);
36354
+ if (row !== undefined
36355
+ && source !== undefined
36356
+ && row.abap === source.abap
36357
+ && row.length !== source.length) {
36358
+ const message = `VALUE, source type ${source.abap} LENGTH ${source.length} not compatible ` +
36359
+ `with row type ${row.abap} LENGTH ${row.length}`;
36360
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, s.getFirstToken(), message));
36361
+ }
36362
+ }
36310
36363
  }
36311
36364
  }
36312
36365
  if (letScoped === true) {
@@ -36320,6 +36373,25 @@ class ValueBody {
36320
36373
  }
36321
36374
  return targetType ? targetType : type;
36322
36375
  }
36376
+ /** SORTED and HASHED tables insert the constructed rows using the table key, which
36377
+ * requires the rows to be compatible with the row type. STANDARD tables only append
36378
+ * the rows, so shorter c and x values are padded on the right instead. */
36379
+ static insertsUsingTableKey(targetType) {
36380
+ if (!(targetType instanceof basic_1.TableType)) {
36381
+ return false;
36382
+ }
36383
+ const accessType = targetType.getAccessType();
36384
+ return accessType === basic_1.TableAccessType.sorted || accessType === basic_1.TableAccessType.hashed;
36385
+ }
36386
+ static characterOrHexLength(type) {
36387
+ if (type instanceof basic_1.CharacterType) {
36388
+ return { abap: "c", length: type.getLength() };
36389
+ }
36390
+ else if (type instanceof basic_1.HexType) {
36391
+ return { abap: "x", length: type.getLength() };
36392
+ }
36393
+ return undefined;
36394
+ }
36323
36395
  }
36324
36396
  exports.ValueBody = ValueBody;
36325
36397
  //# sourceMappingURL=value_body.js.map
@@ -53432,6 +53504,7 @@ const _typed_identifier_1 = __webpack_require__(/*! ./_typed_identifier */ "../c
53432
53504
  const basic_1 = __webpack_require__(/*! ./basic */ "../core/build/src/abap/types/basic/index.js");
53433
53505
  const method_def_returning_1 = __webpack_require__(/*! ../5_syntax/expressions/method_def_returning */ "../core/build/src/abap/5_syntax/expressions/method_def_returning.js");
53434
53506
  const method_param_1 = __webpack_require__(/*! ../5_syntax/expressions/method_param */ "../core/build/src/abap/5_syntax/expressions/method_param.js");
53507
+ const basic_types_1 = __webpack_require__(/*! ../5_syntax/basic_types */ "../core/build/src/abap/5_syntax/basic_types.js");
53435
53508
  const _object_oriented_1 = __webpack_require__(/*! ../5_syntax/_object_oriented */ "../core/build/src/abap/5_syntax/_object_oriented.js");
53436
53509
  const _reference_1 = __webpack_require__(/*! ../5_syntax/_reference */ "../core/build/src/abap/5_syntax/_reference.js");
53437
53510
  const identifier_1 = __webpack_require__(/*! ../1_lexer/tokens/identifier */ "../core/build/src/abap/1_lexer/tokens/identifier.js");
@@ -53619,24 +53692,37 @@ class MethodParameters {
53619
53692
  }
53620
53693
  }
53621
53694
  workaroundRAP(node, input, parentName) {
53695
+ var _a;
53622
53696
  const resultName = node.findExpressionAfterToken("RESULT");
53623
53697
  const concat = node.concatTokens().toUpperCase();
53624
53698
  const isRap = node.findExpressionAfterToken("IMPORTING")
53625
53699
  || (concat.includes(" IMPORTING REQUEST ") ? node.findExpressionAfterToken("REQUEST") : undefined);
53626
53700
  if (isRap) {
53701
+ // "FOR LOCK" handlers have a well defined signature, so the types can be derived
53702
+ const lockEntity = concat.includes(" FOR LOCK ")
53703
+ ? (_a = node.findExpressionAfterToken("LOCK")) === null || _a === void 0 ? void 0 : _a.concatTokens()
53704
+ : undefined;
53627
53705
  for (const foo of node.findDirectExpressions(Expressions.MethodParamName)) {
53628
53706
  if (foo === resultName) {
53629
53707
  continue;
53630
53708
  }
53631
- this.importing.push(new _typed_identifier_1.TypedIdentifier(foo.getFirstToken(), input.filename, basic_1.VoidType.get("RapMethodParameter"), ["importing" /* IdentifierMeta.MethodImporting */]));
53709
+ const type = lockEntity === undefined
53710
+ ? basic_1.VoidType.get("RapMethodParameter")
53711
+ : new basic_types_1.BasicTypes(input).rapTableFor(lockEntity);
53712
+ this.importing.push(new _typed_identifier_1.TypedIdentifier(foo.getFirstToken(), input.filename, type, ["importing" /* IdentifierMeta.MethodImporting */]));
53713
+ }
53714
+ if (lockEntity !== undefined) {
53715
+ // note: "mapped" is not part of the signature for "FOR LOCK"
53716
+ const token = isRap.getFirstToken();
53717
+ this.exporting.push(new _typed_identifier_1.TypedIdentifier(new identifier_1.Identifier(token.getStart(), "failed"), input.filename, basic_1.VoidType.get(`RESPONSE FOR FAILED EARLY ${lockEntity}`), ["exporting" /* IdentifierMeta.MethodExporting */]));
53718
+ this.exporting.push(new _typed_identifier_1.TypedIdentifier(new identifier_1.Identifier(token.getStart(), "reported"), input.filename, basic_1.VoidType.get(`RESPONSE FOR REPORTED EARLY ${lockEntity}`), ["exporting" /* IdentifierMeta.MethodExporting */]));
53632
53719
  }
53633
- if (concat.includes(" FOR VALIDATE ")
53720
+ else if (concat.includes(" FOR VALIDATE ")
53634
53721
  || concat.includes(" FOR BEHAVIOR ")
53635
53722
  || concat.includes(" FOR DETERMINE ")
53636
53723
  || concat.includes(" FOR FEATURES ")
53637
53724
  || concat.includes(" FOR INSTANCE FEATURES ")
53638
53725
  || concat.includes(" FOR GLOBAL AUTHORIZATION ")
53639
- || concat.includes(" FOR LOCK ")
53640
53726
  || concat.includes(" FOR PRECHECK ")
53641
53727
  || concat.includes(" FOR NUMBERING ")
53642
53728
  || concat.includes(" FOR READ ")
@@ -61595,6 +61681,10 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
61595
61681
  exports.BehaviorDefinition = void 0;
61596
61682
  const _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ "../core/build/src/objects/_abstract_object.js");
61597
61683
  class BehaviorDefinition extends _abstract_object_1.AbstractObject {
61684
+ constructor() {
61685
+ super(...arguments);
61686
+ this.parsedData = undefined;
61687
+ }
61598
61688
  getType() {
61599
61689
  return "BDEF";
61600
61690
  }
@@ -61608,6 +61698,49 @@ class BehaviorDefinition extends _abstract_object_1.AbstractObject {
61608
61698
  // todo
61609
61699
  return undefined;
61610
61700
  }
61701
+ setDirty() {
61702
+ this.parsedData = undefined;
61703
+ super.setDirty();
61704
+ }
61705
+ findSourceFile() {
61706
+ return this.getFiles().find(f => f.getFilename().endsWith(".asbdef"));
61707
+ }
61708
+ listEntities() {
61709
+ return this.parseSource().entities;
61710
+ }
61711
+ /** finds the entity name for a given alias, undefined if the alias is not defined */
61712
+ findEntityNameByAlias(alias) {
61713
+ var _a;
61714
+ const upper = alias.toUpperCase();
61715
+ for (const entity of this.listEntities()) {
61716
+ if (((_a = entity.alias) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === upper) {
61717
+ return entity.name;
61718
+ }
61719
+ }
61720
+ return undefined;
61721
+ }
61722
+ /////////////////////////
61723
+ parseSource() {
61724
+ var _a;
61725
+ if (this.parsedData !== undefined) {
61726
+ return this.parsedData;
61727
+ }
61728
+ this.parsedData = { entities: [] };
61729
+ const raw = (_a = this.findSourceFile()) === null || _a === void 0 ? void 0 : _a.getRaw();
61730
+ if (raw === undefined) {
61731
+ return this.parsedData;
61732
+ }
61733
+ // BDEF uses "//" for line comments
61734
+ const stripped = raw.replace(/\/\/.*$/gm, "");
61735
+ // eg. "define behavior for ZI_Booking alias Booking", also "define abstract behavior for ..."
61736
+ const regex = /\bdefine\s+(?:\w+\s+)*?behavior\s+for\s+([\w/]+)(?:\s+alias\s+(\w+))?/gi;
61737
+ let match = regex.exec(stripped);
61738
+ while (match !== null) {
61739
+ this.parsedData.entities.push({ name: match[1], alias: match[2] });
61740
+ match = regex.exec(stripped);
61741
+ }
61742
+ return this.parsedData;
61743
+ }
61611
61744
  }
61612
61745
  exports.BehaviorDefinition = BehaviorDefinition;
61613
61746
  //# sourceMappingURL=behavior_definition.js.map
@@ -65112,6 +65245,7 @@ exports.LockObject = void 0;
65112
65245
  const basic_1 = __webpack_require__(/*! ../abap/types/basic */ "../core/build/src/abap/types/basic/index.js");
65113
65246
  const ddic_1 = __webpack_require__(/*! ../ddic */ "../core/build/src/ddic.js");
65114
65247
  const _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ "../core/build/src/objects/_abstract_object.js");
65248
+ const xml_utils_1 = __webpack_require__(/*! ../xml_utils */ "../core/build/src/xml_utils.js");
65115
65249
  class LockObject extends _abstract_object_1.AbstractObject {
65116
65250
  getType() {
65117
65251
  return "ENQU";
@@ -65132,6 +65266,11 @@ class LockObject extends _abstract_object_1.AbstractObject {
65132
65266
  this.parse();
65133
65267
  return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.primaryTable;
65134
65268
  }
65269
+ getParameters() {
65270
+ var _a;
65271
+ this.parse();
65272
+ return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.parameters;
65273
+ }
65135
65274
  parseType(reg) {
65136
65275
  var _a;
65137
65276
  this.parse();
@@ -65156,7 +65295,7 @@ class LockObject extends _abstract_object_1.AbstractObject {
65156
65295
  }
65157
65296
  }
65158
65297
  parse() {
65159
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
65298
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
65160
65299
  if (this.parsedXML) {
65161
65300
  return { updated: false, runtime: 0 };
65162
65301
  }
@@ -65170,6 +65309,18 @@ class LockObject extends _abstract_object_1.AbstractObject {
65170
65309
  }
65171
65310
  this.parsedXML.primaryTable = (_f = (_e = (_d = (_c = parsed.abapGit) === null || _c === void 0 ? void 0 : _c["asx:abap"]) === null || _d === void 0 ? void 0 : _d["asx:values"]) === null || _e === void 0 ? void 0 : _e.DD25V) === null || _f === void 0 ? void 0 : _f.ROOTTAB;
65172
65311
  this.parsedXML.description = (_k = (_j = (_h = (_g = parsed.abapGit) === null || _g === void 0 ? void 0 : _g["asx:abap"]) === null || _h === void 0 ? void 0 : _h["asx:values"]) === null || _j === void 0 ? void 0 : _j.DD25V) === null || _k === void 0 ? void 0 : _k.DDTEXT;
65312
+ this.parsedXML.parameters = [];
65313
+ const parameters = (_o = (_m = (_l = parsed.abapGit) === null || _l === void 0 ? void 0 : _l["asx:abap"]) === null || _m === void 0 ? void 0 : _m["asx:values"]) === null || _o === void 0 ? void 0 : _o.DD27P_TABLE;
65314
+ for (const parameter of (0, xml_utils_1.xmlToArray)(parameters === null || parameters === void 0 ? void 0 : parameters.DD27P)) {
65315
+ if (typeof (parameter === null || parameter === void 0 ? void 0 : parameter.VIEWFIELD) !== "string") {
65316
+ continue;
65317
+ }
65318
+ this.parsedXML.parameters.push({
65319
+ VIEWFIELD: parameter.VIEWFIELD,
65320
+ TABNAME: parameter.TABNAME,
65321
+ FIELDNAME: parameter.FIELDNAME,
65322
+ });
65323
+ }
65173
65324
  const end = Date.now();
65174
65325
  return { updated: true, runtime: end - start };
65175
65326
  }
@@ -68560,6 +68711,20 @@ class Table extends _abstract_object_1.AbstractObject {
68560
68711
  }
68561
68712
  return (_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.tableCategory;
68562
68713
  }
68714
+ getDeliveryClass() {
68715
+ var _a;
68716
+ if (this.parsedData === undefined) {
68717
+ this.parseXML();
68718
+ }
68719
+ return (_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.deliveryClass;
68720
+ }
68721
+ getSizeCategory() {
68722
+ var _a;
68723
+ if (this.parsedData === undefined) {
68724
+ this.parseXML();
68725
+ }
68726
+ return (_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.sizeCategory;
68727
+ }
68563
68728
  getEnhancementCategory() {
68564
68729
  var _a;
68565
68730
  if (this.parsedData === undefined) {
@@ -68587,7 +68752,7 @@ class Table extends _abstract_object_1.AbstractObject {
68587
68752
  return false;
68588
68753
  }
68589
68754
  parseXML() {
68590
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
68755
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12;
68591
68756
  const parsed = super.parseRaw2();
68592
68757
  if (parsed === undefined) {
68593
68758
  return;
@@ -68607,8 +68772,10 @@ class Table extends _abstract_object_1.AbstractObject {
68607
68772
  this.parsedData.tableCategory = (_m = (_l = (_k = (_j = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _j === void 0 ? void 0 : _j["asx:abap"]) === null || _k === void 0 ? void 0 : _k["asx:values"]) === null || _l === void 0 ? void 0 : _l.DD02V) === null || _m === void 0 ? void 0 : _m.TABCLASS;
68608
68773
  this.parsedData.description = (_r = (_q = (_p = (_o = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _o === void 0 ? void 0 : _o["asx:abap"]) === null || _p === void 0 ? void 0 : _p["asx:values"]) === null || _q === void 0 ? void 0 : _q.DD02V) === null || _r === void 0 ? void 0 : _r.DDTEXT;
68609
68774
  this.parsedData.dataClass = (_v = (_u = (_t = (_s = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _s === void 0 ? void 0 : _s["asx:abap"]) === null || _t === void 0 ? void 0 : _t["asx:values"]) === null || _u === void 0 ? void 0 : _u.DD09L) === null || _v === void 0 ? void 0 : _v.TABART;
68775
+ this.parsedData.deliveryClass = (_z = (_y = (_x = (_w = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _w === void 0 ? void 0 : _w["asx:abap"]) === null || _x === void 0 ? void 0 : _x["asx:values"]) === null || _y === void 0 ? void 0 : _y.DD02V) === null || _z === void 0 ? void 0 : _z.CONTFLAG;
68776
+ this.parsedData.sizeCategory = (_3 = (_2 = (_1 = (_0 = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _0 === void 0 ? void 0 : _0["asx:abap"]) === null || _1 === void 0 ? void 0 : _1["asx:values"]) === null || _2 === void 0 ? void 0 : _2.DD09L) === null || _3 === void 0 ? void 0 : _3.TABKAT;
68610
68777
  // fields
68611
- const fields = (_y = (_x = (_w = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _w === void 0 ? void 0 : _w["asx:abap"]) === null || _x === void 0 ? void 0 : _x["asx:values"]) === null || _y === void 0 ? void 0 : _y.DD03P_TABLE;
68778
+ const fields = (_6 = (_5 = (_4 = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _4 === void 0 ? void 0 : _4["asx:abap"]) === null || _5 === void 0 ? void 0 : _5["asx:values"]) === null || _6 === void 0 ? void 0 : _6.DD03P_TABLE;
68612
68779
  for (const field of (0, xml_utils_1.xmlToArray)(fields === null || fields === void 0 ? void 0 : fields.DD03P)) {
68613
68780
  if (typeof (field === null || field === void 0 ? void 0 : field.FIELDNAME) !== "string") {
68614
68781
  continue;
@@ -68632,13 +68799,13 @@ class Table extends _abstract_object_1.AbstractObject {
68632
68799
  });
68633
68800
  }
68634
68801
  // secondary indexes
68635
- const indexes = (_1 = (_0 = (_z = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _z === void 0 ? void 0 : _z["asx:abap"]) === null || _0 === void 0 ? void 0 : _0["asx:values"]) === null || _1 === void 0 ? void 0 : _1.DD12V;
68802
+ const indexes = (_9 = (_8 = (_7 = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _7 === void 0 ? void 0 : _7["asx:abap"]) === null || _8 === void 0 ? void 0 : _8["asx:values"]) === null || _9 === void 0 ? void 0 : _9.DD12V;
68636
68803
  ;
68637
68804
  this.parsedData.secondaryIndexes = [];
68638
68805
  for (const index of (0, xml_utils_1.xmlToArray)(indexes === null || indexes === void 0 ? void 0 : indexes.DD12V)) {
68639
68806
  const indexName = index.INDEXNAME;
68640
68807
  const indexFields = [];
68641
- const indexFieldsXml = (_4 = (_3 = (_2 = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _2 === void 0 ? void 0 : _2["asx:abap"]) === null || _3 === void 0 ? void 0 : _3["asx:values"]) === null || _4 === void 0 ? void 0 : _4.DD17V;
68808
+ const indexFieldsXml = (_12 = (_11 = (_10 = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _10 === void 0 ? void 0 : _10["asx:abap"]) === null || _11 === void 0 ? void 0 : _11["asx:values"]) === null || _12 === void 0 ? void 0 : _12.DD17V;
68642
68809
  for (const indexField of (0, xml_utils_1.xmlToArray)(indexFieldsXml === null || indexFieldsXml === void 0 ? void 0 : indexFieldsXml.DD17V)) {
68643
68810
  if (indexField.INDEXNAME === indexName) {
68644
68811
  // assumption: fields are listed by POSITION in the xml
@@ -70176,7 +70343,7 @@ class Registry {
70176
70343
  }
70177
70344
  static abaplintVersion() {
70178
70345
  // magic, see build script "version.js"
70179
- return "2.120.43";
70346
+ return "2.120.45";
70180
70347
  }
70181
70348
  getDDICReferences() {
70182
70349
  return this.ddicReferences;
@@ -85549,6 +85716,7 @@ exports.LineBreakStyle = exports.LineBreakStyleConf = void 0;
85549
85716
  const issue_1 = __webpack_require__(/*! ../issue */ "../core/build/src/issue.js");
85550
85717
  const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "../core/build/src/rules/_basic_rule_config.js");
85551
85718
  const _irule_1 = __webpack_require__(/*! ./_irule */ "../core/build/src/rules/_irule.js");
85719
+ const objects_1 = __webpack_require__(/*! ../objects */ "../core/build/src/objects/index.js");
85552
85720
  class LineBreakStyleConf extends _basic_rule_config_1.BasicRuleConfig {
85553
85721
  }
85554
85722
  exports.LineBreakStyleConf = LineBreakStyleConf;
@@ -85559,10 +85727,11 @@ class LineBreakStyle {
85559
85727
  getMetadata() {
85560
85728
  return {
85561
85729
  key: "line_break_style",
85562
- title: "Makes sure line breaks are consistent in the ABAP code",
85563
- shortDescription: `Enforces LF as newlines in ABAP files
85730
+ title: "Makes sure line breaks are consistent",
85731
+ shortDescription: `Enforces LF as newlines in ABAP and XML files
85564
85732
 
85565
85733
  abapGit does not work with CRLF`,
85734
+ extendedInformation: `SMIM and W3MI files are not checked.`,
85566
85735
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
85567
85736
  };
85568
85737
  }
@@ -85577,8 +85746,15 @@ abapGit does not work with CRLF`,
85577
85746
  }
85578
85747
  run(obj) {
85579
85748
  const output = [];
85749
+ if (obj instanceof objects_1.MIMEObject || obj instanceof objects_1.WebMIME) {
85750
+ return output;
85751
+ }
85580
85752
  for (const file of obj.getFiles()) {
85581
- if (file.getFilename().endsWith(".abap")) {
85753
+ const filename = file.getFilename();
85754
+ if (filename.endsWith(".abap") || filename.endsWith(".xml")) {
85755
+ if (filename.endsWith(".xslt.source.xml")) {
85756
+ continue;
85757
+ }
85582
85758
  const rows = file.getRawRows();
85583
85759
  for (let i = 0; i < rows.length; i++) {
85584
85760
  if (rows[i].endsWith("\r") === true) {
@@ -100104,6 +100280,8 @@ class XMLConsistency {
100104
100280
  * XML is well-formed and parseable
100105
100281
  * Naming for CLAS and INTF objects
100106
100282
  * QUAN fields in TABL objects have reference table and field values
100283
+ * Transparent TABL objects have delivery class and size category set
100284
+ * Lock parameter names in ENQU objects are max 16 characters
100107
100285
  * Texts and translations do not exceed maximum allowed length.`,
100108
100286
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.Syntax],
100109
100287
  };
@@ -100161,6 +100339,9 @@ class XMLConsistency {
100161
100339
  else if (obj instanceof Objects.Table) {
100162
100340
  issues.push(...this.runTable(obj, file));
100163
100341
  }
100342
+ else if (obj instanceof Objects.LockObject) {
100343
+ issues.push(...this.runLockObject(obj, file));
100344
+ }
100164
100345
  if (obj instanceof _abap_object_1.ABAPObject) {
100165
100346
  issues.push(...this.runTextPool(obj, file));
100166
100347
  }
@@ -100344,16 +100525,39 @@ class XMLConsistency {
100344
100525
  }
100345
100526
  return issues;
100346
100527
  }
100528
+ runLockObject(obj, file) {
100529
+ var _a;
100530
+ const maxParameterLength = 16;
100531
+ const issues = [];
100532
+ for (const parameter of (_a = obj.getParameters()) !== null && _a !== void 0 ? _a : []) {
100533
+ if (parameter.VIEWFIELD.length > maxParameterLength) {
100534
+ const message = `Lock parameter ${parameter.VIEWFIELD} exceeds maximum length of ` +
100535
+ `${maxParameterLength} characters (actual: ${parameter.VIEWFIELD.length})`;
100536
+ issues.push(issue_1.Issue.atRow(file, 1, message, this.getMetadata().key, this.conf.severity));
100537
+ }
100538
+ }
100539
+ return issues;
100540
+ }
100347
100541
  runTable(obj, file) {
100348
- var _a, _b;
100349
- var _c;
100542
+ var _a, _b, _c, _d;
100543
+ var _e;
100350
100544
  const issues = [];
100351
- for (const field of (_c = obj.getFields()) !== null && _c !== void 0 ? _c : []) {
100545
+ for (const field of (_e = obj.getFields()) !== null && _e !== void 0 ? _e : []) {
100352
100546
  if (field.DATATYPE === "QUAN" && (!((_a = field.REFTABLE) === null || _a === void 0 ? void 0 : _a.trim()) || !((_b = field.REFFIELD) === null || _b === void 0 ? void 0 : _b.trim()))) {
100353
100547
  const message = `QUAN field ${field.FIELDNAME} must have REFTABLE and REFFIELD set`;
100354
100548
  issues.push(issue_1.Issue.atRow(file, 1, message, this.getMetadata().key, this.conf.severity));
100355
100549
  }
100356
100550
  }
100551
+ if (obj.getTableCategory() === Objects.TableCategory.Transparent) {
100552
+ if (!((_c = obj.getDeliveryClass()) === null || _c === void 0 ? void 0 : _c.trim())) {
100553
+ const message = `Transparent table must have delivery class(CONTFLAG in DD02V) set`;
100554
+ issues.push(issue_1.Issue.atRow(file, 1, message, this.getMetadata().key, this.conf.severity));
100555
+ }
100556
+ if (!((_d = obj.getSizeCategory()) === null || _d === void 0 ? void 0 : _d.trim())) {
100557
+ const message = `Transparent table must have size category(TABKAT in DD09L) set`;
100558
+ issues.push(issue_1.Issue.atRow(file, 1, message, this.getMetadata().key, this.conf.severity));
100559
+ }
100560
+ }
100357
100561
  return issues;
100358
100562
  }
100359
100563
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.120.43",
3
+ "version": "2.120.45",
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.43",
42
+ "@abaplint/core": "^2.120.45",
43
43
  "@types/chai": "^4.3.20",
44
44
  "@types/minimist": "^1.2.5",
45
45
  "@types/mocha": "^10.0.10",