@abaplint/cli 2.120.83 → 2.120.85

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 +1436 -50
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -567,11 +567,40 @@ exports.LexerStream = LexerStream;
567
567
  Object.defineProperty(exports, "__esModule", ({ value: true }));
568
568
  exports.AbstractToken = void 0;
569
569
  const position_1 = __webpack_require__(/*! ../../../position */ "../core/build/src/position.js");
570
- class AbstractToken {
570
+ const virtual_position_1 = __webpack_require__(/*! ../../../virtual_position */ "../core/build/src/virtual_position.js");
571
+ // token strings repeat a lot across files (keywords, common names, upper cased copies), share them.
572
+ // Longer strings are typically comments or text literals, not worth sharing
573
+ const INTERN_MAX_LENGTH = 30;
574
+ // bound the table, it lives for the lifetime of the process
575
+ const INTERN_MAX_ENTRIES = 100000;
576
+ // V8 represents substrings of this length or longer as slices that reference the full source,
577
+ // these are flattened before being stored, so the table does not keep removed files alive
578
+ const SLICED_MIN_LENGTH = 13;
579
+ let interned = new Map();
580
+ function intern(str) {
581
+ if (str.length > INTERN_MAX_LENGTH) {
582
+ return str;
583
+ }
584
+ const found = interned.get(str);
585
+ if (found !== undefined) {
586
+ return found;
587
+ }
588
+ if (interned.size >= INTERN_MAX_ENTRIES) {
589
+ interned = new Map();
590
+ }
591
+ const copy = str.length >= SLICED_MIN_LENGTH ? str.split("").join("") : str;
592
+ interned.set(copy, copy);
593
+ return copy;
594
+ }
595
+ // the token is its own start position, saves a separate Position object per token
596
+ class AbstractToken extends position_1.Position {
571
597
  constructor(start, str) {
572
- this.start = start;
573
- this.str = str;
574
- this.strUpper = str.toUpperCase();
598
+ super(start.getRow(), start.getCol());
599
+ this.str = intern(str);
600
+ this.strUpper = intern(str.toUpperCase());
601
+ if (start instanceof virtual_position_1.VirtualPosition) {
602
+ this.virtual = start;
603
+ }
575
604
  }
576
605
  // special function, for debugging purposes, see https://github.com/abaplint/abaplint/pull/3137
577
606
  [Symbol.for("debug.description")]() {
@@ -583,17 +612,12 @@ class AbstractToken {
583
612
  getUpperStr() {
584
613
  return this.strUpper;
585
614
  }
586
- getRow() {
587
- return this.start.getRow();
588
- }
589
- getCol() {
590
- return this.start.getCol();
591
- }
592
615
  getStart() {
593
- return this.start;
616
+ var _a;
617
+ return (_a = this.virtual) !== null && _a !== void 0 ? _a : this;
594
618
  }
595
619
  getEnd() {
596
- return new position_1.Position(this.start.getRow(), this.start.getCol() + this.str.length);
620
+ return new position_1.Position(this.getRow(), this.getCol() + this.str.length);
597
621
  }
598
622
  }
599
623
  exports.AbstractToken = AbstractToken;
@@ -11281,23 +11305,25 @@ class Result {
11281
11305
  return this.tokens[this.tokenIndex + offset];
11282
11306
  }
11283
11307
  shift(node) {
11284
- return Result.fromChain(this.tokens, this.tokenIndex + 1, { node, previous: this.nodes }, this.nodeCount + 1);
11308
+ return Result.fromChain(this.tokens, this.tokenIndex + 1, { node, tokenCount: 1, previous: this.nodes }, this.nodeCount + 1);
11285
11309
  }
11286
11310
  wrapConsumed(consumedTokens, node) {
11287
11311
  let current = this.nodes;
11288
11312
  let currentCount = this.nodeCount;
11313
+ let tokenCount = 0;
11289
11314
  const children = [];
11290
11315
  while (consumedTokens > 0) {
11291
11316
  if (current === undefined) {
11292
11317
  break;
11293
11318
  }
11294
11319
  children.push(current.node);
11295
- consumedTokens = consumedTokens - current.node.countTokens();
11320
+ consumedTokens = consumedTokens - current.tokenCount;
11321
+ tokenCount = tokenCount + current.tokenCount;
11296
11322
  current = current.previous;
11297
11323
  currentCount--;
11298
11324
  }
11299
11325
  node.setChildren(children.reverse());
11300
- this.nodes = { node, previous: current };
11326
+ this.nodes = { node, tokenCount, previous: current };
11301
11327
  this.nodeCount = currentCount + 1;
11302
11328
  return this;
11303
11329
  }
@@ -11326,7 +11352,7 @@ class Result {
11326
11352
  this.nodes = undefined;
11327
11353
  this.nodeCount = 0;
11328
11354
  for (const node of n) {
11329
- this.nodes = { node, previous: this.nodes };
11355
+ this.nodes = { node, tokenCount: node.countTokens(), previous: this.nodes };
11330
11356
  this.nodeCount++;
11331
11357
  }
11332
11358
  }
@@ -26213,7 +26239,7 @@ class CurrentScope {
26213
26239
  else if (this.isOO() && this.current.getData().vars[upper] !== undefined) {
26214
26240
  throw new Error(`"${name}" already defined`);
26215
26241
  }
26216
- this.current.getData().types[upper] = type;
26242
+ this.current.setType(upper, type);
26217
26243
  }
26218
26244
  addExtraLikeType(type) {
26219
26245
  if (type === undefined) {
@@ -26232,7 +26258,7 @@ class CurrentScope {
26232
26258
  if (this.current.getData().extraLikeTypes[upper] !== undefined) {
26233
26259
  throw new Error(`Type name "${name}" already defined`);
26234
26260
  }
26235
- this.current.getData().extraLikeTypes[upper] = type;
26261
+ this.current.setExtraLikeType(upper, type);
26236
26262
  }
26237
26263
  addClassDefinition(c) {
26238
26264
  if (this.current === undefined) {
@@ -26242,13 +26268,13 @@ class CurrentScope {
26242
26268
  if (this.current.getData().cdefs[name] !== undefined) {
26243
26269
  throw new Error(`Class "${name}" already defined`);
26244
26270
  }
26245
- this.current.getData().cdefs[name] = c;
26271
+ this.current.setClassDefinition(name, c);
26246
26272
  }
26247
26273
  addFormDefinitions(f) {
26248
26274
  if (this.current === undefined) {
26249
26275
  return;
26250
26276
  }
26251
- this.current.getData().forms.push(...f);
26277
+ this.current.addFormDefinitions(f);
26252
26278
  }
26253
26279
  /** The FORM definitions are built up front, at that point the program level types are not known.
26254
26280
  * When the FORM statement is traversed it is replaced with one resolved in the scope of the FORM */
@@ -26273,7 +26299,7 @@ class CurrentScope {
26273
26299
  if (this.current.getData().cdefs[name] !== undefined) {
26274
26300
  throw new Error(`Interface "${name}" already defined`);
26275
26301
  }
26276
- this.current.getData().idefs[name] = i;
26302
+ this.current.setInterfaceDefinition(name, i);
26277
26303
  }
26278
26304
  addNamedIdentifier(name, identifier) {
26279
26305
  if (this.current === undefined) {
@@ -26287,7 +26313,7 @@ class CurrentScope {
26287
26313
  else if (this.isOO() && this.current.getData().types[upper] !== undefined) {
26288
26314
  throw new Error(`"${name}" already defined`);
26289
26315
  }
26290
- this.current.getData().vars[upper] = identifier;
26316
+ this.current.setVariable(upper, identifier);
26291
26317
  }
26292
26318
  addNamedIdentifierToParent(name, identifier) {
26293
26319
  if (this.current === undefined) {
@@ -26305,7 +26331,7 @@ class CurrentScope {
26305
26331
  else if (this.isOO() && parent.getData().types[upper] !== undefined) {
26306
26332
  throw new Error(`"${name}" already defined`);
26307
26333
  }
26308
- parent.getData().vars[upper] = identifier;
26334
+ parent.setVariable(upper, identifier);
26309
26335
  }
26310
26336
  addIdentifier(identifier) {
26311
26337
  if (identifier === undefined) {
@@ -26317,7 +26343,7 @@ class CurrentScope {
26317
26343
  if (token === undefined) {
26318
26344
  return;
26319
26345
  }
26320
- this.current.getData().deferred[token.getStr().toUpperCase()] = { token, ooType: type };
26346
+ this.current.setDeferred(token.getStr().toUpperCase(), { token, ooType: type });
26321
26347
  }
26322
26348
  addListPrefix(identifiers, prefix) {
26323
26349
  for (const id of identifiers) {
@@ -26337,16 +26363,16 @@ class CurrentScope {
26337
26363
  const position = new _identifier_1.Identifier(usage, filename);
26338
26364
  if (Array.isArray(type)) {
26339
26365
  for (const t of type) {
26340
- (_a = this.current) === null || _a === void 0 ? void 0 : _a.getData().references.push({ position, resolved: referencing, referenceType: t, extra });
26366
+ (_a = this.current) === null || _a === void 0 ? void 0 : _a.addReference({ position, resolved: referencing, referenceType: t, extra });
26341
26367
  }
26342
26368
  }
26343
26369
  else {
26344
- (_b = this.current) === null || _b === void 0 ? void 0 : _b.getData().references.push({ position, resolved: referencing, referenceType: type, extra });
26370
+ (_b = this.current) === null || _b === void 0 ? void 0 : _b.addReference({ position, resolved: referencing, referenceType: type, extra });
26345
26371
  }
26346
26372
  }
26347
26373
  addSQLConversion(fieldName, message, token) {
26348
26374
  var _a;
26349
- (_a = this.current) === null || _a === void 0 ? void 0 : _a.getData().sqlConversion.push({ fieldName, message, token });
26375
+ (_a = this.current) === null || _a === void 0 ? void 0 : _a.addSQLConversion({ fieldName, message, token });
26350
26376
  }
26351
26377
  ///////////////////////////
26352
26378
  findFunctionModule(name) {
@@ -26382,6 +26408,9 @@ class CurrentScope {
26382
26408
  return undefined;
26383
26409
  }
26384
26410
  const name = (_a = this.parentObj.getClassDefinition()) === null || _a === void 0 ? void 0 : _a.behaviorDefinitionName;
26411
+ return this.findBehaviorDefinitionByName(name);
26412
+ }
26413
+ findBehaviorDefinitionByName(name) {
26385
26414
  if (name === undefined) {
26386
26415
  return undefined;
26387
26416
  }
@@ -26711,6 +26740,84 @@ exports.CurrentScope = CurrentScope;
26711
26740
 
26712
26741
  /***/ },
26713
26742
 
26743
+ /***/ "../core/build/src/abap/5_syntax/_eml.js"
26744
+ /*!***********************************************!*\
26745
+ !*** ../core/build/src/abap/5_syntax/_eml.js ***!
26746
+ \***********************************************/
26747
+ (__unused_webpack_module, exports, __webpack_require__) {
26748
+
26749
+ "use strict";
26750
+
26751
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
26752
+ if (k2 === undefined) k2 = k;
26753
+ var desc = Object.getOwnPropertyDescriptor(m, k);
26754
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
26755
+ desc = { enumerable: true, get: function() { return m[k]; } };
26756
+ }
26757
+ Object.defineProperty(o, k2, desc);
26758
+ }) : (function(o, m, k, k2) {
26759
+ if (k2 === undefined) k2 = k;
26760
+ o[k2] = m[k];
26761
+ }));
26762
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
26763
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26764
+ }) : function(o, v) {
26765
+ o["default"] = v;
26766
+ });
26767
+ var __importStar = (this && this.__importStar) || (function () {
26768
+ var ownKeys = function(o) {
26769
+ ownKeys = Object.getOwnPropertyNames || function (o) {
26770
+ var ar = [];
26771
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26772
+ return ar;
26773
+ };
26774
+ return ownKeys(o);
26775
+ };
26776
+ return function (mod) {
26777
+ if (mod && mod.__esModule) return mod;
26778
+ var result = {};
26779
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
26780
+ __setModuleDefault(result, mod);
26781
+ return result;
26782
+ };
26783
+ })();
26784
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
26785
+ exports.EML = void 0;
26786
+ const Expressions = __importStar(__webpack_require__(/*! ../2_statements/expressions */ "../core/build/src/abap/2_statements/expressions/index.js"));
26787
+ const _syntax_input_1 = __webpack_require__(/*! ./_syntax_input */ "../core/build/src/abap/5_syntax/_syntax_input.js");
26788
+ /** checks the entities referenced in EML statements, eg. READ ENTITIES and MODIFY ENTITIES */
26789
+ class EML {
26790
+ static checkEntities(node, input) {
26791
+ var _a;
26792
+ var _b;
26793
+ const nameNode = node.findDirectExpression(Expressions.NamespaceSimpleName);
26794
+ if (nameNode === undefined) {
26795
+ // eg. dynamic "MODIFY ENTITIES OPERATIONS" or "ENTITY zentity\_association"
26796
+ return;
26797
+ }
26798
+ const name = nameNode.concatTokens();
26799
+ const scope = input.scope;
26800
+ if (node.findDirectTokenByText("ENTITIES") !== undefined) {
26801
+ // "ENTITIES OF" refers to the behavior definition
26802
+ if (scope.findBehaviorDefinitionByName(name) === undefined && scope.getDDIC().inErrorNamespace(name)) {
26803
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, nameNode.getFirstToken(), `Behavior definition "${name}" not found`));
26804
+ }
26805
+ return;
26806
+ }
26807
+ // single "ENTITY", inside a behavior pool the alias defined in the BDEF can be used
26808
+ const entity = (_b = (_a = scope.findBehaviorDefinition()) === null || _a === void 0 ? void 0 : _a.findEntityNameByAlias(name)) !== null && _b !== void 0 ? _b : name;
26809
+ if (scope.getDDIC().inErrorNamespace(entity)
26810
+ && scope.findBehaviorDefinitionByName(entity) === undefined
26811
+ && scope.getDDIC().lookupDDLS(entity) === undefined) {
26812
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, nameNode.getFirstToken(), `Entity "${name}" not found`));
26813
+ }
26814
+ }
26815
+ }
26816
+ exports.EML = EML;
26817
+ //# sourceMappingURL=_eml.js.map
26818
+
26819
+ /***/ },
26820
+
26714
26821
  /***/ "../core/build/src/abap/5_syntax/_loop_table_change.js"
26715
26822
  /*!*************************************************************!*\
26716
26823
  !*** ../core/build/src/abap/5_syntax/_loop_table_change.js ***!
@@ -27081,6 +27188,16 @@ class ObjectOriented {
27081
27188
  }
27082
27189
  return `The special method "${name}" cannot be called directly`;
27083
27190
  }
27191
+ // classic exceptions cannot be raised in a method declaring class based exceptions, returns the message otherwise
27192
+ checkClassicException() {
27193
+ var _a;
27194
+ const methodName = this.scope.getEnclosingMethodName();
27195
+ const classDef = this.scope.findClassDefinition(this.scope.getEnclosingClassName());
27196
+ if (methodName && classDef && ((_a = this.searchMethodName(classDef, methodName).method) === null || _a === void 0 ? void 0 : _a.getRaising().length)) {
27197
+ return "Classic exceptions cannot be raised in methods with class based exceptions";
27198
+ }
27199
+ return undefined;
27200
+ }
27084
27201
  // SUPER-> can only call the previous implementation of the method it is used in, returns the message otherwise
27085
27202
  // both names are resolved in the super class, so an alias and the method it stands for are the same
27086
27203
  checkSuperCall(superDef, methodName) {
@@ -37690,23 +37807,81 @@ const _typed_identifier_1 = __webpack_require__(/*! ../types/_typed_identifier *
37690
37807
  const _identifier_1 = __webpack_require__(/*! ../4_file_information/_identifier */ "../core/build/src/abap/4_file_information/_identifier.js");
37691
37808
  const _reference_1 = __webpack_require__(/*! ./_reference */ "../core/build/src/abap/5_syntax/_reference.js");
37692
37809
  const assert_error_1 = __webpack_require__(/*! ./assert_error */ "../core/build/src/abap/5_syntax/assert_error.js");
37810
+ // most scopes only use a few of the containers, empty ones are shared and replaced on first write
37811
+ const EMPTY_OBJECT = Object.freeze({});
37812
+ const EMPTY_ARRAY = Object.freeze([]);
37693
37813
  class ScopeData {
37694
37814
  constructor() {
37695
37815
  this.data = {
37696
- vars: {},
37697
- cdefs: {},
37698
- idefs: {},
37699
- forms: [], // todo, refactor to object
37700
- types: {},
37701
- extraLikeTypes: {},
37702
- deferred: {},
37703
- references: [],
37704
- sqlConversion: [],
37816
+ vars: EMPTY_OBJECT,
37817
+ cdefs: EMPTY_OBJECT,
37818
+ idefs: EMPTY_OBJECT,
37819
+ forms: EMPTY_ARRAY, // todo, refactor to object
37820
+ types: EMPTY_OBJECT,
37821
+ extraLikeTypes: EMPTY_OBJECT,
37822
+ deferred: EMPTY_OBJECT,
37823
+ references: EMPTY_ARRAY,
37824
+ sqlConversion: EMPTY_ARRAY,
37705
37825
  };
37706
37826
  }
37707
37827
  getData() {
37708
37828
  return this.data;
37709
37829
  }
37830
+ // the shared empty containers are frozen, the methods below replace them on first write
37831
+ setVariable(name, identifier) {
37832
+ if (this.data.vars === EMPTY_OBJECT) {
37833
+ this.data.vars = {};
37834
+ }
37835
+ this.data.vars[name] = identifier;
37836
+ }
37837
+ setType(name, type) {
37838
+ if (this.data.types === EMPTY_OBJECT) {
37839
+ this.data.types = {};
37840
+ }
37841
+ this.data.types[name] = type;
37842
+ }
37843
+ setExtraLikeType(name, type) {
37844
+ if (this.data.extraLikeTypes === EMPTY_OBJECT) {
37845
+ this.data.extraLikeTypes = {};
37846
+ }
37847
+ this.data.extraLikeTypes[name] = type;
37848
+ }
37849
+ setDeferred(name, deferred) {
37850
+ if (this.data.deferred === EMPTY_OBJECT) {
37851
+ this.data.deferred = {};
37852
+ }
37853
+ this.data.deferred[name] = deferred;
37854
+ }
37855
+ setClassDefinition(name, cdef) {
37856
+ if (this.data.cdefs === EMPTY_OBJECT) {
37857
+ this.data.cdefs = {};
37858
+ }
37859
+ this.data.cdefs[name] = cdef;
37860
+ }
37861
+ setInterfaceDefinition(name, idef) {
37862
+ if (this.data.idefs === EMPTY_OBJECT) {
37863
+ this.data.idefs = {};
37864
+ }
37865
+ this.data.idefs[name] = idef;
37866
+ }
37867
+ addFormDefinitions(forms) {
37868
+ if (this.data.forms === EMPTY_ARRAY) {
37869
+ this.data.forms = [];
37870
+ }
37871
+ this.data.forms.push(...forms);
37872
+ }
37873
+ addReference(reference) {
37874
+ if (this.data.references === EMPTY_ARRAY) {
37875
+ this.data.references = [];
37876
+ }
37877
+ this.data.references.push(reference);
37878
+ }
37879
+ addSQLConversion(conversion) {
37880
+ if (this.data.sqlConversion === EMPTY_ARRAY) {
37881
+ this.data.sqlConversion = [];
37882
+ }
37883
+ this.data.sqlConversion.push(conversion);
37884
+ }
37710
37885
  }
37711
37886
  class SpaghettiScopeNode extends ScopeData {
37712
37887
  [Symbol.for("debug.description")]() {
@@ -43911,8 +44086,16 @@ const basic_1 = __webpack_require__(/*! ../../types/basic */ "../core/build/src/
43911
44086
  const source_1 = __webpack_require__(/*! ../expressions/source */ "../core/build/src/abap/5_syntax/expressions/source.js");
43912
44087
  const target_1 = __webpack_require__(/*! ../expressions/target */ "../core/build/src/abap/5_syntax/expressions/target.js");
43913
44088
  const message_source_1 = __webpack_require__(/*! ../expressions/message_source */ "../core/build/src/abap/5_syntax/expressions/message_source.js");
44089
+ const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "../core/build/src/abap/5_syntax/_syntax_input.js");
44090
+ const _object_oriented_1 = __webpack_require__(/*! ../_object_oriented */ "../core/build/src/abap/5_syntax/_object_oriented.js");
43914
44091
  class Message {
43915
44092
  runSyntax(node, input) {
44093
+ const exceptionName = node.findDirectExpression(Expressions.ExceptionName);
44094
+ const classicMessage = exceptionName ? new _object_oriented_1.ObjectOriented(input.scope).checkClassicException() : undefined;
44095
+ if (exceptionName && classicMessage) {
44096
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, exceptionName.getFirstToken(), classicMessage));
44097
+ return;
44098
+ }
43916
44099
  const found = node.findExpressionAfterToken("INTO");
43917
44100
  const inline = found === null || found === void 0 ? void 0 : found.findDirectExpression(Expressions.InlineData);
43918
44101
  if (inline) {
@@ -44178,8 +44361,10 @@ const source_1 = __webpack_require__(/*! ../expressions/source */ "../core/build
44178
44361
  const target_1 = __webpack_require__(/*! ../expressions/target */ "../core/build/src/abap/5_syntax/expressions/target.js");
44179
44362
  const inline_data_1 = __webpack_require__(/*! ../expressions/inline_data */ "../core/build/src/abap/5_syntax/expressions/inline_data.js");
44180
44363
  const basic_1 = __webpack_require__(/*! ../../types/basic */ "../core/build/src/abap/types/basic/index.js");
44364
+ const _eml_1 = __webpack_require__(/*! ../_eml */ "../core/build/src/abap/5_syntax/_eml.js");
44181
44365
  class ModifyEntities {
44182
44366
  runSyntax(node, input) {
44367
+ _eml_1.EML.checkEntities(node, input);
44183
44368
  for (const s of node.findDirectExpressions(Expressions.Source)) {
44184
44369
  source_1.Source.runSyntax(s, input);
44185
44370
  }
@@ -45155,6 +45340,12 @@ class Raise {
45155
45340
  var _a, _b, _c, _d, _e, _f;
45156
45341
  const helper = new _object_oriented_1.ObjectOriented(input.scope);
45157
45342
  let method;
45343
+ const exceptionName = node.findDirectExpression(Expressions.ExceptionName);
45344
+ const classicMessage = exceptionName ? helper.checkClassicException() : undefined;
45345
+ if (exceptionName && classicMessage) {
45346
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, exceptionName.getFirstToken(), classicMessage));
45347
+ return;
45348
+ }
45158
45349
  const classTok = (_a = node.findDirectExpression(Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
45159
45350
  const className = classTok === null || classTok === void 0 ? void 0 : classTok.getStr();
45160
45351
  if (classTok && className) {
@@ -45489,8 +45680,10 @@ const source_1 = __webpack_require__(/*! ../expressions/source */ "../core/build
45489
45680
  const target_1 = __webpack_require__(/*! ../expressions/target */ "../core/build/src/abap/5_syntax/expressions/target.js");
45490
45681
  const inline_data_1 = __webpack_require__(/*! ../expressions/inline_data */ "../core/build/src/abap/5_syntax/expressions/inline_data.js");
45491
45682
  const basic_1 = __webpack_require__(/*! ../../types/basic */ "../core/build/src/abap/types/basic/index.js");
45683
+ const _eml_1 = __webpack_require__(/*! ../_eml */ "../core/build/src/abap/5_syntax/_eml.js");
45492
45684
  class ReadEntities {
45493
45685
  runSyntax(node, input) {
45686
+ _eml_1.EML.checkEntities(node, input);
45494
45687
  for (const s of node.findDirectExpressions(Expressions.Source)) {
45495
45688
  source_1.Source.runSyntax(s, input);
45496
45689
  }
@@ -50643,7 +50836,6 @@ const _abstract_node_1 = __webpack_require__(/*! ./_abstract_node */ "../core/bu
50643
50836
  class ExpressionNode extends _abstract_node_1.AbstractNode {
50644
50837
  constructor(expression) {
50645
50838
  super();
50646
- this.tokenCount = 0;
50647
50839
  this.expression = expression;
50648
50840
  }
50649
50841
  addChild(_n) {
@@ -50654,13 +50846,15 @@ class ExpressionNode extends _abstract_node_1.AbstractNode {
50654
50846
  }
50655
50847
  setChildren(children) {
50656
50848
  super.setChildren(children);
50657
- for (const child of this.getChildren()) {
50658
- this.tokenCount = this.tokenCount + child.countTokens();
50659
- }
50660
50849
  return this;
50661
50850
  }
50851
+ // not stored on the node, saves a field per ExpressionNode, the statement parser tracks counts itself
50662
50852
  countTokens() {
50663
- return this.tokenCount;
50853
+ let count = 0;
50854
+ for (const child of this.getChildren()) {
50855
+ count = count + child.countTokens();
50856
+ }
50857
+ return count;
50664
50858
  }
50665
50859
  getFirstToken() {
50666
50860
  for (const child of this.getChildren()) {
@@ -55592,6 +55786,874 @@ exports.ArtifactsRules = ArtifactsRules;
55592
55786
 
55593
55787
  /***/ },
55594
55788
 
55789
+ /***/ "../core/build/src/bdef/bdef_parser.js"
55790
+ /*!*********************************************!*\
55791
+ !*** ../core/build/src/bdef/bdef_parser.js ***!
55792
+ \*********************************************/
55793
+ (__unused_webpack_module, exports, __webpack_require__) {
55794
+
55795
+ "use strict";
55796
+
55797
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
55798
+ if (k2 === undefined) k2 = k;
55799
+ var desc = Object.getOwnPropertyDescriptor(m, k);
55800
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
55801
+ desc = { enumerable: true, get: function() { return m[k]; } };
55802
+ }
55803
+ Object.defineProperty(o, k2, desc);
55804
+ }) : (function(o, m, k, k2) {
55805
+ if (k2 === undefined) k2 = k;
55806
+ o[k2] = m[k];
55807
+ }));
55808
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
55809
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
55810
+ }) : function(o, v) {
55811
+ o["default"] = v;
55812
+ });
55813
+ var __importStar = (this && this.__importStar) || (function () {
55814
+ var ownKeys = function(o) {
55815
+ ownKeys = Object.getOwnPropertyNames || function (o) {
55816
+ var ar = [];
55817
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
55818
+ return ar;
55819
+ };
55820
+ return ownKeys(o);
55821
+ };
55822
+ return function (mod) {
55823
+ if (mod && mod.__esModule) return mod;
55824
+ var result = {};
55825
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
55826
+ __setModuleDefault(result, mod);
55827
+ return result;
55828
+ };
55829
+ })();
55830
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
55831
+ exports.BDEFParser = void 0;
55832
+ const tokens_1 = __webpack_require__(/*! ../abap/1_lexer/tokens */ "../core/build/src/abap/1_lexer/tokens/index.js");
55833
+ const combi_1 = __webpack_require__(/*! ../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
55834
+ const nodes_1 = __webpack_require__(/*! ../abap/nodes */ "../core/build/src/abap/nodes/index.js");
55835
+ const cds_lexer_1 = __webpack_require__(/*! ../cds/cds_lexer */ "../core/build/src/cds/cds_lexer.js");
55836
+ const version_1 = __webpack_require__(/*! ../version */ "../core/build/src/version.js");
55837
+ const Expressions = __importStar(__webpack_require__(/*! ./expressions */ "../core/build/src/bdef/expressions/index.js"));
55838
+ class BDEFParser {
55839
+ parse(file) {
55840
+ if (file === undefined) {
55841
+ return undefined;
55842
+ }
55843
+ // BDEF has the same comments, strings and delimiters as CDS
55844
+ const tokens = this.removePragmas(cds_lexer_1.CDSLexer.run(file).filter(t => !(t instanceof tokens_1.Comment)));
55845
+ const res = combi_1.Combi.run(new Expressions.BDEFDefinition(), tokens, version_1.defaultRelease);
55846
+ if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {
55847
+ return undefined;
55848
+ }
55849
+ return res[0];
55850
+ }
55851
+ /** pragmas can occur in many places, eg. "##NOT_ASSIGNED_TO_DETACT" or "##UNMAPPED_FIELD[SingletonID]" */
55852
+ removePragmas(tokens) {
55853
+ var _a;
55854
+ const ret = [];
55855
+ for (let i = 0; i < tokens.length; i++) {
55856
+ if (tokens[i].getStr().startsWith("##") === false) {
55857
+ ret.push(tokens[i]);
55858
+ continue;
55859
+ }
55860
+ if (((_a = tokens[i + 1]) === null || _a === void 0 ? void 0 : _a.getStr()) === "[") {
55861
+ while (i < tokens.length - 1 && tokens[i].getStr() !== "]") {
55862
+ i++;
55863
+ }
55864
+ }
55865
+ }
55866
+ return ret;
55867
+ }
55868
+ }
55869
+ exports.BDEFParser = BDEFParser;
55870
+ //# sourceMappingURL=bdef_parser.js.map
55871
+
55872
+ /***/ },
55873
+
55874
+ /***/ "../core/build/src/bdef/expressions/bdef_action.js"
55875
+ /*!*********************************************************!*\
55876
+ !*** ../core/build/src/bdef/expressions/bdef_action.js ***!
55877
+ \*********************************************************/
55878
+ (__unused_webpack_module, exports, __webpack_require__) {
55879
+
55880
+ "use strict";
55881
+
55882
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
55883
+ exports.BDEFAction = void 0;
55884
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/bdef/expressions/index.js");
55885
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
55886
+ /** actions and functions, eg. "static factory action ( features : global ) copy parameter ZPARAM result [1] $self;" */
55887
+ class BDEFAction extends combi_1.Expression {
55888
+ getRunnable() {
55889
+ const modifier = (0, combi_1.altPrio)("INTERNAL", "STATIC", "FACTORY", "DEFAULT", "DRAFT", "REPEATABLE", "RECOMMENDATION", (0, combi_1.seq)("SAVE", (0, combi_1.optPrio)(_1.BDEFOptions)), (0, combi_1.seq)("KEY", _1.BDEFOptions));
55890
+ const tail = (0, combi_1.altPrio)((0, combi_1.seq)("EXTERNAL", _1.BDEFString), (0, combi_1.seq)("AS", _1.BDEFName), _1.BDEFParameter, _1.BDEFResult, _1.BDEFCardinality, "OPTIMIZED", "EXTENSIBLE", "WITH ADDITIONAL IMPLEMENTATION");
55891
+ return (0, combi_1.seq)((0, combi_1.starPrio)(modifier), (0, combi_1.altPrio)("ACTION", "FUNCTION"), (0, combi_1.optPrio)(_1.BDEFOptions), _1.BDEFName, (0, combi_1.starPrio)(tail), (0, combi_1.altPrio)(";", _1.BDEFDefaultFunction));
55892
+ }
55893
+ }
55894
+ exports.BDEFAction = BDEFAction;
55895
+ //# sourceMappingURL=bdef_action.js.map
55896
+
55897
+ /***/ },
55898
+
55899
+ /***/ "../core/build/src/bdef/expressions/bdef_alias.js"
55900
+ /*!********************************************************!*\
55901
+ !*** ../core/build/src/bdef/expressions/bdef_alias.js ***!
55902
+ \********************************************************/
55903
+ (__unused_webpack_module, exports, __webpack_require__) {
55904
+
55905
+ "use strict";
55906
+
55907
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
55908
+ exports.BDEFAlias = void 0;
55909
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/bdef/expressions/index.js");
55910
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
55911
+ class BDEFAlias extends combi_1.Expression {
55912
+ getRunnable() {
55913
+ return (0, combi_1.seq)("ALIAS", _1.BDEFName);
55914
+ }
55915
+ }
55916
+ exports.BDEFAlias = BDEFAlias;
55917
+ //# sourceMappingURL=bdef_alias.js.map
55918
+
55919
+ /***/ },
55920
+
55921
+ /***/ "../core/build/src/bdef/expressions/bdef_association.js"
55922
+ /*!**************************************************************!*\
55923
+ !*** ../core/build/src/bdef/expressions/bdef_association.js ***!
55924
+ \**************************************************************/
55925
+ (__unused_webpack_module, exports, __webpack_require__) {
55926
+
55927
+ "use strict";
55928
+
55929
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
55930
+ exports.BDEFAssociation = void 0;
55931
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/bdef/expressions/index.js");
55932
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
55933
+ /** eg. "association _Booking { create; with draft; }" */
55934
+ class BDEFAssociation extends combi_1.Expression {
55935
+ getRunnable() {
55936
+ // cross BO association, eg. "using /DMO/R_TRAVELTP_XBO \_Agency"
55937
+ const using = (0, combi_1.seq)("USING", _1.BDEFName, (0, combi_1.optPrio)((0, combi_1.regex)(/^\\\w+$/)));
55938
+ return (0, combi_1.seq)((0, combi_1.starPrio)((0, combi_1.altPrio)("INTERNAL", "UNMANAGED", "ANCESTOR")), "ASSOCIATION", (0, combi_1.optPrio)(_1.BDEFOptions), _1.BDEFName, (0, combi_1.optPrio)(using), (0, combi_1.optPrio)((0, combi_1.seq)("ABBREVIATION", _1.BDEFName)), (0, combi_1.optPrio)("WITH HIERARCHY"), (0, combi_1.altPrio)(";", _1.BDEFAssociationBody));
55939
+ }
55940
+ }
55941
+ exports.BDEFAssociation = BDEFAssociation;
55942
+ //# sourceMappingURL=bdef_association.js.map
55943
+
55944
+ /***/ },
55945
+
55946
+ /***/ "../core/build/src/bdef/expressions/bdef_association_body.js"
55947
+ /*!*******************************************************************!*\
55948
+ !*** ../core/build/src/bdef/expressions/bdef_association_body.js ***!
55949
+ \*******************************************************************/
55950
+ (__unused_webpack_module, exports, __webpack_require__) {
55951
+
55952
+ "use strict";
55953
+
55954
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
55955
+ exports.BDEFAssociationBody = void 0;
55956
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/bdef/expressions/index.js");
55957
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
55958
+ /** eg. "{ create ( features : instance ); with draft; link action linkManager; }" */
55959
+ class BDEFAssociationBody extends combi_1.Expression {
55960
+ getRunnable() {
55961
+ const create = (0, combi_1.seq)((0, combi_1.optPrio)("INTERNAL"), "CREATE", (0, combi_1.optPrio)(_1.BDEFOptions), (0, combi_1.altPrio)(";", _1.BDEFDefaultFunction));
55962
+ const withh = (0, combi_1.seq)("WITH", (0, combi_1.altPrio)("DRAFT", "DEPENDENT DRAFT", "CASCADING DELETE"), ";");
55963
+ const link = (0, combi_1.seq)((0, combi_1.altPrio)("LINK", "UNLINK"), "ACTION", _1.BDEFName, ";");
55964
+ const inverse = (0, combi_1.seq)("INVERSE FUNCTION", _1.BDEFName, ";");
55965
+ const item = (0, combi_1.altPrio)(create, withh, link, inverse, ";");
55966
+ return (0, combi_1.seq)("{", (0, combi_1.starPrio)(item), "}");
55967
+ }
55968
+ }
55969
+ exports.BDEFAssociationBody = BDEFAssociationBody;
55970
+ //# sourceMappingURL=bdef_association_body.js.map
55971
+
55972
+ /***/ },
55973
+
55974
+ /***/ "../core/build/src/bdef/expressions/bdef_authorization_context.js"
55975
+ /*!************************************************************************!*\
55976
+ !*** ../core/build/src/bdef/expressions/bdef_authorization_context.js ***!
55977
+ \************************************************************************/
55978
+ (__unused_webpack_module, exports, __webpack_require__) {
55979
+
55980
+ "use strict";
55981
+
55982
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
55983
+ exports.BDEFAuthorizationContext = void 0;
55984
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/bdef/expressions/index.js");
55985
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
55986
+ /** eg. "define own authorization context { 'S_TABU_NAM'; }" or "define own authorization context by privileged mode;" */
55987
+ class BDEFAuthorizationContext extends combi_1.Expression {
55988
+ getRunnable() {
55989
+ const item = (0, combi_1.seq)((0, combi_1.altPrio)(_1.BDEFString, _1.BDEFName), ";");
55990
+ const body = (0, combi_1.seq)("{", (0, combi_1.starPrio)(item), "}", (0, combi_1.optPrio)(";"));
55991
+ const privileged = (0, combi_1.seq)("BY PRIVILEGED MODE", (0, combi_1.optPrio)("AND"));
55992
+ return (0, combi_1.seq)("DEFINE", (0, combi_1.optPrio)("OWN"), "AUTHORIZATION CONTEXT", (0, combi_1.optPrio)((0, combi_1.altPrio)(privileged, _1.BDEFName)), (0, combi_1.optPrio)((0, combi_1.seq)("FOR DISABLE", _1.BDEFOptions)), (0, combi_1.altPrio)(";", body));
55993
+ }
55994
+ }
55995
+ exports.BDEFAuthorizationContext = BDEFAuthorizationContext;
55996
+ //# sourceMappingURL=bdef_authorization_context.js.map
55997
+
55998
+ /***/ },
55999
+
56000
+ /***/ "../core/build/src/bdef/expressions/bdef_cardinality.js"
56001
+ /*!**************************************************************!*\
56002
+ !*** ../core/build/src/bdef/expressions/bdef_cardinality.js ***!
56003
+ \**************************************************************/
56004
+ (__unused_webpack_module, exports, __webpack_require__) {
56005
+
56006
+ "use strict";
56007
+
56008
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
56009
+ exports.BDEFCardinality = void 0;
56010
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
56011
+ /** eg. "[1]" or "[0..*]" */
56012
+ class BDEFCardinality extends combi_1.Expression {
56013
+ getRunnable() {
56014
+ const integer = (0, combi_1.regex)(/^\d+$/);
56015
+ return (0, combi_1.seq)("[", integer, (0, combi_1.optPrio)((0, combi_1.seq)(".", ".", (0, combi_1.altPrio)(integer, "*"))), "]");
56016
+ }
56017
+ }
56018
+ exports.BDEFCardinality = BDEFCardinality;
56019
+ //# sourceMappingURL=bdef_cardinality.js.map
56020
+
56021
+ /***/ },
56022
+
56023
+ /***/ "../core/build/src/bdef/expressions/bdef_default_function.js"
56024
+ /*!*******************************************************************!*\
56025
+ !*** ../core/build/src/bdef/expressions/bdef_default_function.js ***!
56026
+ \*******************************************************************/
56027
+ (__unused_webpack_module, exports, __webpack_require__) {
56028
+
56029
+ "use strict";
56030
+
56031
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
56032
+ exports.BDEFDefaultFunction = void 0;
56033
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/bdef/expressions/index.js");
56034
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
56035
+ /** eg. "{ default function GetDefaultsForCreate; }" */
56036
+ class BDEFDefaultFunction extends combi_1.Expression {
56037
+ getRunnable() {
56038
+ const func = (0, combi_1.seq)("DEFAULT FUNCTION", (0, combi_1.optPrio)((0, combi_1.seq)(_1.BDEFName, (0, combi_1.optPrio)((0, combi_1.seq)("EXTERNAL", _1.BDEFString)))), ";");
56039
+ return (0, combi_1.seq)("{", (0, combi_1.plusPrio)(func), "}");
56040
+ }
56041
+ }
56042
+ exports.BDEFDefaultFunction = BDEFDefaultFunction;
56043
+ //# sourceMappingURL=bdef_default_function.js.map
56044
+
56045
+ /***/ },
56046
+
56047
+ /***/ "../core/build/src/bdef/expressions/bdef_define_behavior.js"
56048
+ /*!******************************************************************!*\
56049
+ !*** ../core/build/src/bdef/expressions/bdef_define_behavior.js ***!
56050
+ \******************************************************************/
56051
+ (__unused_webpack_module, exports, __webpack_require__) {
56052
+
56053
+ "use strict";
56054
+
56055
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
56056
+ exports.BDEFDefineBehavior = void 0;
56057
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/bdef/expressions/index.js");
56058
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
56059
+ /** behavior of one entity, "define behavior for ZI_Travel alias Travel ... { ... }" */
56060
+ class BDEFDefineBehavior extends combi_1.Expression {
56061
+ getRunnable() {
56062
+ const fieldMapping = (0, combi_1.seq)(_1.BDEFName, "=", _1.BDEFName);
56063
+ const lockMapping = (0, combi_1.seq)("(", fieldMapping, (0, combi_1.starPrio)((0, combi_1.seq)(",", fieldMapping)), ")");
56064
+ const dependentBy = (0, combi_1.seq)("DEPENDENT", (0, combi_1.optPrio)((0, combi_1.seq)("BY", _1.BDEFName)));
56065
+ const save = (0, combi_1.seq)((0, combi_1.altPrio)("WITH ADDITIONAL SAVE", "WITH UNMANAGED SAVE"), (0, combi_1.optPrio)("AND CLEANUP"), (0, combi_1.optPrio)("WITH FULL DATA"));
56066
+ const option = (0, combi_1.altPrio)(_1.BDEFAlias, _1.BDEFImplementationIn, (0, combi_1.seq)("EXTERNAL", _1.BDEFString), (0, combi_1.seq)("PERSISTENT TABLE", _1.BDEFName), (0, combi_1.seq)("DRAFT TABLE", _1.BDEFName), (0, combi_1.seq)("QUERY", _1.BDEFName), (0, combi_1.seq)("LOCK", (0, combi_1.altPrio)((0, combi_1.seq)("MASTER", (0, combi_1.optPrio)("UNMANAGED")), (0, combi_1.seq)(dependentBy, (0, combi_1.optPrio)(lockMapping)))), (0, combi_1.seq)("AUTHORIZATION", (0, combi_1.altPrio)((0, combi_1.seq)("MASTER", _1.BDEFOptions), dependentBy)), (0, combi_1.seq)((0, combi_1.optPrio)("TOTAL"), "ETAG", (0, combi_1.altPrio)((0, combi_1.seq)("MASTER", _1.BDEFName), dependentBy, _1.BDEFName)),
56067
+ // eg. "( lock, authorization, etag ) dependent by _Travel"
56068
+ (0, combi_1.seq)(_1.BDEFOptions, dependentBy), (0, combi_1.seq)((0, combi_1.altPrio)("LATE", "EARLY"), "NUMBERING", (0, combi_1.optPrio)("IN PLACE")), save, "WITH CONTROL", "USE ETAG", (0, combi_1.seq)("USING", _1.BDEFName), (0, combi_1.seq)("CHANGEDOCUMENTS", (0, combi_1.altPrio)((0, combi_1.seq)("MASTER", (0, combi_1.optPrio)("UTC"), (0, combi_1.optPrio)(_1.BDEFOptions)), dependentBy)), "EXTENSIBLE");
56069
+ const item = (0, combi_1.altPrio)(_1.BDEFUse, _1.BDEFDetermineAction, _1.BDEFOperation, _1.BDEFAction, _1.BDEFDetermination, _1.BDEFField, _1.BDEFAssociation, _1.BDEFMapping, _1.BDEFSideEffects, _1.BDEFEvent, _1.BDEFHierarchy, _1.BDEFKey, (0, combi_1.seq)("CHANGEDOCUMENTS", _1.BDEFOptions, ";"), ";");
56070
+ return (0, combi_1.seq)((0, combi_1.altPrio)((0, combi_1.seq)("DEFINE", (0, combi_1.optPrio)("ROOT"), "BEHAVIOR FOR"), "EXTEND BEHAVIOR FOR"), _1.BDEFName, (0, combi_1.starPrio)(option), "{", (0, combi_1.starPrio)(item), "}", (0, combi_1.optPrio)(";"));
56071
+ }
56072
+ }
56073
+ exports.BDEFDefineBehavior = BDEFDefineBehavior;
56074
+ //# sourceMappingURL=bdef_define_behavior.js.map
56075
+
56076
+ /***/ },
56077
+
56078
+ /***/ "../core/build/src/bdef/expressions/bdef_definition.js"
56079
+ /*!*************************************************************!*\
56080
+ !*** ../core/build/src/bdef/expressions/bdef_definition.js ***!
56081
+ \*************************************************************/
56082
+ (__unused_webpack_module, exports, __webpack_require__) {
56083
+
56084
+ "use strict";
56085
+
56086
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
56087
+ exports.BDEFDefinition = void 0;
56088
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/bdef/expressions/index.js");
56089
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
56090
+ class BDEFDefinition extends combi_1.Expression {
56091
+ getRunnable() {
56092
+ return (0, combi_1.seq)(_1.BDEFImplementationType, (0, combi_1.starPrio)((0, combi_1.altPrio)(_1.BDEFHeader, _1.BDEFDefineBehavior, _1.BDEFAuthorizationContext)));
56093
+ }
56094
+ }
56095
+ exports.BDEFDefinition = BDEFDefinition;
56096
+ //# sourceMappingURL=bdef_definition.js.map
56097
+
56098
+ /***/ },
56099
+
56100
+ /***/ "../core/build/src/bdef/expressions/bdef_determination.js"
56101
+ /*!****************************************************************!*\
56102
+ !*** ../core/build/src/bdef/expressions/bdef_determination.js ***!
56103
+ \****************************************************************/
56104
+ (__unused_webpack_module, exports, __webpack_require__) {
56105
+
56106
+ "use strict";
56107
+
56108
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
56109
+ exports.BDEFDetermination = void 0;
56110
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/bdef/expressions/index.js");
56111
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
56112
+ /** determinations and validations, eg. "validation validateDates on save { create; field BeginDate, EndDate; }" */
56113
+ class BDEFDetermination extends combi_1.Expression {
56114
+ getRunnable() {
56115
+ const fields = (0, combi_1.seq)(_1.BDEFFieldPath, (0, combi_1.starPrio)((0, combi_1.seq)(",", _1.BDEFFieldPath)));
56116
+ const trigger = (0, combi_1.altPrio)((0, combi_1.seq)((0, combi_1.altPrio)("CREATE", "UPDATE", "DELETE"), ";"), (0, combi_1.seq)("FIELD", fields, ";"), (0, combi_1.seq)("ENTITY", fields, ";"), ";");
56117
+ return (0, combi_1.seq)((0, combi_1.altPrio)("DETERMINATION", "VALIDATION"), (0, combi_1.optPrio)(_1.BDEFOptions), _1.BDEFName, "ON", (0, combi_1.altPrio)("MODIFY", "SAVE"), "{", (0, combi_1.starPrio)(trigger), "}");
56118
+ }
56119
+ }
56120
+ exports.BDEFDetermination = BDEFDetermination;
56121
+ //# sourceMappingURL=bdef_determination.js.map
56122
+
56123
+ /***/ },
56124
+
56125
+ /***/ "../core/build/src/bdef/expressions/bdef_determine_action.js"
56126
+ /*!*******************************************************************!*\
56127
+ !*** ../core/build/src/bdef/expressions/bdef_determine_action.js ***!
56128
+ \*******************************************************************/
56129
+ (__unused_webpack_module, exports, __webpack_require__) {
56130
+
56131
+ "use strict";
56132
+
56133
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
56134
+ exports.BDEFDetermineAction = void 0;
56135
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/bdef/expressions/index.js");
56136
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
56137
+ /** eg. "draft determine action Prepare { validation validateDate; determination ( always ) Child ~ setStatus; }" */
56138
+ class BDEFDetermineAction extends combi_1.Expression {
56139
+ getRunnable() {
56140
+ const item = (0, combi_1.seq)((0, combi_1.altPrio)("VALIDATION", "DETERMINATION"), (0, combi_1.optPrio)(_1.BDEFOptions), _1.BDEFReference, ";");
56141
+ const body = (0, combi_1.seq)("{", (0, combi_1.starPrio)(item), "}");
56142
+ return (0, combi_1.seq)((0, combi_1.optPrio)("EXTEND"), (0, combi_1.optPrio)("DRAFT"), "DETERMINE ACTION", (0, combi_1.optPrio)(_1.BDEFOptions), _1.BDEFName, (0, combi_1.optPrio)("EXTENSIBLE"), (0, combi_1.altPrio)(";", body));
56143
+ }
56144
+ }
56145
+ exports.BDEFDetermineAction = BDEFDetermineAction;
56146
+ //# sourceMappingURL=bdef_determine_action.js.map
56147
+
56148
+ /***/ },
56149
+
56150
+ /***/ "../core/build/src/bdef/expressions/bdef_event.js"
56151
+ /*!********************************************************!*\
56152
+ !*** ../core/build/src/bdef/expressions/bdef_event.js ***!
56153
+ \********************************************************/
56154
+ (__unused_webpack_module, exports, __webpack_require__) {
56155
+
56156
+ "use strict";
56157
+
56158
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
56159
+ exports.BDEFEvent = void 0;
56160
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/bdef/expressions/index.js");
56161
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
56162
+ /** eg. "event TravelCreated parameter ZD_TRAVEL_EVENT;" or "event StatusUpdated for side effects;" */
56163
+ class BDEFEvent extends combi_1.Expression {
56164
+ getRunnable() {
56165
+ const tail = (0, combi_1.altPrio)((0, combi_1.seq)("ON", _1.BDEFName), _1.BDEFParameter, "FOR SIDE EFFECTS", (0, combi_1.seq)("DESCRIPTION", _1.BDEFString), (0, combi_1.seq)("CATEGORY", _1.BDEFName));
56166
+ return (0, combi_1.seq)((0, combi_1.optPrio)("MANAGED"), "EVENT", _1.BDEFName, (0, combi_1.starPrio)(tail), ";");
56167
+ }
56168
+ }
56169
+ exports.BDEFEvent = BDEFEvent;
56170
+ //# sourceMappingURL=bdef_event.js.map
56171
+
56172
+ /***/ },
56173
+
56174
+ /***/ "../core/build/src/bdef/expressions/bdef_field.js"
56175
+ /*!********************************************************!*\
56176
+ !*** ../core/build/src/bdef/expressions/bdef_field.js ***!
56177
+ \********************************************************/
56178
+ (__unused_webpack_module, exports, __webpack_require__) {
56179
+
56180
+ "use strict";
56181
+
56182
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
56183
+ exports.BDEFField = void 0;
56184
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/bdef/expressions/index.js");
56185
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
56186
+ /** field characteristics, eg. "field ( readonly, numbering : managed ) ID, CreatedBy;" */
56187
+ class BDEFField extends combi_1.Expression {
56188
+ getRunnable() {
56189
+ return (0, combi_1.seq)("FIELD", _1.BDEFOptions, _1.BDEFFieldPath, (0, combi_1.starPrio)((0, combi_1.seq)(",", _1.BDEFFieldPath)), (0, combi_1.optPrio)(","), ";");
56190
+ }
56191
+ }
56192
+ exports.BDEFField = BDEFField;
56193
+ //# sourceMappingURL=bdef_field.js.map
56194
+
56195
+ /***/ },
56196
+
56197
+ /***/ "../core/build/src/bdef/expressions/bdef_field_path.js"
56198
+ /*!*************************************************************!*\
56199
+ !*** ../core/build/src/bdef/expressions/bdef_field_path.js ***!
56200
+ \*************************************************************/
56201
+ (__unused_webpack_module, exports, __webpack_require__) {
56202
+
56203
+ "use strict";
56204
+
56205
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
56206
+ exports.BDEFFieldPath = void 0;
56207
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/bdef/expressions/index.js");
56208
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
56209
+ /** field or association, possibly via associations, eg. "_Root.TotalPieces" */
56210
+ class BDEFFieldPath extends combi_1.Expression {
56211
+ getRunnable() {
56212
+ return (0, combi_1.seq)(_1.BDEFName, (0, combi_1.starPrio)((0, combi_1.seq)(".", _1.BDEFName)));
56213
+ }
56214
+ }
56215
+ exports.BDEFFieldPath = BDEFFieldPath;
56216
+ //# sourceMappingURL=bdef_field_path.js.map
56217
+
56218
+ /***/ },
56219
+
56220
+ /***/ "../core/build/src/bdef/expressions/bdef_header.js"
56221
+ /*!*********************************************************!*\
56222
+ !*** ../core/build/src/bdef/expressions/bdef_header.js ***!
56223
+ \*********************************************************/
56224
+ (__unused_webpack_module, exports, __webpack_require__) {
56225
+
56226
+ "use strict";
56227
+
56228
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
56229
+ exports.BDEFHeader = void 0;
56230
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/bdef/expressions/index.js");
56231
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
56232
+ /** header statements following the implementation type, eg. "strict ( 2 );" or "with draft;" */
56233
+ class BDEFHeader extends combi_1.Expression {
56234
+ getRunnable() {
56235
+ const extensibleItem = (0, combi_1.seq)("WITH", (0, combi_1.plusPrio)((0, combi_1.regex)(/^\w+$/)), ";");
56236
+ const extensible = (0, combi_1.seq)("EXTENSIBLE", (0, combi_1.optPrio)((0, combi_1.seq)("{", (0, combi_1.starPrio)(extensibleItem), "}")), (0, combi_1.optPrio)(";"));
56237
+ return (0, combi_1.altPrio)((0, combi_1.seq)("STRICT", (0, combi_1.optPrio)((0, combi_1.seq)("(", (0, combi_1.regex)(/^\d+$/), ")")), ";"), (0, combi_1.seq)("WITH DRAFT", ";"), (0, combi_1.seq)("USE DRAFT", (0, combi_1.optPrio)("AS DEPENDENT"), ";"), (0, combi_1.seq)((0, combi_1.altPrio)("WITH", "USE"), "COLLABORATIVE DRAFT", ";"), (0, combi_1.seq)("WITH PRIVILEGED MODE", (0, combi_1.optPrio)((0, combi_1.seq)("DISABLING", _1.BDEFName)), ";"), (0, combi_1.seq)("WITH MANAGED INSTANCE FILTER", ";"), (0, combi_1.seq)("WITH HIERARCHY", ";"), (0, combi_1.seq)("WITH CROSS ASSOCIATIONS", ";"), (0, combi_1.seq)("USE SIDE EFFECTS", ";"), (0, combi_1.seq)("USE RECOMMENDATIONS", ";"), (0, combi_1.seq)("FOREIGN ENTITY", _1.BDEFName, (0, combi_1.optPrio)(_1.BDEFAlias), ";"), (0, combi_1.seq)("SCALAR ENTITY", _1.BDEFName, "FIELD", _1.BDEFName, ";"), (0, combi_1.seq)("AUXILIARY CLASS", _1.BDEFName, ";"), extensible);
56238
+ }
56239
+ }
56240
+ exports.BDEFHeader = BDEFHeader;
56241
+ //# sourceMappingURL=bdef_header.js.map
56242
+
56243
+ /***/ },
56244
+
56245
+ /***/ "../core/build/src/bdef/expressions/bdef_hierarchy.js"
56246
+ /*!************************************************************!*\
56247
+ !*** ../core/build/src/bdef/expressions/bdef_hierarchy.js ***!
56248
+ \************************************************************/
56249
+ (__unused_webpack_module, exports, __webpack_require__) {
56250
+
56251
+ "use strict";
56252
+
56253
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
56254
+ exports.BDEFHierarchy = void 0;
56255
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/bdef/expressions/index.js");
56256
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
56257
+ /** eg. "instance hierarchy /DMO/I_EmployeeHN { managed reorder action changeNextSibling; ascending association _Manager; }" */
56258
+ class BDEFHierarchy extends combi_1.Expression {
56259
+ getRunnable() {
56260
+ const action = (0, combi_1.seq)((0, combi_1.optPrio)("MANAGED"), (0, combi_1.altPrio)("REORDER", "COPY"), "ACTION", _1.BDEFName, ";");
56261
+ const association = (0, combi_1.seq)((0, combi_1.altPrio)("ASCENDING", "DESCENDING"), "ASSOCIATION", _1.BDEFName, (0, combi_1.altPrio)(";", _1.BDEFAssociationBody));
56262
+ const item = (0, combi_1.altPrio)(action, association, _1.BDEFField, ";");
56263
+ return (0, combi_1.seq)("INSTANCE HIERARCHY", _1.BDEFName, "{", (0, combi_1.starPrio)(item), "}");
56264
+ }
56265
+ }
56266
+ exports.BDEFHierarchy = BDEFHierarchy;
56267
+ //# sourceMappingURL=bdef_hierarchy.js.map
56268
+
56269
+ /***/ },
56270
+
56271
+ /***/ "../core/build/src/bdef/expressions/bdef_implementation_in.js"
56272
+ /*!********************************************************************!*\
56273
+ !*** ../core/build/src/bdef/expressions/bdef_implementation_in.js ***!
56274
+ \********************************************************************/
56275
+ (__unused_webpack_module, exports, __webpack_require__) {
56276
+
56277
+ "use strict";
56278
+
56279
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
56280
+ exports.BDEFImplementationIn = void 0;
56281
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/bdef/expressions/index.js");
56282
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
56283
+ class BDEFImplementationIn extends combi_1.Expression {
56284
+ getRunnable() {
56285
+ return (0, combi_1.seq)("IMPLEMENTATION IN CLASS", _1.BDEFName, (0, combi_1.optPrio)("UNIQUE"));
56286
+ }
56287
+ }
56288
+ exports.BDEFImplementationIn = BDEFImplementationIn;
56289
+ //# sourceMappingURL=bdef_implementation_in.js.map
56290
+
56291
+ /***/ },
56292
+
56293
+ /***/ "../core/build/src/bdef/expressions/bdef_implementation_type.js"
56294
+ /*!**********************************************************************!*\
56295
+ !*** ../core/build/src/bdef/expressions/bdef_implementation_type.js ***!
56296
+ \**********************************************************************/
56297
+ (__unused_webpack_module, exports, __webpack_require__) {
56298
+
56299
+ "use strict";
56300
+
56301
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
56302
+ exports.BDEFImplementationType = void 0;
56303
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/bdef/expressions/index.js");
56304
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
56305
+ /** first statement, eg. "managed with additional save implementation in class zbp_travel unique;" */
56306
+ class BDEFImplementationType extends combi_1.Expression {
56307
+ getRunnable() {
56308
+ const extension = (0, combi_1.seq)("EXTENSION", (0, combi_1.optPrio)((0, combi_1.altPrio)((0, combi_1.seq)("USING INTERFACE", _1.BDEFName), (0, combi_1.seq)("FOR", (0, combi_1.altPrio)("PROJECTION", "INTERFACE")))));
56309
+ const type = (0, combi_1.altPrio)("MANAGED", "UNMANAGED", "ABSTRACT", "PROJECTION", "INTERFACE", extension,
56310
+ // old syntax, eg. "implementation unmanaged;"
56311
+ (0, combi_1.seq)("IMPLEMENTATION", (0, combi_1.altPrio)("MANAGED", "UNMANAGED", "ABSTRACT", "PROJECTION")));
56312
+ const save = (0, combi_1.seq)((0, combi_1.altPrio)("WITH ADDITIONAL SAVE", "WITH UNMANAGED SAVE"), (0, combi_1.optPrio)("AND CLEANUP"), (0, combi_1.optPrio)("WITH FULL DATA"));
56313
+ const option = (0, combi_1.altPrio)(_1.BDEFImplementationIn, save);
56314
+ return (0, combi_1.seq)(type, (0, combi_1.starPrio)(option), ";");
56315
+ }
56316
+ }
56317
+ exports.BDEFImplementationType = BDEFImplementationType;
56318
+ //# sourceMappingURL=bdef_implementation_type.js.map
56319
+
56320
+ /***/ },
56321
+
56322
+ /***/ "../core/build/src/bdef/expressions/bdef_key.js"
56323
+ /*!******************************************************!*\
56324
+ !*** ../core/build/src/bdef/expressions/bdef_key.js ***!
56325
+ \******************************************************/
56326
+ (__unused_webpack_module, exports, __webpack_require__) {
56327
+
56328
+ "use strict";
56329
+
56330
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
56331
+ exports.BDEFKey = void 0;
56332
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/bdef/expressions/index.js");
56333
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
56334
+ /** alternative key, eg. "define pure key AlternativeKey { id; }" */
56335
+ class BDEFKey extends combi_1.Expression {
56336
+ getRunnable() {
56337
+ const fields = (0, combi_1.seq)(_1.BDEFName, (0, combi_1.starPrio)((0, combi_1.seq)(",", _1.BDEFName)), ";");
56338
+ return (0, combi_1.seq)("DEFINE", (0, combi_1.optPrio)("PURE"), "KEY", _1.BDEFName, "{", (0, combi_1.starPrio)(fields), "}");
56339
+ }
56340
+ }
56341
+ exports.BDEFKey = BDEFKey;
56342
+ //# sourceMappingURL=bdef_key.js.map
56343
+
56344
+ /***/ },
56345
+
56346
+ /***/ "../core/build/src/bdef/expressions/bdef_mapping.js"
56347
+ /*!**********************************************************!*\
56348
+ !*** ../core/build/src/bdef/expressions/bdef_mapping.js ***!
56349
+ \**********************************************************/
56350
+ (__unused_webpack_module, exports, __webpack_require__) {
56351
+
56352
+ "use strict";
56353
+
56354
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
56355
+ exports.BDEFMapping = void 0;
56356
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/bdef/expressions/index.js");
56357
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
56358
+ /** eg. "mapping for ztravel corresponding { TravelID = travel_id; }" */
56359
+ class BDEFMapping extends combi_1.Expression {
56360
+ getRunnable() {
56361
+ const names = (0, combi_1.seq)(_1.BDEFName, (0, combi_1.starPrio)((0, combi_1.seq)(",", _1.BDEFName)));
56362
+ const line = (0, combi_1.seq)(_1.BDEFName, "=", _1.BDEFName, (0, combi_1.optPrio)((0, combi_1.seq)("CONTROL", _1.BDEFName)), ";");
56363
+ // deep mapping of a sub node, eg. "sub _Items = items;"
56364
+ const sub = (0, combi_1.seq)("SUB", _1.BDEFName, "=", _1.BDEFName, ";");
56365
+ const body = (0, combi_1.seq)("{", (0, combi_1.starPrio)((0, combi_1.altPrio)(sub, line, ";")), "}");
56366
+ const option = (0, combi_1.altPrio)("CORRESPONDING", "EXTENSIBLE", (0, combi_1.seq)("EXCEPT", names), (0, combi_1.seq)("CONTROL", _1.BDEFName));
56367
+ return (0, combi_1.seq)((0, combi_1.optPrio)("DEEP"), "MAPPING FOR", _1.BDEFName, (0, combi_1.starPrio)(option), (0, combi_1.altPrio)(";", body));
56368
+ }
56369
+ }
56370
+ exports.BDEFMapping = BDEFMapping;
56371
+ //# sourceMappingURL=bdef_mapping.js.map
56372
+
56373
+ /***/ },
56374
+
56375
+ /***/ "../core/build/src/bdef/expressions/bdef_name.js"
56376
+ /*!*******************************************************!*\
56377
+ !*** ../core/build/src/bdef/expressions/bdef_name.js ***!
56378
+ \*******************************************************/
56379
+ (__unused_webpack_module, exports, __webpack_require__) {
56380
+
56381
+ "use strict";
56382
+
56383
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
56384
+ exports.BDEFName = void 0;
56385
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
56386
+ class BDEFName extends combi_1.Expression {
56387
+ getRunnable() {
56388
+ const word = (0, combi_1.regex)(/^\$?\w+$/);
56389
+ const slashName = (0, combi_1.seq)("/", (0, combi_1.regex)(/^\w+$/), "/", (0, combi_1.regex)(/^\w+$/));
56390
+ return (0, combi_1.altPrio)(slashName, word);
56391
+ }
56392
+ }
56393
+ exports.BDEFName = BDEFName;
56394
+ //# sourceMappingURL=bdef_name.js.map
56395
+
56396
+ /***/ },
56397
+
56398
+ /***/ "../core/build/src/bdef/expressions/bdef_operation.js"
56399
+ /*!************************************************************!*\
56400
+ !*** ../core/build/src/bdef/expressions/bdef_operation.js ***!
56401
+ \************************************************************/
56402
+ (__unused_webpack_module, exports, __webpack_require__) {
56403
+
56404
+ "use strict";
56405
+
56406
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
56407
+ exports.BDEFOperation = void 0;
56408
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/bdef/expressions/index.js");
56409
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
56410
+ /** standard operations, eg. "internal create ( features : global );" */
56411
+ class BDEFOperation extends combi_1.Expression {
56412
+ getRunnable() {
56413
+ return (0, combi_1.seq)((0, combi_1.starPrio)((0, combi_1.altPrio)("INTERNAL", "STATIC")), (0, combi_1.altPrio)("CREATE", "UPDATE", "DELETE"), (0, combi_1.optPrio)(_1.BDEFOptions), (0, combi_1.altPrio)(";", _1.BDEFDefaultFunction));
56414
+ }
56415
+ }
56416
+ exports.BDEFOperation = BDEFOperation;
56417
+ //# sourceMappingURL=bdef_operation.js.map
56418
+
56419
+ /***/ },
56420
+
56421
+ /***/ "../core/build/src/bdef/expressions/bdef_options.js"
56422
+ /*!**********************************************************!*\
56423
+ !*** ../core/build/src/bdef/expressions/bdef_options.js ***!
56424
+ \**********************************************************/
56425
+ (__unused_webpack_module, exports, __webpack_require__) {
56426
+
56427
+ "use strict";
56428
+
56429
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
56430
+ exports.BDEFOptions = void 0;
56431
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/bdef/expressions/index.js");
56432
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
56433
+ /** eg. "( features : instance, precheck )", "( read only )" or "( hierarchy-index )" */
56434
+ class BDEFOptions extends combi_1.Expression {
56435
+ getRunnable() {
56436
+ const name = (0, combi_1.seq)(_1.BDEFName, (0, combi_1.starPrio)((0, combi_1.altPrio)((0, combi_1.seq)("-", _1.BDEFName), _1.BDEFName)));
56437
+ const option = (0, combi_1.seq)(name, (0, combi_1.optPrio)((0, combi_1.seq)(":", _1.BDEFName)));
56438
+ return (0, combi_1.seq)("(", option, (0, combi_1.starPrio)((0, combi_1.seq)(",", option)), ")");
56439
+ }
56440
+ }
56441
+ exports.BDEFOptions = BDEFOptions;
56442
+ //# sourceMappingURL=bdef_options.js.map
56443
+
56444
+ /***/ },
56445
+
56446
+ /***/ "../core/build/src/bdef/expressions/bdef_parameter.js"
56447
+ /*!************************************************************!*\
56448
+ !*** ../core/build/src/bdef/expressions/bdef_parameter.js ***!
56449
+ \************************************************************/
56450
+ (__unused_webpack_module, exports, __webpack_require__) {
56451
+
56452
+ "use strict";
56453
+
56454
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
56455
+ exports.BDEFParameter = void 0;
56456
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/bdef/expressions/index.js");
56457
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
56458
+ /** eg. "deep parameter ZD_PARAMETER" */
56459
+ class BDEFParameter extends combi_1.Expression {
56460
+ getRunnable() {
56461
+ return (0, combi_1.seq)((0, combi_1.optPrio)("DEEP"), "PARAMETER", _1.BDEFName);
56462
+ }
56463
+ }
56464
+ exports.BDEFParameter = BDEFParameter;
56465
+ //# sourceMappingURL=bdef_parameter.js.map
56466
+
56467
+ /***/ },
56468
+
56469
+ /***/ "../core/build/src/bdef/expressions/bdef_reference.js"
56470
+ /*!************************************************************!*\
56471
+ !*** ../core/build/src/bdef/expressions/bdef_reference.js ***!
56472
+ \************************************************************/
56473
+ (__unused_webpack_module, exports, __webpack_require__) {
56474
+
56475
+ "use strict";
56476
+
56477
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
56478
+ exports.BDEFReference = void 0;
56479
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/bdef/expressions/index.js");
56480
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
56481
+ /** reference to a determination, validation or action, optionally prefixed with an entity, eg. "Child ~ validatePercentage" */
56482
+ class BDEFReference extends combi_1.Expression {
56483
+ getRunnable() {
56484
+ const namespace = (0, combi_1.seq)("/", (0, combi_1.regex)(/^\w+$/), "/");
56485
+ const tildeEnd = (0, combi_1.regex)(/^\w+~$/);
56486
+ return (0, combi_1.altPrio)((0, combi_1.seq)(_1.BDEFName, "~", _1.BDEFName), (0, combi_1.seq)(_1.BDEFName, (0, combi_1.regex)(/^~\w+$/)), (0, combi_1.seq)((0, combi_1.optPrio)(namespace), tildeEnd, _1.BDEFName), (0, combi_1.seq)((0, combi_1.optPrio)(namespace), (0, combi_1.regex)(/^\w+~\w+$/)), _1.BDEFName);
56487
+ }
56488
+ }
56489
+ exports.BDEFReference = BDEFReference;
56490
+ //# sourceMappingURL=bdef_reference.js.map
56491
+
56492
+ /***/ },
56493
+
56494
+ /***/ "../core/build/src/bdef/expressions/bdef_result.js"
56495
+ /*!*********************************************************!*\
56496
+ !*** ../core/build/src/bdef/expressions/bdef_result.js ***!
56497
+ \*********************************************************/
56498
+ (__unused_webpack_module, exports, __webpack_require__) {
56499
+
56500
+ "use strict";
56501
+
56502
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
56503
+ exports.BDEFResult = void 0;
56504
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/bdef/expressions/index.js");
56505
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
56506
+ /** eg. "result [1] $self", "deep result ZD_RESULT" or "result selective [0..*] entity ZI_Travel" */
56507
+ class BDEFResult extends combi_1.Expression {
56508
+ getRunnable() {
56509
+ return (0, combi_1.seq)((0, combi_1.optPrio)("DEEP"), "RESULT", (0, combi_1.optPrio)("SELECTIVE"), (0, combi_1.optPrio)(_1.BDEFCardinality), (0, combi_1.optPrio)("ENTITY"), _1.BDEFName);
56510
+ }
56511
+ }
56512
+ exports.BDEFResult = BDEFResult;
56513
+ //# sourceMappingURL=bdef_result.js.map
56514
+
56515
+ /***/ },
56516
+
56517
+ /***/ "../core/build/src/bdef/expressions/bdef_side_effects.js"
56518
+ /*!***************************************************************!*\
56519
+ !*** ../core/build/src/bdef/expressions/bdef_side_effects.js ***!
56520
+ \***************************************************************/
56521
+ (__unused_webpack_module, exports, __webpack_require__) {
56522
+
56523
+ "use strict";
56524
+
56525
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
56526
+ exports.BDEFSideEffects = void 0;
56527
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/bdef/expressions/index.js");
56528
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
56529
+ /** eg. "side effects { field Price affects field TotalPrice, messages; }" */
56530
+ class BDEFSideEffects extends combi_1.Expression {
56531
+ getRunnable() {
56532
+ const fieldList = (0, combi_1.seq)("(", _1.BDEFName, (0, combi_1.starPrio)((0, combi_1.seq)(",", _1.BDEFName)), ")");
56533
+ // eg. "field *", "field ( A, B )", "field _Item.*" or "field _Root.( A, B )"
56534
+ const field = (0, combi_1.seq)("FIELD", (0, combi_1.altPrio)("*", fieldList, (0, combi_1.seq)(_1.BDEFName, (0, combi_1.starPrio)((0, combi_1.seq)(".", (0, combi_1.altPrio)("*", fieldList, _1.BDEFName))))));
56535
+ const permission = (0, combi_1.altPrio)((0, combi_1.seq)("ACTION", _1.BDEFReference), field, (0, combi_1.seq)((0, combi_1.altPrio)("CREATE", "UPDATE", "DELETE"), (0, combi_1.optPrio)(_1.BDEFName)));
56536
+ const permissions = (0, combi_1.seq)("PERMISSIONS", "(", permission, (0, combi_1.starPrio)((0, combi_1.seq)(",", permission)), ")");
56537
+ const target = (0, combi_1.altPrio)(field, (0, combi_1.seq)("ENTITY", _1.BDEFFieldPath), "MESSAGES", permissions, "$SELF");
56538
+ const targets = (0, combi_1.seq)(target, (0, combi_1.starPrio)((0, combi_1.seq)(",", target)));
56539
+ const trigger = (0, combi_1.altPrio)(field, (0, combi_1.seq)("ENTITY", _1.BDEFFieldPath), "$SELF");
56540
+ const triggers = (0, combi_1.seq)(trigger, (0, combi_1.starPrio)((0, combi_1.seq)(",", trigger)));
56541
+ const source = (0, combi_1.altPrio)(field, (0, combi_1.seq)("ACTION", _1.BDEFReference), (0, combi_1.seq)("DETERMINE ACTION", _1.BDEFReference, "EXECUTED ON", triggers), (0, combi_1.seq)("ENTITY", _1.BDEFFieldPath), (0, combi_1.seq)("EVENT", _1.BDEFName), "$SELF");
56542
+ const recommendation = (0, combi_1.seq)("RECOMMENDATION FUNCTION", _1.BDEFName, "EXECUTED ON", triggers, ";");
56543
+ const item = (0, combi_1.altPrio)((0, combi_1.seq)(source, "AFFECTS", targets, ";"), recommendation, ";");
56544
+ return (0, combi_1.seq)("SIDE EFFECTS", "{", (0, combi_1.starPrio)(item), "}");
56545
+ }
56546
+ }
56547
+ exports.BDEFSideEffects = BDEFSideEffects;
56548
+ //# sourceMappingURL=bdef_side_effects.js.map
56549
+
56550
+ /***/ },
56551
+
56552
+ /***/ "../core/build/src/bdef/expressions/bdef_string.js"
56553
+ /*!*********************************************************!*\
56554
+ !*** ../core/build/src/bdef/expressions/bdef_string.js ***!
56555
+ \*********************************************************/
56556
+ (__unused_webpack_module, exports, __webpack_require__) {
56557
+
56558
+ "use strict";
56559
+
56560
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
56561
+ exports.BDEFString = void 0;
56562
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
56563
+ class BDEFString extends combi_1.Expression {
56564
+ getRunnable() {
56565
+ return (0, combi_1.regex)(/^'(?:[^']|'')*'$/);
56566
+ }
56567
+ }
56568
+ exports.BDEFString = BDEFString;
56569
+ //# sourceMappingURL=bdef_string.js.map
56570
+
56571
+ /***/ },
56572
+
56573
+ /***/ "../core/build/src/bdef/expressions/bdef_use.js"
56574
+ /*!******************************************************!*\
56575
+ !*** ../core/build/src/bdef/expressions/bdef_use.js ***!
56576
+ \******************************************************/
56577
+ (__unused_webpack_module, exports, __webpack_require__) {
56578
+
56579
+ "use strict";
56580
+
56581
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
56582
+ exports.BDEFUse = void 0;
56583
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/bdef/expressions/index.js");
56584
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
56585
+ /** reuse in projections and interfaces, eg. "use action acceptTravel as accept;" */
56586
+ class BDEFUse extends combi_1.Expression {
56587
+ getRunnable() {
56588
+ const end = (0, combi_1.altPrio)(";", _1.BDEFDefaultFunction);
56589
+ const operation = (0, combi_1.seq)((0, combi_1.altPrio)("CREATE", "UPDATE", "DELETE"), (0, combi_1.optPrio)(_1.BDEFOptions), end);
56590
+ const actionTail = (0, combi_1.altPrio)((0, combi_1.seq)("AS", _1.BDEFName), (0, combi_1.seq)("EXTERNAL", _1.BDEFString), _1.BDEFParameter, _1.BDEFResult);
56591
+ const action = (0, combi_1.seq)((0, combi_1.altPrio)("ACTION", "FUNCTION"), (0, combi_1.optPrio)(_1.BDEFOptions), _1.BDEFName, (0, combi_1.starPrio)(actionTail), end);
56592
+ const association = (0, combi_1.seq)("ASSOCIATION", (0, combi_1.optPrio)(_1.BDEFOptions), _1.BDEFName, (0, combi_1.optPrio)((0, combi_1.seq)("ABBREVIATION", _1.BDEFName)), (0, combi_1.altPrio)(";", _1.BDEFAssociationBody));
56593
+ return (0, combi_1.seq)("USE", (0, combi_1.altPrio)(operation, action, association, (0, combi_1.seq)("ETAG", ";"), (0, combi_1.seq)("SIDE EFFECTS", ";"), (0, combi_1.seq)("KEY", _1.BDEFName, ";"), (0, combi_1.seq)("EVENT", _1.BDEFName, (0, combi_1.optPrio)(_1.BDEFParameter), ";")));
56594
+ }
56595
+ }
56596
+ exports.BDEFUse = BDEFUse;
56597
+ //# sourceMappingURL=bdef_use.js.map
56598
+
56599
+ /***/ },
56600
+
56601
+ /***/ "../core/build/src/bdef/expressions/index.js"
56602
+ /*!***************************************************!*\
56603
+ !*** ../core/build/src/bdef/expressions/index.js ***!
56604
+ \***************************************************/
56605
+ (__unused_webpack_module, exports, __webpack_require__) {
56606
+
56607
+ "use strict";
56608
+
56609
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
56610
+ if (k2 === undefined) k2 = k;
56611
+ var desc = Object.getOwnPropertyDescriptor(m, k);
56612
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
56613
+ desc = { enumerable: true, get: function() { return m[k]; } };
56614
+ }
56615
+ Object.defineProperty(o, k2, desc);
56616
+ }) : (function(o, m, k, k2) {
56617
+ if (k2 === undefined) k2 = k;
56618
+ o[k2] = m[k];
56619
+ }));
56620
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
56621
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
56622
+ };
56623
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
56624
+ __exportStar(__webpack_require__(/*! ./bdef_action */ "../core/build/src/bdef/expressions/bdef_action.js"), exports);
56625
+ __exportStar(__webpack_require__(/*! ./bdef_alias */ "../core/build/src/bdef/expressions/bdef_alias.js"), exports);
56626
+ __exportStar(__webpack_require__(/*! ./bdef_association_body */ "../core/build/src/bdef/expressions/bdef_association_body.js"), exports);
56627
+ __exportStar(__webpack_require__(/*! ./bdef_association */ "../core/build/src/bdef/expressions/bdef_association.js"), exports);
56628
+ __exportStar(__webpack_require__(/*! ./bdef_authorization_context */ "../core/build/src/bdef/expressions/bdef_authorization_context.js"), exports);
56629
+ __exportStar(__webpack_require__(/*! ./bdef_cardinality */ "../core/build/src/bdef/expressions/bdef_cardinality.js"), exports);
56630
+ __exportStar(__webpack_require__(/*! ./bdef_default_function */ "../core/build/src/bdef/expressions/bdef_default_function.js"), exports);
56631
+ __exportStar(__webpack_require__(/*! ./bdef_define_behavior */ "../core/build/src/bdef/expressions/bdef_define_behavior.js"), exports);
56632
+ __exportStar(__webpack_require__(/*! ./bdef_definition */ "../core/build/src/bdef/expressions/bdef_definition.js"), exports);
56633
+ __exportStar(__webpack_require__(/*! ./bdef_determination */ "../core/build/src/bdef/expressions/bdef_determination.js"), exports);
56634
+ __exportStar(__webpack_require__(/*! ./bdef_determine_action */ "../core/build/src/bdef/expressions/bdef_determine_action.js"), exports);
56635
+ __exportStar(__webpack_require__(/*! ./bdef_event */ "../core/build/src/bdef/expressions/bdef_event.js"), exports);
56636
+ __exportStar(__webpack_require__(/*! ./bdef_field_path */ "../core/build/src/bdef/expressions/bdef_field_path.js"), exports);
56637
+ __exportStar(__webpack_require__(/*! ./bdef_field */ "../core/build/src/bdef/expressions/bdef_field.js"), exports);
56638
+ __exportStar(__webpack_require__(/*! ./bdef_header */ "../core/build/src/bdef/expressions/bdef_header.js"), exports);
56639
+ __exportStar(__webpack_require__(/*! ./bdef_hierarchy */ "../core/build/src/bdef/expressions/bdef_hierarchy.js"), exports);
56640
+ __exportStar(__webpack_require__(/*! ./bdef_implementation_in */ "../core/build/src/bdef/expressions/bdef_implementation_in.js"), exports);
56641
+ __exportStar(__webpack_require__(/*! ./bdef_implementation_type */ "../core/build/src/bdef/expressions/bdef_implementation_type.js"), exports);
56642
+ __exportStar(__webpack_require__(/*! ./bdef_key */ "../core/build/src/bdef/expressions/bdef_key.js"), exports);
56643
+ __exportStar(__webpack_require__(/*! ./bdef_mapping */ "../core/build/src/bdef/expressions/bdef_mapping.js"), exports);
56644
+ __exportStar(__webpack_require__(/*! ./bdef_name */ "../core/build/src/bdef/expressions/bdef_name.js"), exports);
56645
+ __exportStar(__webpack_require__(/*! ./bdef_operation */ "../core/build/src/bdef/expressions/bdef_operation.js"), exports);
56646
+ __exportStar(__webpack_require__(/*! ./bdef_options */ "../core/build/src/bdef/expressions/bdef_options.js"), exports);
56647
+ __exportStar(__webpack_require__(/*! ./bdef_parameter */ "../core/build/src/bdef/expressions/bdef_parameter.js"), exports);
56648
+ __exportStar(__webpack_require__(/*! ./bdef_reference */ "../core/build/src/bdef/expressions/bdef_reference.js"), exports);
56649
+ __exportStar(__webpack_require__(/*! ./bdef_result */ "../core/build/src/bdef/expressions/bdef_result.js"), exports);
56650
+ __exportStar(__webpack_require__(/*! ./bdef_side_effects */ "../core/build/src/bdef/expressions/bdef_side_effects.js"), exports);
56651
+ __exportStar(__webpack_require__(/*! ./bdef_string */ "../core/build/src/bdef/expressions/bdef_string.js"), exports);
56652
+ __exportStar(__webpack_require__(/*! ./bdef_use */ "../core/build/src/bdef/expressions/bdef_use.js"), exports);
56653
+ //# sourceMappingURL=index.js.map
56654
+
56655
+ /***/ },
56656
+
55595
56657
  /***/ "../core/build/src/cds/cds_determine_types.js"
55596
56658
  /*!****************************************************!*\
55597
56659
  !*** ../core/build/src/cds/cds_determine_types.js ***!
@@ -63234,6 +64296,8 @@ exports.BADIDefinition = BADIDefinition;
63234
64296
 
63235
64297
  Object.defineProperty(exports, "__esModule", ({ value: true }));
63236
64298
  exports.BehaviorDefinition = void 0;
64299
+ const bdef_parser_1 = __webpack_require__(/*! ../bdef/bdef_parser */ "../core/build/src/bdef/bdef_parser.js");
64300
+ const expressions_1 = __webpack_require__(/*! ../bdef/expressions */ "../core/build/src/bdef/expressions/index.js");
63237
64301
  const _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ "../core/build/src/objects/_abstract_object.js");
63238
64302
  class BehaviorDefinition extends _abstract_object_1.AbstractObject {
63239
64303
  constructor() {
@@ -63256,8 +64320,30 @@ class BehaviorDefinition extends _abstract_object_1.AbstractObject {
63256
64320
  findSourceFile() {
63257
64321
  return this.getFiles().find(f => f.getFilename().endsWith(".asbdef"));
63258
64322
  }
64323
+ parse() {
64324
+ if (this.isDirty() === false && this.parsedData !== undefined) {
64325
+ return { updated: false, runtime: 0 };
64326
+ }
64327
+ const start = Date.now();
64328
+ const tree = new bdef_parser_1.BDEFParser().parse(this.findSourceFile());
64329
+ this.parsedData = {
64330
+ entities: tree ? this.findEntities(tree) : this.findEntitiesFallback(),
64331
+ tree,
64332
+ };
64333
+ this.dirty = false;
64334
+ return { updated: true, runtime: Date.now() - start };
64335
+ }
64336
+ getTree() {
64337
+ var _a;
64338
+ this.parse();
64339
+ return (_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.tree;
64340
+ }
64341
+ hasParserError() {
64342
+ return this.findSourceFile() !== undefined && this.getTree() === undefined;
64343
+ }
63259
64344
  listEntities() {
63260
- return this.parseSource().entities;
64345
+ this.parse();
64346
+ return this.parsedData.entities;
63261
64347
  }
63262
64348
  /** finds the entity name for a given alias, undefined if the alias is not defined */
63263
64349
  findEntityNameByAlias(alias) {
@@ -63271,15 +64357,29 @@ class BehaviorDefinition extends _abstract_object_1.AbstractObject {
63271
64357
  return undefined;
63272
64358
  }
63273
64359
  /////////////////////////
63274
- parseSource() {
64360
+ findEntities(tree) {
63275
64361
  var _a;
63276
- if (this.parsedData !== undefined) {
63277
- return this.parsedData;
64362
+ const ret = [];
64363
+ for (const define of tree.findDirectExpressions(expressions_1.BDEFDefineBehavior)) {
64364
+ const name = define.findDirectExpression(expressions_1.BDEFName);
64365
+ if (name === undefined) {
64366
+ continue;
64367
+ }
64368
+ const alias = (_a = define.findDirectExpression(expressions_1.BDEFAlias)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(expressions_1.BDEFName);
64369
+ ret.push({
64370
+ name: name.concatTokens().replace(/ /g, ""),
64371
+ alias: alias === null || alias === void 0 ? void 0 : alias.concatTokens().replace(/ /g, ""),
64372
+ });
63278
64373
  }
63279
- this.parsedData = { entities: [] };
64374
+ return ret;
64375
+ }
64376
+ /** used if the source cannot be parsed */
64377
+ findEntitiesFallback() {
64378
+ var _a;
64379
+ const ret = [];
63280
64380
  const raw = (_a = this.findSourceFile()) === null || _a === void 0 ? void 0 : _a.getRaw();
63281
64381
  if (raw === undefined) {
63282
- return this.parsedData;
64382
+ return ret;
63283
64383
  }
63284
64384
  // BDEF uses "//" for line comments
63285
64385
  const stripped = raw.replace(/\/\/.*$/gm, "");
@@ -63287,10 +64387,10 @@ class BehaviorDefinition extends _abstract_object_1.AbstractObject {
63287
64387
  const regex = /\bdefine\s+(?:\w+\s+)*?behavior\s+for\s+([\w/]+)(?:\s+alias\s+(\w+))?/gi;
63288
64388
  let match = regex.exec(stripped);
63289
64389
  while (match !== null) {
63290
- this.parsedData.entities.push({ name: match[1], alias: match[2] });
64390
+ ret.push({ name: match[1], alias: match[2] });
63291
64391
  match = regex.exec(stripped);
63292
64392
  }
63293
- return this.parsedData;
64393
+ return ret;
63294
64394
  }
63295
64395
  }
63296
64396
  exports.BehaviorDefinition = BehaviorDefinition;
@@ -71554,7 +72654,7 @@ class Registry {
71554
72654
  }
71555
72655
  static abaplintVersion() {
71556
72656
  // magic, see build script "version.js"
71557
- return "2.120.83";
72657
+ return "2.120.85";
71558
72658
  }
71559
72659
  getDDICReferences() {
71560
72660
  return this.ddicReferences;
@@ -75762,6 +76862,161 @@ exports.AvoidUse = AvoidUse;
75762
76862
 
75763
76863
  /***/ },
75764
76864
 
76865
+ /***/ "../core/build/src/rules/bdef_check_syntax.js"
76866
+ /*!****************************************************!*\
76867
+ !*** ../core/build/src/rules/bdef_check_syntax.js ***!
76868
+ \****************************************************/
76869
+ (__unused_webpack_module, exports, __webpack_require__) {
76870
+
76871
+ "use strict";
76872
+
76873
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
76874
+ exports.BDEFCheckSyntax = exports.BDEFCheckSyntaxConf = void 0;
76875
+ const expressions_1 = __webpack_require__(/*! ../bdef/expressions */ "../core/build/src/bdef/expressions/index.js");
76876
+ const ddic_1 = __webpack_require__(/*! ../ddic */ "../core/build/src/ddic.js");
76877
+ const issue_1 = __webpack_require__(/*! ../issue */ "../core/build/src/issue.js");
76878
+ const objects_1 = __webpack_require__(/*! ../objects */ "../core/build/src/objects/index.js");
76879
+ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "../core/build/src/rules/_basic_rule_config.js");
76880
+ const _irule_1 = __webpack_require__(/*! ./_irule */ "../core/build/src/rules/_irule.js");
76881
+ class BDEFCheckSyntaxConf extends _basic_rule_config_1.BasicRuleConfig {
76882
+ }
76883
+ exports.BDEFCheckSyntaxConf = BDEFCheckSyntaxConf;
76884
+ class BDEFCheckSyntax {
76885
+ constructor() {
76886
+ this.conf = new BDEFCheckSyntaxConf();
76887
+ }
76888
+ getMetadata() {
76889
+ return {
76890
+ key: "bdef_check_syntax",
76891
+ title: "BDEF Check Syntax",
76892
+ shortDescription: "Checks behavior definition references to entities and implementation classes",
76893
+ extendedInformation: `Performs semantic checks which require other objects to be available.
76894
+
76895
+ Missing objects are only reported when their names match the configured errorNamespace.`,
76896
+ tags: [_irule_1.RuleTag.Syntax],
76897
+ };
76898
+ }
76899
+ getConfig() {
76900
+ return this.conf;
76901
+ }
76902
+ setConfig(conf) {
76903
+ this.conf = conf;
76904
+ }
76905
+ initialize(reg) {
76906
+ this.reg = reg;
76907
+ return this;
76908
+ }
76909
+ run(object) {
76910
+ if (!(object instanceof objects_1.BehaviorDefinition)) {
76911
+ return [];
76912
+ }
76913
+ const tree = object.getTree();
76914
+ const file = object.findSourceFile();
76915
+ if (tree === undefined || file === undefined) {
76916
+ return [];
76917
+ }
76918
+ const issues = [];
76919
+ this.checkImplementationClasses(tree, issues, file);
76920
+ this.checkEntities(tree, issues, file);
76921
+ return issues;
76922
+ }
76923
+ checkImplementationClasses(tree, issues, file) {
76924
+ for (const implementation of tree.findAllExpressions(expressions_1.BDEFImplementationIn)) {
76925
+ const nameNode = implementation.findDirectExpression(expressions_1.BDEFName);
76926
+ if (nameNode === undefined) {
76927
+ continue;
76928
+ }
76929
+ const name = this.name(nameNode);
76930
+ if (this.reg.getObject("CLAS", name) === undefined && this.reg.inErrorNamespace(name)) {
76931
+ issues.push(issue_1.Issue.atToken(file, nameNode.getFirstToken(), `Implementation class "${name}" not found`, this.getMetadata().key, this.conf.severity));
76932
+ }
76933
+ }
76934
+ }
76935
+ checkEntities(tree, issues, file) {
76936
+ const ddic = new ddic_1.DDIC(this.reg);
76937
+ for (const define of tree.findDirectExpressions(expressions_1.BDEFDefineBehavior)) {
76938
+ if (define.getFirstToken().getStr().toUpperCase() !== "DEFINE") {
76939
+ // "extend behavior for" refers to entities of the extended BDEF
76940
+ continue;
76941
+ }
76942
+ const nameNode = define.findDirectExpression(expressions_1.BDEFName);
76943
+ if (nameNode === undefined) {
76944
+ continue;
76945
+ }
76946
+ const name = this.name(nameNode);
76947
+ if (this.reg.inErrorNamespace(name)
76948
+ && this.reg.getObject("DDLS", name) === undefined
76949
+ && ddic.lookupDDLS(name) === undefined) {
76950
+ issues.push(issue_1.Issue.atToken(file, nameNode.getFirstToken(), `Entity "${name}" not found`, this.getMetadata().key, this.conf.severity));
76951
+ }
76952
+ }
76953
+ }
76954
+ name(node) {
76955
+ return node.concatTokens().replace(/ /g, "");
76956
+ }
76957
+ }
76958
+ exports.BDEFCheckSyntax = BDEFCheckSyntax;
76959
+ //# sourceMappingURL=bdef_check_syntax.js.map
76960
+
76961
+ /***/ },
76962
+
76963
+ /***/ "../core/build/src/rules/bdef_parser_error.js"
76964
+ /*!****************************************************!*\
76965
+ !*** ../core/build/src/rules/bdef_parser_error.js ***!
76966
+ \****************************************************/
76967
+ (__unused_webpack_module, exports, __webpack_require__) {
76968
+
76969
+ "use strict";
76970
+
76971
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
76972
+ exports.BDEFParserError = exports.BDEFParserErrorConf = void 0;
76973
+ const issue_1 = __webpack_require__(/*! ../issue */ "../core/build/src/issue.js");
76974
+ const _irule_1 = __webpack_require__(/*! ./_irule */ "../core/build/src/rules/_irule.js");
76975
+ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "../core/build/src/rules/_basic_rule_config.js");
76976
+ const objects_1 = __webpack_require__(/*! ../objects */ "../core/build/src/objects/index.js");
76977
+ class BDEFParserErrorConf extends _basic_rule_config_1.BasicRuleConfig {
76978
+ }
76979
+ exports.BDEFParserErrorConf = BDEFParserErrorConf;
76980
+ class BDEFParserError {
76981
+ constructor() {
76982
+ this.conf = new BDEFParserErrorConf();
76983
+ }
76984
+ getMetadata() {
76985
+ return {
76986
+ key: "bdef_parser_error",
76987
+ title: "BDEF Parser Error",
76988
+ shortDescription: `BDEF parsing`,
76989
+ extendedInformation: `Parses behavior definitions and issues parser errors`,
76990
+ tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
76991
+ };
76992
+ }
76993
+ getConfig() {
76994
+ return this.conf;
76995
+ }
76996
+ setConfig(conf) {
76997
+ this.conf = conf;
76998
+ }
76999
+ initialize(_reg) {
77000
+ return this;
77001
+ }
77002
+ run(object) {
77003
+ const issues = [];
77004
+ if (object instanceof objects_1.BehaviorDefinition) {
77005
+ const file = object.findSourceFile();
77006
+ if (object.hasParserError() === true && file) {
77007
+ const empty = file.getRaw().length === 0 ? ", empty file" : "";
77008
+ const message = "BDEF Parser error" + empty;
77009
+ issues.push(issue_1.Issue.atRow(file, 1, message, this.getMetadata().key, this.getConfig().severity));
77010
+ }
77011
+ }
77012
+ return issues;
77013
+ }
77014
+ }
77015
+ exports.BDEFParserError = BDEFParserError;
77016
+ //# sourceMappingURL=bdef_parser_error.js.map
77017
+
77018
+ /***/ },
77019
+
75765
77020
  /***/ "../core/build/src/rules/begin_end_names.js"
75766
77021
  /*!**************************************************!*\
75767
77022
  !*** ../core/build/src/rules/begin_end_names.js ***!
@@ -90473,6 +91728,8 @@ __exportStar(__webpack_require__(/*! ./allowed_object_naming */ "../core/build/s
90473
91728
  __exportStar(__webpack_require__(/*! ./allowed_object_types */ "../core/build/src/rules/allowed_object_types.js"), exports);
90474
91729
  __exportStar(__webpack_require__(/*! ./ambiguous_statement */ "../core/build/src/rules/ambiguous_statement.js"), exports);
90475
91730
  __exportStar(__webpack_require__(/*! ./avoid_use */ "../core/build/src/rules/avoid_use.js"), exports);
91731
+ __exportStar(__webpack_require__(/*! ./bdef_check_syntax */ "../core/build/src/rules/bdef_check_syntax.js"), exports);
91732
+ __exportStar(__webpack_require__(/*! ./bdef_parser_error */ "../core/build/src/rules/bdef_parser_error.js"), exports);
90476
91733
  __exportStar(__webpack_require__(/*! ./begin_end_names */ "../core/build/src/rules/begin_end_names.js"), exports);
90477
91734
  __exportStar(__webpack_require__(/*! ./begin_single_include */ "../core/build/src/rules/begin_single_include.js"), exports);
90478
91735
  __exportStar(__webpack_require__(/*! ./boolean_flag_via_if */ "../core/build/src/rules/boolean_flag_via_if.js"), exports);
@@ -90615,6 +91872,7 @@ __exportStar(__webpack_require__(/*! ./prefer_pragmas */ "../core/build/src/rule
90615
91872
  __exportStar(__webpack_require__(/*! ./prefer_abap_bool */ "../core/build/src/rules/prefer_abap_bool.js"), exports);
90616
91873
  __exportStar(__webpack_require__(/*! ./prefer_abap_bool_values */ "../core/build/src/rules/prefer_abap_bool_values.js"), exports);
90617
91874
  __exportStar(__webpack_require__(/*! ./prefer_raise_exception_new */ "../core/build/src/rules/prefer_raise_exception_new.js"), exports);
91875
+ __exportStar(__webpack_require__(/*! ./prefer_raise_message */ "../core/build/src/rules/prefer_raise_message.js"), exports);
90618
91876
  __exportStar(__webpack_require__(/*! ./prefer_string_template */ "../core/build/src/rules/prefer_string_template.js"), exports);
90619
91877
  __exportStar(__webpack_require__(/*! ./prefer_returning_to_exporting */ "../core/build/src/rules/prefer_returning_to_exporting.js"), exports);
90620
91878
  __exportStar(__webpack_require__(/*! ./prefer_xsdbool */ "../core/build/src/rules/prefer_xsdbool.js"), exports);
@@ -100050,6 +101308,134 @@ exports.PreferRaiseExceptionNew = PreferRaiseExceptionNew;
100050
101308
 
100051
101309
  /***/ },
100052
101310
 
101311
+ /***/ "../core/build/src/rules/prefer_raise_message.js"
101312
+ /*!*******************************************************!*\
101313
+ !*** ../core/build/src/rules/prefer_raise_message.js ***!
101314
+ \*******************************************************/
101315
+ (__unused_webpack_module, exports, __webpack_require__) {
101316
+
101317
+ "use strict";
101318
+
101319
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
101320
+ if (k2 === undefined) k2 = k;
101321
+ var desc = Object.getOwnPropertyDescriptor(m, k);
101322
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
101323
+ desc = { enumerable: true, get: function() { return m[k]; } };
101324
+ }
101325
+ Object.defineProperty(o, k2, desc);
101326
+ }) : (function(o, m, k, k2) {
101327
+ if (k2 === undefined) k2 = k;
101328
+ o[k2] = m[k];
101329
+ }));
101330
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
101331
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
101332
+ }) : function(o, v) {
101333
+ o["default"] = v;
101334
+ });
101335
+ var __importStar = (this && this.__importStar) || (function () {
101336
+ var ownKeys = function(o) {
101337
+ ownKeys = Object.getOwnPropertyNames || function (o) {
101338
+ var ar = [];
101339
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
101340
+ return ar;
101341
+ };
101342
+ return ownKeys(o);
101343
+ };
101344
+ return function (mod) {
101345
+ if (mod && mod.__esModule) return mod;
101346
+ var result = {};
101347
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
101348
+ __setModuleDefault(result, mod);
101349
+ return result;
101350
+ };
101351
+ })();
101352
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
101353
+ exports.PreferRaiseMessage = exports.PreferRaiseMessageConf = void 0;
101354
+ const issue_1 = __webpack_require__(/*! ../issue */ "../core/build/src/issue.js");
101355
+ const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "../core/build/src/rules/_abap_rule.js");
101356
+ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "../core/build/src/rules/_basic_rule_config.js");
101357
+ const _irule_1 = __webpack_require__(/*! ./_irule */ "../core/build/src/rules/_irule.js");
101358
+ const Statements = __importStar(__webpack_require__(/*! ../abap/2_statements/statements */ "../core/build/src/abap/2_statements/statements/index.js"));
101359
+ const Expressions = __importStar(__webpack_require__(/*! ../abap/2_statements/expressions */ "../core/build/src/abap/2_statements/expressions/index.js"));
101360
+ class PreferRaiseMessageConf extends _basic_rule_config_1.BasicRuleConfig {
101361
+ constructor() {
101362
+ super(...arguments);
101363
+ /** List of exception class names to ignore, case insensitive */
101364
+ this.ignoreExceptionClasses = [];
101365
+ }
101366
+ }
101367
+ exports.PreferRaiseMessageConf = PreferRaiseMessageConf;
101368
+ class PreferRaiseMessage extends _abap_rule_1.ABAPRule {
101369
+ constructor() {
101370
+ super(...arguments);
101371
+ this.conf = new PreferRaiseMessageConf();
101372
+ }
101373
+ getMetadata() {
101374
+ return {
101375
+ key: "prefer_raise_message",
101376
+ title: "Prefer RAISE EXCEPTION with MESSAGE",
101377
+ shortDescription: `Prefer RAISE EXCEPTION with MESSAGE instead of supplying parameter TEXT`,
101378
+ extendedInformation: `Reports RAISE EXCEPTION statements where parameter TEXT is supplied.
101379
+
101380
+ Use a message class instead, so the text is translatable and can be found via where-used.
101381
+
101382
+ Exception classes can be excluded via configuration "ignoreExceptionClasses".`,
101383
+ tags: [_irule_1.RuleTag.SingleFile],
101384
+ goodExample: `RAISE EXCEPTION TYPE zcx_error MESSAGE e001(zclass).`,
101385
+ badExample: `RAISE EXCEPTION TYPE zcx_error
101386
+ EXPORTING text = 'hello world'.`,
101387
+ };
101388
+ }
101389
+ getConfig() {
101390
+ return this.conf;
101391
+ }
101392
+ setConfig(conf) {
101393
+ this.conf = conf;
101394
+ }
101395
+ runParsed(file) {
101396
+ var _a, _b, _c, _d;
101397
+ var _e;
101398
+ const issues = [];
101399
+ const ignore = ((_e = this.conf.ignoreExceptionClasses) !== null && _e !== void 0 ? _e : []).map(c => c.toUpperCase());
101400
+ for (const statement of file.getStatements()) {
101401
+ if (!(statement.get() instanceof Statements.Raise)) {
101402
+ continue;
101403
+ }
101404
+ const concat = statement.concatTokens().toUpperCase();
101405
+ if (!concat.startsWith("RAISE EXCEPTION ") && !concat.startsWith("RAISE RESUMABLE EXCEPTION ")) {
101406
+ continue;
101407
+ }
101408
+ else if (concat.includes(" MESSAGE")) {
101409
+ continue;
101410
+ }
101411
+ let className;
101412
+ let parameters;
101413
+ const newObject = (_b = (_a = statement.findDirectExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.MethodCallChain)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.NewObject);
101414
+ if (newObject) {
101415
+ className = (_c = newObject.findDirectExpression(Expressions.TypeNameOrInfer)) === null || _c === void 0 ? void 0 : _c.concatTokens();
101416
+ parameters = newObject.findDirectExpression(Expressions.ParameterListS);
101417
+ }
101418
+ else {
101419
+ className = (_d = statement.findDirectExpression(Expressions.ClassName)) === null || _d === void 0 ? void 0 : _d.concatTokens();
101420
+ parameters = statement.findDirectExpression(Expressions.ParameterListS);
101421
+ }
101422
+ if (className === undefined || ignore.includes(className.toUpperCase())) {
101423
+ continue;
101424
+ }
101425
+ const text = parameters === null || parameters === void 0 ? void 0 : parameters.findDirectExpressions(Expressions.ParameterS).find(p => { var _a; return ((_a = p.findDirectExpression(Expressions.ParameterName)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase()) === "TEXT"; });
101426
+ if (text) {
101427
+ const message = "Prefer RAISE EXCEPTION with MESSAGE, " + className + " raised with parameter TEXT";
101428
+ issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));
101429
+ }
101430
+ }
101431
+ return issues;
101432
+ }
101433
+ }
101434
+ exports.PreferRaiseMessage = PreferRaiseMessage;
101435
+ //# sourceMappingURL=prefer_raise_message.js.map
101436
+
101437
+ /***/ },
101438
+
100053
101439
  /***/ "../core/build/src/rules/prefer_returning_to_exporting.js"
100054
101440
  /*!****************************************************************!*\
100055
101441
  !*** ../core/build/src/rules/prefer_returning_to_exporting.js ***!