@abaplint/cli 2.119.54 → 2.119.56

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 +621 -173
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -1839,7 +1839,7 @@ class Regex {
1839
1839
  return result;
1840
1840
  }
1841
1841
  railroad() {
1842
- return "Railroad.Terminal(\"" + this.regexp.source.replace(/\\/g, "\\\\") + "\")";
1842
+ return "Railroad.Terminal(\"" + this.regexp.source.replace(/\\/g, "\\\\").replace(/"/g, "\\\"") + "\")";
1843
1843
  }
1844
1844
  toStr() {
1845
1845
  return this.regexp.toString();
@@ -2893,6 +2893,9 @@ class ExpandMacros {
2893
2893
  this.globalMacros = globalMacros;
2894
2894
  this.reg = reg;
2895
2895
  }
2896
+ listMacroNames() {
2897
+ return this.macros.listMacroNames();
2898
+ }
2896
2899
  find(statements, file, clear = true) {
2897
2900
  var _a, _b, _c;
2898
2901
  let nameToken = undefined;
@@ -2946,7 +2949,7 @@ class ExpandMacros {
2946
2949
  for (const statement of statements) {
2947
2950
  const type = statement.get();
2948
2951
  if (type instanceof _statement_1.Unknown || type instanceof _statement_1.MacroCall) {
2949
- const macroName = this.findName(statement.getTokens());
2952
+ const macroName = ExpandMacros.findName(statement.getTokens());
2950
2953
  if (macroName && this.macros.isMacro(macroName)) {
2951
2954
  const filename = this.macros.getMacroFilename(macroName);
2952
2955
  if (filename) {
@@ -3038,7 +3041,7 @@ class ExpandMacros {
3038
3041
  }
3039
3042
  return result;
3040
3043
  }
3041
- findName(tokens) {
3044
+ static findName(tokens) {
3042
3045
  let macroName = undefined;
3043
3046
  let previous = undefined;
3044
3047
  for (const i of tokens) {
@@ -3094,40 +3097,40 @@ function commonDerivedTypes() {
3094
3097
  const entity = (0, combi_1.alt)(_1.TypeName, _1.EntityAssociation);
3095
3098
  // more-specific keyword phrases (e.g. "FAILED LATE") must precede less-specific ones ("FAILED")
3096
3099
  return [
3097
- (0, combi_1.ver)(version_1.Release.v774, (0, combi_1.seq)("FAILED LATE", entity)),
3098
- (0, combi_1.ver)(version_1.Release.v774, (0, combi_1.seq)("MAPPED LATE", entity)),
3099
- (0, combi_1.ver)(version_1.Release.v774, (0, combi_1.seq)("REPORTED LATE", entity)),
3100
- (0, combi_1.ver)(version_1.Release.v777, (0, combi_1.seq)("FAILED EARLY", entity)),
3101
- (0, combi_1.ver)(version_1.Release.v777, (0, combi_1.seq)("MAPPED EARLY", entity)),
3102
- (0, combi_1.ver)(version_1.Release.v777, (0, combi_1.seq)("REPORTED EARLY", entity)),
3103
- (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("FAILED", entity)),
3104
- (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("MAPPED", entity)),
3105
- (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("REPORTED", entity)),
3106
- (0, combi_1.ver)(version_1.Release.v773, (0, combi_1.seq)("FUNCTION IMPORT", entity)),
3107
- (0, combi_1.ver)(version_1.Release.v773, (0, combi_1.seq)("FUNCTION RESULT", entity)),
3108
- (0, combi_1.ver)(version_1.Release.v773, (0, combi_1.seq)("ACTION RESULT", entity)),
3109
- (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("INSTANCE AUTHORIZATION KEY", entity)),
3110
- (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("INSTANCE AUTHORIZATION REQUEST", entity)),
3111
- (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("INSTANCE AUTHORIZATION RESULT", entity)),
3112
- (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("INSTANCE FEATURES KEY", entity)),
3113
- (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("INSTANCE FEATURES REQUEST", entity)),
3114
- (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("INSTANCE FEATURES RESULT", entity)),
3115
- (0, combi_1.ver)(version_1.Release.v780, (0, combi_1.seq)("AUTHORIZATION RESULT", entity)),
3116
- (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("AUTHORIZATION KEY", entity)),
3117
- (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("FEATURES RESULT", entity)),
3118
- (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("FEATURES KEY", entity)),
3119
- (0, combi_1.ver)(version_1.Release.v780, (0, combi_1.seq)("PERMISSIONS KEY", entity)),
3100
+ (0, combi_1.ver)(version_1.Release.v774, (0, combi_1.seq)("FAILED LATE", entity), { also: combi_1.AlsoIn.OpenABAP }),
3101
+ (0, combi_1.ver)(version_1.Release.v774, (0, combi_1.seq)("MAPPED LATE", entity), { also: combi_1.AlsoIn.OpenABAP }),
3102
+ (0, combi_1.ver)(version_1.Release.v774, (0, combi_1.seq)("REPORTED LATE", entity), { also: combi_1.AlsoIn.OpenABAP }),
3103
+ (0, combi_1.ver)(version_1.Release.v777, (0, combi_1.seq)("FAILED EARLY", entity), { also: combi_1.AlsoIn.OpenABAP }),
3104
+ (0, combi_1.ver)(version_1.Release.v777, (0, combi_1.seq)("MAPPED EARLY", entity), { also: combi_1.AlsoIn.OpenABAP }),
3105
+ (0, combi_1.ver)(version_1.Release.v777, (0, combi_1.seq)("REPORTED EARLY", entity), { also: combi_1.AlsoIn.OpenABAP }),
3106
+ (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("FAILED", entity), { also: combi_1.AlsoIn.OpenABAP }),
3107
+ (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("MAPPED", entity), { also: combi_1.AlsoIn.OpenABAP }),
3108
+ (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("REPORTED", entity), { also: combi_1.AlsoIn.OpenABAP }),
3109
+ (0, combi_1.ver)(version_1.Release.v773, (0, combi_1.seq)("FUNCTION IMPORT", entity), { also: combi_1.AlsoIn.OpenABAP }),
3110
+ (0, combi_1.ver)(version_1.Release.v773, (0, combi_1.seq)("FUNCTION RESULT", entity), { also: combi_1.AlsoIn.OpenABAP }),
3111
+ (0, combi_1.ver)(version_1.Release.v773, (0, combi_1.seq)("ACTION RESULT", entity), { also: combi_1.AlsoIn.OpenABAP }),
3112
+ (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("INSTANCE AUTHORIZATION KEY", entity), { also: combi_1.AlsoIn.OpenABAP }),
3113
+ (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("INSTANCE AUTHORIZATION REQUEST", entity), { also: combi_1.AlsoIn.OpenABAP }),
3114
+ (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("INSTANCE AUTHORIZATION RESULT", entity), { also: combi_1.AlsoIn.OpenABAP }),
3115
+ (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("INSTANCE FEATURES KEY", entity), { also: combi_1.AlsoIn.OpenABAP }),
3116
+ (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("INSTANCE FEATURES REQUEST", entity), { also: combi_1.AlsoIn.OpenABAP }),
3117
+ (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("INSTANCE FEATURES RESULT", entity), { also: combi_1.AlsoIn.OpenABAP }),
3118
+ (0, combi_1.ver)(version_1.Release.v780, (0, combi_1.seq)("AUTHORIZATION RESULT", entity), { also: combi_1.AlsoIn.OpenABAP }),
3119
+ (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("AUTHORIZATION KEY", entity), { also: combi_1.AlsoIn.OpenABAP }),
3120
+ (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("FEATURES RESULT", entity), { also: combi_1.AlsoIn.OpenABAP }),
3121
+ (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("FEATURES KEY", entity), { also: combi_1.AlsoIn.OpenABAP }),
3122
+ (0, combi_1.ver)(version_1.Release.v780, (0, combi_1.seq)("PERMISSIONS KEY", entity), { also: combi_1.AlsoIn.OpenABAP }),
3120
3123
  (0, combi_1.seq)("READ IMPORT", entity),
3121
3124
  (0, combi_1.seq)("READ RESULT", entity),
3122
- (0, combi_1.ver)(version_1.Release.v915, (0, combi_1.seq)("READ CHANGES", entity)),
3125
+ (0, combi_1.ver)(version_1.Release.v915, (0, combi_1.seq)("READ CHANGES", entity), { also: combi_1.AlsoIn.OpenABAP }),
3123
3126
  (0, combi_1.seq)("CREATE", entity),
3124
3127
  (0, combi_1.seq)("DELETE", entity),
3125
3128
  (0, combi_1.seq)("UPDATE", entity),
3126
- (0, combi_1.ver)(version_1.Release.v777, (0, combi_1.seq)("LOCK", entity)),
3127
- (0, combi_1.ver)(version_1.Release.v775, (0, combi_1.seq)("KEY OF", entity)),
3128
- (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("DETERMINATION", entity)),
3129
- (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("VALIDATION", entity)),
3130
- (0, combi_1.ver)(version_1.Release.v778, (0, combi_1.seq)("CHANGE", entity)),
3129
+ (0, combi_1.ver)(version_1.Release.v777, (0, combi_1.seq)("LOCK", entity), { also: combi_1.AlsoIn.OpenABAP }),
3130
+ (0, combi_1.ver)(version_1.Release.v775, (0, combi_1.seq)("KEY OF", entity), { also: combi_1.AlsoIn.OpenABAP }),
3131
+ (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("DETERMINATION", entity), { also: combi_1.AlsoIn.OpenABAP }),
3132
+ (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("VALIDATION", entity), { also: combi_1.AlsoIn.OpenABAP }),
3133
+ (0, combi_1.ver)(version_1.Release.v778, (0, combi_1.seq)("CHANGE", entity), { also: combi_1.AlsoIn.OpenABAP }),
3131
3134
  ];
3132
3135
  }
3133
3136
  function derivedTypesAlt(...extra) {
@@ -10777,10 +10780,10 @@ const _derived_types_1 = __webpack_require__(/*! ./_derived_types */ "../core/bu
10777
10780
  class TypeStructure extends combi_1.Expression {
10778
10781
  getRunnable() {
10779
10782
  const entity = (0, combi_1.alt)(_1.TypeName, _1.EntityAssociation);
10780
- const derivedTypes = (0, _derived_types_1.derivedTypesAlt)((0, combi_1.ver)(version_1.Release.v779, (0, combi_1.seq)("FUNCTION REQUEST", entity)), (0, combi_1.ver)(version_1.Release.v779, (0, combi_1.seq)("ACTION REQUEST", entity)), (0, combi_1.seq)("ACTION IMPORT", _1.Source), (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("GLOBAL AUTHORIZATION REQUEST", entity)), (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("GLOBAL AUTHORIZATION RESULT", entity)), (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("GLOBAL FEATURES REQUEST", entity)), (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("GLOBAL FEATURES RESULT", entity)), (0, combi_1.ver)(version_1.Release.v780, (0, combi_1.seq)("AUTHORIZATION REQUEST", entity)), (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("FEATURES REQUEST", entity)), (0, combi_1.seq)("PERMISSIONS REQUEST", _1.NamespaceSimpleName), (0, combi_1.ver)(version_1.Release.v780, (0, combi_1.seq)("PERMISSIONS RESULT", entity)), (0, combi_1.seq)("READ LINK", _1.EntityAssociation), (0, combi_1.seq)("HIERARCHY", _1.NamespaceSimpleName), (0, combi_1.seq)("EVENT", _1.EventName));
10781
- const structure = (0, combi_1.ver)(version_1.Release.v774, (0, combi_1.seq)("STRUCTURE FOR", derivedTypes));
10782
- const response = (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("RESPONSE FOR", (0, combi_1.altPrio)((0, combi_1.seq)("FAILED EARLY", _1.NamespaceSimpleName), (0, combi_1.seq)("FAILED LATE", _1.NamespaceSimpleName), (0, combi_1.seq)("FAILED", _1.NamespaceSimpleName), (0, combi_1.seq)("MAPPED EARLY", _1.NamespaceSimpleName), (0, combi_1.seq)("MAPPED LATE", _1.NamespaceSimpleName), (0, combi_1.seq)("MAPPED", _1.NamespaceSimpleName), (0, combi_1.seq)("REPORTED EARLY", _1.NamespaceSimpleName), (0, combi_1.seq)("REPORTED LATE", _1.NamespaceSimpleName), (0, combi_1.seq)("REPORTED", _1.NamespaceSimpleName))));
10783
- const request = (0, combi_1.ver)(version_1.Release.v778, (0, combi_1.seq)("REQUEST FOR", (0, combi_1.alt)("CHANGE", "DELETE"), _1.NamespaceSimpleName));
10783
+ const derivedTypes = (0, _derived_types_1.derivedTypesAlt)((0, combi_1.ver)(version_1.Release.v779, (0, combi_1.seq)("FUNCTION REQUEST", entity), { also: combi_1.AlsoIn.OpenABAP }), (0, combi_1.ver)(version_1.Release.v779, (0, combi_1.seq)("ACTION REQUEST", entity), { also: combi_1.AlsoIn.OpenABAP }), (0, combi_1.seq)("ACTION IMPORT", _1.Source), (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("GLOBAL AUTHORIZATION REQUEST", entity), { also: combi_1.AlsoIn.OpenABAP }), (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("GLOBAL AUTHORIZATION RESULT", entity), { also: combi_1.AlsoIn.OpenABAP }), (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("GLOBAL FEATURES REQUEST", entity), { also: combi_1.AlsoIn.OpenABAP }), (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("GLOBAL FEATURES RESULT", entity), { also: combi_1.AlsoIn.OpenABAP }), (0, combi_1.ver)(version_1.Release.v780, (0, combi_1.seq)("AUTHORIZATION REQUEST", entity), { also: combi_1.AlsoIn.OpenABAP }), (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("FEATURES REQUEST", entity), { also: combi_1.AlsoIn.OpenABAP }), (0, combi_1.seq)("PERMISSIONS REQUEST", _1.NamespaceSimpleName), (0, combi_1.ver)(version_1.Release.v780, (0, combi_1.seq)("PERMISSIONS RESULT", entity), { also: combi_1.AlsoIn.OpenABAP }), (0, combi_1.seq)("READ LINK", _1.EntityAssociation), (0, combi_1.seq)("HIERARCHY", _1.NamespaceSimpleName), (0, combi_1.seq)("EVENT", _1.EventName));
10784
+ const structure = (0, combi_1.ver)(version_1.Release.v774, (0, combi_1.seq)("STRUCTURE FOR", derivedTypes), { also: combi_1.AlsoIn.OpenABAP });
10785
+ const response = (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("RESPONSE FOR", (0, combi_1.altPrio)((0, combi_1.seq)("FAILED EARLY", _1.NamespaceSimpleName), (0, combi_1.seq)("FAILED LATE", _1.NamespaceSimpleName), (0, combi_1.seq)("FAILED", _1.NamespaceSimpleName), (0, combi_1.seq)("MAPPED EARLY", _1.NamespaceSimpleName), (0, combi_1.seq)("MAPPED LATE", _1.NamespaceSimpleName), (0, combi_1.seq)("MAPPED", _1.NamespaceSimpleName), (0, combi_1.seq)("REPORTED EARLY", _1.NamespaceSimpleName), (0, combi_1.seq)("REPORTED LATE", _1.NamespaceSimpleName), (0, combi_1.seq)("REPORTED", _1.NamespaceSimpleName))), { also: combi_1.AlsoIn.OpenABAP });
10786
+ const request = (0, combi_1.ver)(version_1.Release.v778, (0, combi_1.seq)("REQUEST FOR", (0, combi_1.alt)("CHANGE", "DELETE"), _1.NamespaceSimpleName), { also: combi_1.AlsoIn.OpenABAP });
10784
10787
  return (0, combi_1.seq)("TYPE", (0, combi_1.altPrio)(structure, response, request), (0, combi_1.optPrio)("VALUE IS INITIAL"));
10785
10788
  }
10786
10789
  }
@@ -10819,7 +10822,7 @@ class TypeTable extends combi_1.Expression {
10819
10822
  const typetable = (0, combi_1.alt)(generic, (0, combi_1.seq)(normal1, (0, combi_1.alt)((0, combi_1.opt)((0, combi_1.per)(header, initial, (0, combi_1.plusPrio)(type_table_key_1.TypeTableKey))), (0, combi_1.seq)((0, combi_1.plus)(type_table_key_1.TypeTableKey), (0, combi_1.optPrio)(initial))), (0, combi_1.optPrio)("VALUE IS INITIAL")));
10820
10823
  const occurs = (0, combi_1.seq)("OCCURS", (0, combi_1.altPrio)(_1.Integer, field_chain_1.FieldChain));
10821
10824
  const entity = (0, combi_1.alt)(_1.TypeName, _1.EntityAssociation);
10822
- const derivedTypes = (0, _derived_types_1.derivedTypesAlt)((0, combi_1.ver)(version_1.Release.v773, (0, combi_1.seq)("ACTION IMPORT", entity)), (0, combi_1.ver)(version_1.Release.v774, (0, combi_1.seq)("READ LINK", entity)), (0, combi_1.ver)(version_1.Release.v787, (0, combi_1.seq)("EVENT", entity)));
10825
+ const derivedTypes = (0, _derived_types_1.derivedTypesAlt)((0, combi_1.ver)(version_1.Release.v773, (0, combi_1.seq)("ACTION IMPORT", entity), { also: combi_1.AlsoIn.OpenABAP }), (0, combi_1.ver)(version_1.Release.v774, (0, combi_1.seq)("READ LINK", entity), { also: combi_1.AlsoIn.OpenABAP }), (0, combi_1.ver)(version_1.Release.v787, (0, combi_1.seq)("EVENT", entity), { also: combi_1.AlsoIn.OpenABAP }));
10823
10826
  const derived = (0, combi_1.ver)(version_1.Release.v770, (0, combi_1.seq)("TABLE FOR", derivedTypes, (0, combi_1.optPrio)("VALUE IS INITIAL")), { also: combi_1.AlsoIn.OpenABAP });
10824
10827
  const oldType = (0, combi_1.seq)((0, combi_1.opt)("REF TO"), _1.TypeName, (0, combi_1.alt)((0, combi_1.seq)(occurs, (0, combi_1.opt)(header)), header));
10825
10828
  const oldLike = (0, combi_1.seq)((0, combi_1.opt)("REF TO"), field_chain_1.FieldChain, (0, combi_1.alt)((0, combi_1.seq)(occurs, (0, combi_1.opt)(header)), header));
@@ -47722,6 +47725,105 @@ exports.ArtifactsABAP = ArtifactsABAP;
47722
47725
 
47723
47726
  /***/ },
47724
47727
 
47728
+ /***/ "../core/build/src/abap/cross_include_macros.js"
47729
+ /*!******************************************************!*\
47730
+ !*** ../core/build/src/abap/cross_include_macros.js ***!
47731
+ \******************************************************/
47732
+ (__unused_webpack_module, exports, __webpack_require__) {
47733
+
47734
+ "use strict";
47735
+
47736
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
47737
+ exports.CrossIncludeMacros = void 0;
47738
+ const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "../core/build/src/objects/_abap_object.js");
47739
+ const program_1 = __webpack_require__(/*! ../objects/program */ "../core/build/src/objects/program.js");
47740
+ const _statement_1 = __webpack_require__(/*! ./2_statements/statements/_statement */ "../core/build/src/abap/2_statements/statements/_statement.js");
47741
+ const expand_macros_1 = __webpack_require__(/*! ./2_statements/expand_macros */ "../core/build/src/abap/2_statements/expand_macros.js");
47742
+ const include_graph_1 = __webpack_require__(/*! ../utils/include_graph */ "../core/build/src/utils/include_graph.js");
47743
+ // Macros can be defined in one include and used in a sibling include, connected
47744
+ // via the main program. Objects are parsed in isolation, so the sibling include
47745
+ // initially ends up with Unknown statements. This second pass finds the main
47746
+ // program(s) for such includes, collects the macro definitions visible there,
47747
+ // and re-parses the include with the macro names as extra global macros.
47748
+ class CrossIncludeMacros {
47749
+ constructor(reg) {
47750
+ this.reg = reg;
47751
+ }
47752
+ run() {
47753
+ const candidates = this.findCandidates();
47754
+ if (candidates.length === 0) {
47755
+ return;
47756
+ }
47757
+ const graph = new include_graph_1.IncludeGraph(this.reg);
47758
+ const config = this.reg.getConfig();
47759
+ const globalMacros = config.getSyntaxSetttings().globalMacros || [];
47760
+ for (const prog of candidates) {
47761
+ const mains = this.findMains(graph, prog);
47762
+ if (mains.size === 0) {
47763
+ continue;
47764
+ }
47765
+ const expand = new expand_macros_1.ExpandMacros(globalMacros, config.getRelease(), this.reg, config.getLanguageVersion());
47766
+ for (const main of mains) {
47767
+ for (const file of main.getABAPFiles()) {
47768
+ // find() follows INCLUDE statements, so this collects macros from the full include chain
47769
+ expand.find([...file.getStatements()], file, false);
47770
+ }
47771
+ }
47772
+ const macroNames = expand.listMacroNames();
47773
+ if (this.matchesUnknown(prog, new Set(macroNames))) {
47774
+ prog.setDirty();
47775
+ prog.parse(config.getRelease(), macroNames, this.reg, config.getLanguageVersion());
47776
+ }
47777
+ }
47778
+ }
47779
+ //////////////////////////////
47780
+ findCandidates() {
47781
+ const ret = [];
47782
+ for (const obj of this.reg.getObjects()) {
47783
+ if (!(obj instanceof program_1.Program) || obj.isInclude() === false) {
47784
+ continue;
47785
+ }
47786
+ for (const file of obj.getABAPFiles()) {
47787
+ if (file.getStatements().some(s => s.get() instanceof _statement_1.Unknown)) {
47788
+ ret.push(obj);
47789
+ break;
47790
+ }
47791
+ }
47792
+ }
47793
+ return ret;
47794
+ }
47795
+ findMains(graph, prog) {
47796
+ var _a;
47797
+ const ret = new Set();
47798
+ const filename = (_a = prog.getMainABAPFile()) === null || _a === void 0 ? void 0 : _a.getFilename();
47799
+ for (const mainFilename of graph.listMainForInclude(filename)) {
47800
+ const file = this.reg.getFileByName(mainFilename);
47801
+ const obj = file ? this.reg.findObjectForFile(file) : undefined;
47802
+ if (obj instanceof _abap_object_1.ABAPObject) {
47803
+ ret.add(obj);
47804
+ }
47805
+ }
47806
+ return ret;
47807
+ }
47808
+ matchesUnknown(prog, macroNames) {
47809
+ for (const file of prog.getABAPFiles()) {
47810
+ for (const s of file.getStatements()) {
47811
+ if (s.get() instanceof _statement_1.Unknown) {
47812
+ const name = expand_macros_1.ExpandMacros.findName(s.getTokens());
47813
+ if (name !== undefined && macroNames.has(name.toUpperCase())) {
47814
+ return true;
47815
+ }
47816
+ }
47817
+ }
47818
+ }
47819
+ return false;
47820
+ }
47821
+ }
47822
+ exports.CrossIncludeMacros = CrossIncludeMacros;
47823
+ //# sourceMappingURL=cross_include_macros.js.map
47824
+
47825
+ /***/ },
47826
+
47725
47827
  /***/ "../core/build/src/abap/nodes/_abstract_node.js"
47726
47828
  /*!******************************************************!*\
47727
47829
  !*** ../core/build/src/abap/nodes/_abstract_node.js ***!
@@ -52797,6 +52899,12 @@ class CDSParser {
52797
52899
  if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {
52798
52900
  res = combi_1.Combi.run(new Expressions.CDSDefineHierarchy(), tokens, version_1.defaultRelease);
52799
52901
  }
52902
+ if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {
52903
+ res = combi_1.Combi.run(new Expressions.CDSDefineExternalEntity(), tokens, version_1.defaultRelease);
52904
+ }
52905
+ if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {
52906
+ res = combi_1.Combi.run(new Expressions.CDSDefineTableEntity(), tokens, version_1.defaultRelease);
52907
+ }
52800
52908
  if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {
52801
52909
  return undefined;
52802
52910
  }
@@ -52822,12 +52930,10 @@ const _1 = __webpack_require__(/*! . */ "../core/build/src/cds/expressions/index
52822
52930
  const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
52823
52931
  class CDSAggregate extends combi_1.Expression {
52824
52932
  getRunnable() {
52825
- // CDSPrefixedName handles dotted paths with path filters e.g. a._Assoc[filter].Field
52826
- // CDSArithmetics handles expressions like sum(A + B), max(A * 100)
52827
- // fieldAsType handles avg(field AS type) / sum(field AS type) — SAP inline type coercion
52828
52933
  const fieldAsType = (0, combi_1.seq)(_1.CDSPrefixedName, "AS", _1.CDSType);
52829
- const value = (0, combi_1.altPrio)(_1.CDSArithmetics, _1.CDSCast, _1.CDSCase, _1.CDSFunction, fieldAsType, _1.CDSPrefixedName, _1.CDSString, "*");
52830
- return (0, combi_1.seq)((0, combi_1.altPrio)("MAX", "MIN", "SUM", "AVG", "COUNT"), "(", (0, combi_1.optPrio)((0, combi_1.altPrio)("DISTINCT", "ALL")), value, ")");
52934
+ const funcAsType = (0, combi_1.seq)(_1.CDSFunction, "AS", _1.CDSType);
52935
+ const value = (0, combi_1.altPrio)(_1.CDSArithmetics, _1.CDSCast, _1.CDSCase, funcAsType, _1.CDSFunction, fieldAsType, _1.CDSPrefixedName, _1.CDSString, "*");
52936
+ return (0, combi_1.seq)((0, combi_1.altPrio)("MAX", "MIN", "SUM", "AVG", "COUNT"), "(", (0, combi_1.optPrio)((0, combi_1.altPrio)("DISTINCT", "ALL")), value, (0, combi_1.opt)((0, combi_1.seq)("AS", _1.CDSType)), ")");
52831
52937
  }
52832
52938
  }
52833
52939
  exports.CDSAggregate = CDSAggregate;
@@ -53286,7 +53392,7 @@ class CDSDefineAbstract extends combi_1.Expression {
53286
53392
  getRunnable() {
53287
53393
  const field = (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.optPrio)((0, combi_1.str)("KEY")), cds_name_1.CDSName, ":", _1.CDSType, ";");
53288
53394
  const compsiOrAssoci = (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), cds_name_1.CDSName, ":", (0, combi_1.alt)(_1.CDSComposition, _1.CDSAssociation), ";");
53289
- return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), "DEFINE", (0, combi_1.opt)("ROOT"), "ABSTRACT", "ENTITY", cds_name_1.CDSName, (0, combi_1.str)("{"), (0, combi_1.plus)((0, combi_1.alt)(field, compsiOrAssoci)), (0, combi_1.str)("}"), (0, combi_1.opt)(";"));
53395
+ return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), "DEFINE", (0, combi_1.opt)("ROOT"), "ABSTRACT", "ENTITY", cds_name_1.CDSName, (0, combi_1.opt)(_1.CDSWithParameters), (0, combi_1.str)("{"), (0, combi_1.plus)((0, combi_1.alt)(field, compsiOrAssoci)), (0, combi_1.str)("}"), (0, combi_1.opt)(";"));
53290
53396
  }
53291
53397
  }
53292
53398
  exports.CDSDefineAbstract = CDSDefineAbstract;
@@ -53320,6 +53426,36 @@ exports.CDSDefineCustom = CDSDefineCustom;
53320
53426
 
53321
53427
  /***/ },
53322
53428
 
53429
+ /***/ "../core/build/src/cds/expressions/cds_define_external_entity.js"
53430
+ /*!***********************************************************************!*\
53431
+ !*** ../core/build/src/cds/expressions/cds_define_external_entity.js ***!
53432
+ \***********************************************************************/
53433
+ (__unused_webpack_module, exports, __webpack_require__) {
53434
+
53435
+ "use strict";
53436
+
53437
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
53438
+ exports.CDSDefineExternalEntity = void 0;
53439
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/cds/expressions/index.js");
53440
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
53441
+ class CDSDefineExternalEntity extends combi_1.Expression {
53442
+ getRunnable() {
53443
+ const extNameValue = (0, combi_1.alt)(_1.CDSName, (0, combi_1.regex)(/^"[^"]*"$/));
53444
+ const externalName = (0, combi_1.seq)("EXTERNAL", "NAME", extNameValue);
53445
+ const nullability = (0, combi_1.optPrio)((0, combi_1.alt)("NOT NULL", "NULL"));
53446
+ const field = (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.optPrio)((0, combi_1.str)("KEY")), _1.CDSName, ":", _1.CDSType, nullability, (0, combi_1.optPrio)(externalName), ";");
53447
+ const assocOrComp = (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), _1.CDSName, ":", (0, combi_1.alt)(_1.CDSComposition, _1.CDSAssociation), ";");
53448
+ const body = (0, combi_1.plus)((0, combi_1.alt)(field, assocOrComp));
53449
+ const externalEntity = (0, combi_1.seq)((0, combi_1.opt)("WRITABLE"), "EXTERNAL", "ENTITY", _1.CDSName, (0, combi_1.opt)(externalName), (0, combi_1.opt)(_1.CDSWithParameters));
53450
+ const staticEntity = (0, combi_1.seq)("STATIC", "ENTITY", _1.CDSName, (0, combi_1.opt)(externalName));
53451
+ return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), "DEFINE", (0, combi_1.alt)(externalEntity, staticEntity), (0, combi_1.str)("{"), body, (0, combi_1.str)("}"), (0, combi_1.opt)((0, combi_1.seq)("WITH", "FEDERATED", "DATA", (0, combi_1.optPrio)((0, combi_1.alt)((0, combi_1.seq)("PROVIDED", "AT", "RUNTIME"), (0, combi_1.seq)("PROVIDED", "BY", _1.CDSName))))), (0, combi_1.opt)(";"));
53452
+ }
53453
+ }
53454
+ exports.CDSDefineExternalEntity = CDSDefineExternalEntity;
53455
+ //# sourceMappingURL=cds_define_external_entity.js.map
53456
+
53457
+ /***/ },
53458
+
53323
53459
  /***/ "../core/build/src/cds/expressions/cds_define_hierarchy.js"
53324
53460
  /*!*****************************************************************!*\
53325
53461
  !*** ../core/build/src/cds/expressions/cds_define_hierarchy.js ***!
@@ -53339,7 +53475,13 @@ class CDSDefineHierarchy extends combi_1.Expression {
53339
53475
  const siblingsOrderField = (0, combi_1.seq)(_1.CDSPrefixedName, (0, combi_1.optPrio)(sortDirection));
53340
53476
  const siblingsOrder = (0, combi_1.seq)("SIBLINGS", "ORDER", "BY", siblingsOrderField, (0, combi_1.star)((0, combi_1.seq)(",", siblingsOrderField)));
53341
53477
  const directory = (0, combi_1.seq)("DIRECTORY", _1.CDSName, "FILTER", "BY", _1.CDSCondition);
53342
- const hierarchyBody = (0, combi_1.seq)("SOURCE", _1.CDSName, (0, combi_1.opt)(_1.CDSParametersSelect), "CHILD", "TO", "PARENT", "ASSOCIATION", _1.CDSName, (0, combi_1.opt)(directory), (0, combi_1.opt)((0, combi_1.seq)("START", "WHERE", _1.CDSCondition)), (0, combi_1.opt)(siblingsOrder), (0, combi_1.opt)((0, combi_1.seq)("NODETYPE", _1.CDSName)), (0, combi_1.opt)((0, combi_1.seq)("DEPTH", _1.CDSInteger)), (0, combi_1.opt)((0, combi_1.seq)("MULTIPLE", "PARENTS", (0, combi_1.altPrio)("NOT ALLOWED", "ALLOWED"))), (0, combi_1.opt)((0, combi_1.seq)("ORPHANS", (0, combi_1.altPrio)("IGNORE", "ROOT"))), (0, combi_1.opt)((0, combi_1.seq)("CYCLES", "BREAKUP")), (0, combi_1.opt)((0, combi_1.seq)("CACHE", (0, combi_1.altPrio)("FORCE", "NONE", "EMPTY", "OFF"))));
53478
+ // DATE PERIOD: period from <field> to <field> [valid from :p to :p]
53479
+ const datePeriod = (0, combi_1.seq)("PERIOD", "FROM", _1.CDSName, "TO", _1.CDSName, (0, combi_1.opt)((0, combi_1.seq)("VALID", "FROM", _1.CDSPrefixedName, "TO", _1.CDSPrefixedName)));
53480
+ // DEPTH accepts an integer literal or a parameter reference (:param)
53481
+ const depthValue = (0, combi_1.altPrio)(_1.CDSInteger, _1.CDSPrefixedName);
53482
+ // LOAD mode: BULK, INCREMENTAL, or a parameter reference ($parameters.p_load)
53483
+ const loadMode = (0, combi_1.altPrio)("BULK", "INCREMENTAL", _1.CDSPrefixedName);
53484
+ const hierarchyBody = (0, combi_1.seq)("SOURCE", _1.CDSName, (0, combi_1.opt)(_1.CDSParametersSelect), "CHILD", "TO", "PARENT", "ASSOCIATION", _1.CDSName, (0, combi_1.opt)(directory), (0, combi_1.opt)(datePeriod), (0, combi_1.opt)((0, combi_1.seq)("START", "WHERE", _1.CDSCondition)), (0, combi_1.opt)(siblingsOrder), (0, combi_1.opt)((0, combi_1.seq)("LOAD", loadMode)), (0, combi_1.opt)((0, combi_1.seq)("NODETYPE", _1.CDSName)), (0, combi_1.opt)((0, combi_1.seq)("DEPTH", depthValue)), (0, combi_1.opt)((0, combi_1.seq)("MULTIPLE", "PARENTS", (0, combi_1.altPrio)("NOT ALLOWED", "ALLOWED", (0, combi_1.seq)("LEAVES", (0, combi_1.optPrio)("ONLY"))))), (0, combi_1.opt)((0, combi_1.seq)("ORPHANS", (0, combi_1.altPrio)("IGNORE", "ROOT", "ERROR"))), (0, combi_1.opt)((0, combi_1.seq)("CYCLES", (0, combi_1.altPrio)("BREAKUP", "ERROR"))), (0, combi_1.opt)((0, combi_1.seq)("GENERATE", "SPANTREE")), (0, combi_1.opt)((0, combi_1.seq)("CACHE", (0, combi_1.altPrio)("ON", "OFF", "FORCE"))));
53343
53485
  return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), "DEFINE", "HIERARCHY", _1.CDSName, (0, combi_1.opt)(_1.CDSWithParameters), "AS", "PARENT", "CHILD", "HIERARCHY", "(", hierarchyBody, ")", "{", (0, combi_1.seq)(field, (0, combi_1.star)((0, combi_1.seq)(",", field))), "}", (0, combi_1.opt)(";"));
53344
53486
  }
53345
53487
  }
@@ -53363,7 +53505,9 @@ const __1 = __webpack_require__(/*! ../.. */ "../core/build/src/index.js");
53363
53505
  const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
53364
53506
  class CDSDefineProjection extends combi_1.Expression {
53365
53507
  getRunnable() {
53366
- return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), "DEFINE", (0, combi_1.opt)("ROOT"), (0, combi_1.opt)("TRANSIENT"), "VIEW", (0, combi_1.ver)(__1.Release.v755, (0, combi_1.opt)("ENTITY")), _1.CDSName, (0, combi_1.opt)(_1.CDSProviderContract), (0, combi_1.opt)(_1.CDSWithParameters), "AS PROJECTION ON", _1.CDSName, (0, combi_1.opt)(_1.CDSParametersSelect), (0, combi_1.opt)(_1.CDSAs), (0, combi_1.star)(_1.CDSAssociation), (0, combi_1.str)("{"), (0, combi_1.seq)(_1.CDSElement, (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.opt)(",")), (0, combi_1.str)("}"), (0, combi_1.opt)(_1.CDSWhere), (0, combi_1.opt)(";"));
53508
+ // redefine association _Assoc redirected to [composition child | parent] Entity
53509
+ const redefineAssoc = (0, combi_1.seq)("REDEFINE", "ASSOCIATION", _1.CDSName, "REDIRECTED", "TO", (0, combi_1.optPrio)((0, combi_1.altPrio)((0, combi_1.seq)("COMPOSITION", "CHILD"), "PARENT")), _1.CDSName);
53510
+ return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), "DEFINE", (0, combi_1.opt)("ROOT"), (0, combi_1.opt)("TRANSIENT"), "VIEW", (0, combi_1.ver)(__1.Release.v755, (0, combi_1.opt)("ENTITY")), _1.CDSName, (0, combi_1.opt)(_1.CDSProviderContract), (0, combi_1.opt)(_1.CDSWithParameters), "AS PROJECTION ON", _1.CDSName, (0, combi_1.opt)(_1.CDSParametersSelect), (0, combi_1.opt)(_1.CDSAs), (0, combi_1.star)((0, combi_1.altPrio)(_1.CDSAssociation, redefineAssoc)), (0, combi_1.str)("{"), (0, combi_1.seq)(_1.CDSElement, (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.opt)(",")), (0, combi_1.str)("}"), (0, combi_1.opt)(_1.CDSWhere), (0, combi_1.opt)(";"));
53367
53511
  }
53368
53512
  }
53369
53513
  exports.CDSDefineProjection = CDSDefineProjection;
@@ -53371,6 +53515,35 @@ exports.CDSDefineProjection = CDSDefineProjection;
53371
53515
 
53372
53516
  /***/ },
53373
53517
 
53518
+ /***/ "../core/build/src/cds/expressions/cds_define_table_entity.js"
53519
+ /*!********************************************************************!*\
53520
+ !*** ../core/build/src/cds/expressions/cds_define_table_entity.js ***!
53521
+ \********************************************************************/
53522
+ (__unused_webpack_module, exports, __webpack_require__) {
53523
+
53524
+ "use strict";
53525
+
53526
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
53527
+ exports.CDSDefineTableEntity = void 0;
53528
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/cds/expressions/index.js");
53529
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
53530
+ class CDSDefineTableEntity extends combi_1.Expression {
53531
+ getRunnable() {
53532
+ const nullability = (0, combi_1.optPrio)((0, combi_1.alt)("NOT NULL", "NULL"));
53533
+ const field = (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.optPrio)((0, combi_1.str)("KEY")), _1.CDSName, ":", _1.CDSType, nullability, ";");
53534
+ const assocOrComp = (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), _1.CDSName, ":", (0, combi_1.alt)(_1.CDSComposition, _1.CDSAssociation), ";");
53535
+ const inlineBody = (0, combi_1.plus)((0, combi_1.alt)(field, assocOrComp));
53536
+ const elementList = (0, combi_1.seq)(_1.CDSElement, (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.opt)(","));
53537
+ const elements = (0, combi_1.seq)((0, combi_1.str)("{"), (0, combi_1.altPrio)("*", elementList), (0, combi_1.str)("}"));
53538
+ const selectBody = (0, combi_1.seq)("AS", "SELECT", "FROM", _1.CDSSource, (0, combi_1.star)(_1.CDSJoin), (0, combi_1.star)((0, combi_1.altPrio)(_1.CDSComposition, _1.CDSAssociation)), (0, combi_1.opt)(elements), (0, combi_1.optPrio)(_1.CDSWhere));
53539
+ return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), "DEFINE", (0, combi_1.opt)("ROOT"), "TABLE", "ENTITY", _1.CDSName, (0, combi_1.opt)(_1.CDSWithParameters), (0, combi_1.altPrio)((0, combi_1.seq)((0, combi_1.str)("{"), inlineBody, (0, combi_1.str)("}")), selectBody), (0, combi_1.opt)(";"));
53540
+ }
53541
+ }
53542
+ exports.CDSDefineTableEntity = CDSDefineTableEntity;
53543
+ //# sourceMappingURL=cds_define_table_entity.js.map
53544
+
53545
+ /***/ },
53546
+
53374
53547
  /***/ "../core/build/src/cds/expressions/cds_define_table_function.js"
53375
53548
  /*!**********************************************************************!*\
53376
53549
  !*** ../core/build/src/cds/expressions/cds_define_table_function.js ***!
@@ -53414,7 +53587,8 @@ const cds_with_parameters_1 = __webpack_require__(/*! ./cds_with_parameters */ "
53414
53587
  class CDSDefineView extends combi_1.Expression {
53415
53588
  getRunnable() {
53416
53589
  const columnAlias = (0, combi_1.seq)("(", cds_name_1.CDSName, (0, combi_1.star)((0, combi_1.seq)(",", cds_name_1.CDSName)), ")");
53417
- return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.opt)("DEFINE"), (0, combi_1.opt)("ROOT"), "VIEW", (0, combi_1.ver)(__1.Release.v755, (0, combi_1.opt)("ENTITY")), cds_name_1.CDSName, (0, combi_1.opt)(columnAlias), (0, combi_1.opt)(cds_with_parameters_1.CDSWithParameters), "AS", cds_select_1.CDSSelect, (0, combi_1.opt)(";"));
53590
+ return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.opt)("DEFINE"), (0, combi_1.opt)("ROOT"), (0, combi_1.opt)("WRITABLE"), "VIEW", (0, combi_1.ver)(__1.Release.v755, (0, combi_1.opt)("ENTITY")), cds_name_1.CDSName, (0, combi_1.opt)(columnAlias), (0, combi_1.opt)(cds_with_parameters_1.CDSWithParameters), "AS", cds_select_1.CDSSelect, (0, combi_1.opt)((0, combi_1.seq)("WITH", "HIERARCHY", cds_name_1.CDSName)), // post-select WITH HIERARCHY clause
53591
+ (0, combi_1.opt)(";"));
53418
53592
  }
53419
53593
  }
53420
53594
  exports.CDSDefineView = CDSDefineView;
@@ -53440,14 +53614,11 @@ class CDSElement extends combi_1.Expression {
53440
53614
  getRunnable() {
53441
53615
  const redirected = (0, combi_1.seq)(": REDIRECTED TO", (0, combi_1.optPrio)((0, combi_1.altPrio)("PARENT", "COMPOSITION CHILD")), _1.CDSName);
53442
53616
  const colonThing = (0, combi_1.seq)(":", (0, combi_1.altPrio)(_1.CDSType, _1.CDSName, "LOCALIZED"));
53443
- // $extension.* — extension field wildcard
53444
53617
  const extensionWildcard = (0, combi_1.seq)("$extension", ".", "*");
53445
- const body = (0, combi_1.altPrio)(extensionWildcard, _1.CDSArithmetics, _1.CDSAggregate, _1.CDSString, _1.CDSArithParen, _1.CDSFunction, cds_cast_1.CDSCast, _1.CDSCase, (0, combi_1.seq)("(", _1.CDSCase, ")"), (0, combi_1.seq)(_1.CDSPrefixedName, (0, combi_1.optPrio)(cds_as_1.CDSAs), (0, combi_1.optPrio)((0, combi_1.altPrio)(redirected, colonThing))), _1.CDSInteger);
53446
- // KEY/VIRTUAL keyword handling via altPrio:
53447
- // - Try keyword form first: if keyword consumed but body fails (e.g. "virtual.Field"),
53448
- // altPrio backtracks to plain body (which handles "virtual" as a datasource alias prefix).
53449
- // - This gives exactly 1 state in all cases (no exponential blowup from opt()).
53450
- const elementBody = (0, combi_1.altPrio)((0, combi_1.seq)((0, combi_1.altPrio)("KEY", "VIRTUAL"), body), body);
53618
+ const includeElement = (0, combi_1.seq)("INCLUDE", _1.CDSPrefixedName);
53619
+ const typedVirtual = (0, combi_1.seq)("VIRTUAL", _1.CDSName, ":", _1.CDSType);
53620
+ const body = (0, combi_1.altPrio)(extensionWildcard, includeElement, _1.CDSArithmetics, _1.CDSAggregate, _1.CDSString, _1.CDSArithParen, _1.CDSFunction, cds_cast_1.CDSCast, _1.CDSCase, (0, combi_1.seq)("(", _1.CDSCase, ")"), (0, combi_1.seq)(_1.CDSPrefixedName, (0, combi_1.optPrio)(cds_as_1.CDSAs), (0, combi_1.optPrio)((0, combi_1.altPrio)(redirected, colonThing))), _1.CDSInteger);
53621
+ const elementBody = (0, combi_1.altPrio)(typedVirtual, (0, combi_1.seq)((0, combi_1.altPrio)("KEY", "VIRTUAL"), body), body);
53451
53622
  return (0, combi_1.seq)((0, combi_1.starPrio)(_1.CDSAnnotation), elementBody, (0, combi_1.optPrio)(cds_as_1.CDSAs));
53452
53623
  }
53453
53624
  }
@@ -53468,12 +53639,17 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
53468
53639
  exports.CDSExtendView = void 0;
53469
53640
  const _1 = __webpack_require__(/*! . */ "../core/build/src/cds/expressions/index.js");
53470
53641
  const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
53471
- const cds_name_1 = __webpack_require__(/*! ./cds_name */ "../core/build/src/cds/expressions/cds_name.js");
53472
53642
  class CDSExtendView extends combi_1.Expression {
53473
53643
  getRunnable() {
53474
- const namedot = (0, combi_1.seq)(cds_name_1.CDSName, (0, combi_1.optPrio)((0, combi_1.seq)(".", cds_name_1.CDSName)), (0, combi_1.optPrio)(_1.CDSAs));
53644
+ const namedot = (0, combi_1.seq)(_1.CDSName, (0, combi_1.optPrio)((0, combi_1.seq)(".", _1.CDSName)), (0, combi_1.optPrio)(_1.CDSAs));
53475
53645
  const valueNested = (0, combi_1.seq)("{", namedot, (0, combi_1.star)((0, combi_1.seq)(",", namedot)), "}");
53476
- return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.str)("EXTEND VIEW"), (0, combi_1.opt)((0, combi_1.str)("ENTITY")), cds_name_1.CDSName, (0, combi_1.str)("WITH"), (0, combi_1.opt)(cds_name_1.CDSName), valueNested, (0, combi_1.opt)(";"));
53646
+ const redefineAssoc = (0, combi_1.seq)("REDEFINE", "ASSOCIATION", _1.CDSPrefixedName, (0, combi_1.optPrio)((0, combi_1.seq)("[", _1.CDSCondition, "]")), (0, combi_1.opt)(_1.CDSAs), "REDIRECTED", "TO", (0, combi_1.optPrio)((0, combi_1.altPrio)((0, combi_1.seq)("COMPOSITION", "CHILD"), "PARENT")), _1.CDSName);
53647
+ const extendView = (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.str)("EXTEND VIEW"), (0, combi_1.opt)((0, combi_1.str)("ENTITY")), _1.CDSName, (0, combi_1.str)("WITH"), (0, combi_1.opt)(_1.CDSName), (0, combi_1.star)(redefineAssoc), valueNested, (0, combi_1.opt)(";"));
53648
+ const field = (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.optPrio)((0, combi_1.str)("KEY")), _1.CDSName, ":", _1.CDSType, ";");
53649
+ const assocOrComp = (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), _1.CDSName, ":", (0, combi_1.alt)(_1.CDSComposition, _1.CDSAssociation), ";");
53650
+ const entityBody = (0, combi_1.seq)("{", (0, combi_1.plus)((0, combi_1.alt)(field, assocOrComp)), "}");
53651
+ const extendAbstractOrCustom = (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), "EXTEND", (0, combi_1.alt)("ABSTRACT", "CUSTOM"), "ENTITY", _1.CDSName, (0, combi_1.opt)(_1.CDSWithParameters), "WITH", entityBody, (0, combi_1.opt)(";"));
53652
+ return (0, combi_1.alt)(extendAbstractOrCustom, extendView);
53477
53653
  }
53478
53654
  }
53479
53655
  exports.CDSExtendView = CDSExtendView;
@@ -53548,12 +53724,13 @@ class CDSFunction extends combi_1.Expression {
53548
53724
  const occurrencesRegexpr = (0, combi_1.seq)("OCCURRENCES_REGEXPR", "(", conversionInputs, ")");
53549
53725
  const substrRegexpr = (0, combi_1.seq)("SUBSTR_REGEXPR", "(", conversionInputs, ")");
53550
53726
  const locateRegexpr = (0, combi_1.seq)("LOCATE_REGEXPR", "(", conversionInputs, ")");
53551
- // Generic fallback: user-defined/extension functions like GET_NUMERIC_VALUE(arg).
53552
- // Use a regex that excludes CDS keywords that would otherwise be matched by CDSName.
53553
- // Must contain at least one underscore to distinguish from keywords (e.g. GET_NUMERIC_VALUE).
53554
53727
  const extFuncName = (0, combi_1.regex)(/^[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)+$/i);
53555
53728
  const genericArgs = (0, combi_1.seq)(_1.CDSFunctionInput, (0, combi_1.starPrio)((0, combi_1.seq)(",", _1.CDSFunctionInput)));
53556
- const genericFunc = (0, combi_1.seq)(extFuncName, "(", genericArgs, ")");
53729
+ const namedArgValue = (0, combi_1.altPrio)((0, combi_1.seq)("INTERVAL", _1.CDSFunctionInput, _1.CDSName), _1.CDSFunctionInput, _1.CDSName);
53730
+ const namedArgArrow = (0, combi_1.seq)(_1.CDSName, "=", ">", namedArgValue);
53731
+ const namedArgColon = (0, combi_1.seq)(_1.CDSName, ":", namedArgValue);
53732
+ const namedArgs = (0, combi_1.seq)((0, combi_1.altPrio)(namedArgArrow, namedArgColon), (0, combi_1.starPrio)((0, combi_1.seq)(",", (0, combi_1.altPrio)(namedArgArrow, namedArgColon))));
53733
+ const genericFunc = (0, combi_1.seq)(extFuncName, "(", (0, combi_1.optPrio)((0, combi_1.altPrio)(namedArgs, genericArgs)), ")");
53557
53734
  return (0, combi_1.altPrio)(substring, coalesce, tstmp_to_dats, concat, tstmp_to_tims, upper, lower, abs, ceil, floor, round, div, division, concat_with_space, dats_is_valid, tims_is_valid, dats_days_between, tstmp_add_seconds, tstmp_seconds_between, tstmp_current_utctimestamp, tstmp_is_valid, utcl_current, abap_system_timezone, abap_user_timezone, bintohex, hextobin, dats_add_days, dats_add_months, tstmp_to_dst, dats_tims_to_tstmp, mod, left, right, lpad, rpad, instr, length, ltrim, rtrim, replace, unitConversion, currencyConversion, decimalShift, fltp_to_dec, ratioOf, replaceRegexpr, matchesRegexpr, occurrencesRegexpr, substrRegexpr, locateRegexpr, curr_to_decfloat_amount, genericFunc);
53558
53735
  }
53559
53736
  }
@@ -53785,31 +53962,18 @@ const cds_integer_1 = __webpack_require__(/*! ./cds_integer */ "../core/build/sr
53785
53962
  const cds_string_1 = __webpack_require__(/*! ./cds_string */ "../core/build/src/cds/expressions/cds_string.js");
53786
53963
  class CDSPrefixedName extends combi_1.Expression {
53787
53964
  getRunnable() {
53788
- // Path filter variants:
53789
- // [inner], [left outer], [cross] — join-type redirect
53790
- // [1:left outer], [1:inner] — cardinality + join-type
53791
- // [1: condition] — cardinality + filter condition
53792
- // [condition] — filter condition only
53793
53965
  const joinType = (0, combi_1.altPrio)("LEFT OUTER", "INNER", "CROSS");
53794
53966
  const joinRedirect = (0, combi_1.seq)("[", joinType, "]");
53795
- // Cardinality spec: integer or * (e.g. [*:inner], [1:inner])
53796
53967
  const cardSpec = (0, combi_1.altPrio)(cds_integer_1.CDSInteger, "*");
53797
53968
  const cardinalityJoin = (0, combi_1.seq)("[", cardSpec, ":", joinType, "]");
53798
- // [1: left outer where condition] — cardinality + join-type + WHERE filter
53799
53969
  const cardinalityJoinWhere = (0, combi_1.seq)("[", cardSpec, ":", joinType, "WHERE", cds_condition_1.CDSCondition, "]");
53800
- // [left outer where condition] — join-type + WHERE filter (no cardinality prefix)
53801
53970
  const joinWhere = (0, combi_1.seq)("[", joinType, "WHERE", cds_condition_1.CDSCondition, "]");
53802
- // Text cardinality forms: [to one: cond], [to many: cond]
53803
- const textCard = (0, combi_1.altPrio)("TO ONE", "TO MANY");
53804
- const textCardFilter = (0, combi_1.seq)("[", textCard, ":", cds_condition_1.CDSCondition, "]");
53805
- // Numeric range cardinality: [0..1: cond], [1..1: cond], [0..*: cond], [n..m: cond]
53971
+ const textCard = (0, combi_1.altPrio)("TO EXACT ONE", "TO ONE", "TO MANY");
53972
+ const textCardFilter = (0, combi_1.seq)("[", textCard, (0, combi_1.optPrio)((0, combi_1.seq)(":", (0, combi_1.altPrio)((0, combi_1.seq)(joinType, "WHERE", cds_condition_1.CDSCondition), joinType, cds_condition_1.CDSCondition))), "]");
53806
53973
  const cardNum = (0, combi_1.altPrio)(cds_integer_1.CDSInteger, "*");
53807
53974
  const rangeCard = (0, combi_1.seq)(cds_integer_1.CDSInteger, ".", ".", cardNum);
53808
53975
  const rangeCardFilter = (0, combi_1.seq)("[", rangeCard, ":", cds_condition_1.CDSCondition, "]");
53809
53976
  const pathFilter = (0, combi_1.altPrio)(cardinalityJoinWhere, joinWhere, cardinalityJoin, joinRedirect, textCardFilter, rangeCardFilter, (0, combi_1.seq)("[", cardSpec, ":", cds_condition_1.CDSCondition, "]"), (0, combi_1.seq)("[", cds_condition_1.CDSCondition, "]"));
53810
- // Each dotted segment may have its own path filter: A[cond].B[cond].C
53811
- // The final segment may also be a string literal: #enum.'value'
53812
- // A segment may have a parameterized call: _Assoc( P_Key : value ) or _Assoc[filter]
53813
53977
  const segment = (0, combi_1.seq)(".", (0, combi_1.altPrio)(cds_string_1.CDSString, cds_name_1.CDSName), (0, combi_1.optPrio)((0, combi_1.altPrio)(cds_parameters_select_1.CDSParametersSelect, cds_parameters_1.CDSParameters)), (0, combi_1.optPrio)(pathFilter));
53814
53978
  return (0, combi_1.seq)(cds_name_1.CDSName, (0, combi_1.optPrio)((0, combi_1.altPrio)(cds_parameters_1.CDSParameters, cds_parameters_select_1.CDSParametersSelect)), (0, combi_1.optPrio)(pathFilter), (0, combi_1.star)(segment));
53815
53979
  }
@@ -53832,7 +53996,7 @@ exports.CDSProviderContract = void 0;
53832
53996
  const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
53833
53997
  class CDSProviderContract extends combi_1.Expression {
53834
53998
  getRunnable() {
53835
- return (0, combi_1.seq)("PROVIDER CONTRACT", (0, combi_1.alt)("TRANSACTIONAL_QUERY", "TRANSACTIONAL_INTERFACE", "ANALYTICAL_QUERY"));
53999
+ return (0, combi_1.seq)("PROVIDER CONTRACT", (0, combi_1.alt)("TRANSACTIONAL_QUERY", "TRANSACTIONAL_INTERFACE", "ANALYTICAL_QUERY", "SQL_QUERY", "STRUCTURED_QUERY"));
53836
54000
  }
53837
54001
  }
53838
54002
  exports.CDSProviderContract = CDSProviderContract;
@@ -53881,10 +54045,13 @@ class CDSSelect extends combi_1.Expression {
53881
54045
  getRunnable() {
53882
54046
  const fields = (0, combi_1.seq)((0, combi_1.star)((0, combi_1.seq)(_1.CDSElement, ",")), _1.CDSElement);
53883
54047
  const distinct = (0, combi_1.str)("DISTINCT");
53884
- // elem (,elem)* [,] — handles separator commas and optional trailing comma
53885
54048
  const elementList = (0, combi_1.seq)(_1.CDSElement, (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.opt)(","));
53886
54049
  const elements = (0, combi_1.seq)((0, combi_1.str)("{"), (0, combi_1.altPrio)("*", elementList), (0, combi_1.str)("}"));
53887
- return (0, combi_1.seq)("SELECT", (0, combi_1.optPrio)(distinct), (0, combi_1.opt)((0, combi_1.altPrio)("*", fields)), "FROM", _1.CDSSource, (0, combi_1.star)(cds_join_1.CDSJoin), (0, combi_1.star)((0, combi_1.altPrio)(_1.CDSComposition, cds_association_1.CDSAssociation)), (0, combi_1.opt)(elements), (0, combi_1.optPrio)(_1.CDSWhere), (0, combi_1.optPrio)(_1.CDSGroupBy), (0, combi_1.optPrio)(_1.CDSHaving), (0, combi_1.optPrio)((0, combi_1.altPrio)((0, combi_1.seq)("UNION", (0, combi_1.optPrio)("ALL"), CDSSelect), (0, combi_1.seq)("EXCEPT", CDSSelect), (0, combi_1.seq)("INTERSECT", CDSSelect))));
54050
+ const aspectBinding = (0, combi_1.seq)(_1.CDSPrefixedName, "=", ">", _1.CDSPrefixedName);
54051
+ const bindAspect = (0, combi_1.seq)("BIND", "ASPECT", _1.CDSName, "(", aspectBinding, (0, combi_1.starPrio)((0, combi_1.seq)(",", aspectBinding)), ")");
54052
+ const parenSelect = (0, combi_1.seq)("(", CDSSelect, ")");
54053
+ const unionBranch = (0, combi_1.altPrio)(parenSelect, CDSSelect);
54054
+ return (0, combi_1.seq)("SELECT", (0, combi_1.optPrio)(distinct), (0, combi_1.opt)((0, combi_1.altPrio)("*", fields)), "FROM", _1.CDSSource, (0, combi_1.star)(cds_join_1.CDSJoin), (0, combi_1.star)((0, combi_1.altPrio)(_1.CDSComposition, cds_association_1.CDSAssociation)), (0, combi_1.optPrio)(bindAspect), (0, combi_1.opt)(elements), (0, combi_1.optPrio)(_1.CDSWhere), (0, combi_1.optPrio)(_1.CDSGroupBy), (0, combi_1.optPrio)(_1.CDSHaving), (0, combi_1.optPrio)((0, combi_1.altPrio)((0, combi_1.seq)("UNION", (0, combi_1.optPrio)("ALL"), unionBranch), (0, combi_1.seq)("EXCEPT", unionBranch), (0, combi_1.seq)("INTERSECT", unionBranch))));
53888
54055
  }
53889
54056
  }
53890
54057
  exports.CDSSelect = CDSSelect;
@@ -53906,13 +54073,14 @@ const _1 = __webpack_require__(/*! . */ "../core/build/src/cds/expressions/index
53906
54073
  const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
53907
54074
  class CDSSource extends combi_1.Expression {
53908
54075
  getRunnable() {
53909
- // Static where filter in FROM: SomeTable [Field = 'Value']
53910
54076
  const staticFilter = (0, combi_1.seq)("[", _1.CDSCondition, "]");
53911
- const singleSource = (0, combi_1.seq)(_1.CDSName, (0, combi_1.optPrio)(_1.CDSParametersSelect), (0, combi_1.optPrio)(staticFilter), (0, combi_1.opt)((0, combi_1.altPrio)(_1.CDSAs, _1.CDSName)));
53912
- // FROM ( src [JOIN src ON cond]* ) — parenthesized join chain, arbitrarily nested
53913
- // CDSSource is self-referential here to handle: (((T1 join T2) join T3) join T4)
54077
+ // Dotted path: T._Assoc association path as FROM source
54078
+ const dottedName = (0, combi_1.seq)(_1.CDSName, ".", _1.CDSName);
54079
+ const namedSource = (0, combi_1.altPrio)(dottedName, _1.CDSName);
54080
+ const singleSource = (0, combi_1.seq)(namedSource, (0, combi_1.optPrio)(_1.CDSParametersSelect), (0, combi_1.optPrio)(staticFilter), (0, combi_1.opt)((0, combi_1.altPrio)(_1.CDSAs, _1.CDSName)));
54081
+ const funcSingleSource = (0, combi_1.seq)(_1.CDSFunction, (0, combi_1.opt)((0, combi_1.altPrio)(_1.CDSAs, _1.CDSName)));
53914
54082
  const parenSource = (0, combi_1.seq)("(", (0, combi_1.altPrio)(CDSSource, singleSource), (0, combi_1.star)(_1.CDSJoin), ")");
53915
- return (0, combi_1.altPrio)(parenSource, singleSource);
54083
+ return (0, combi_1.altPrio)(parenSource, funcSingleSource, singleSource);
53916
54084
  }
53917
54085
  }
53918
54086
  exports.CDSSource = CDSSource;
@@ -53933,15 +54101,8 @@ exports.CDSString = void 0;
53933
54101
  const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
53934
54102
  class CDSString extends combi_1.Expression {
53935
54103
  getRunnable() {
53936
- // Allow any character except unescaped single quote; escape sequences:
53937
- // '' — escaped single quote (doubling)
53938
- // \' — escaped single quote (backslash form)
53939
- // \\ — escaped backslash (e.g. '\\' in ltrim/rtrim calls)
53940
- // \x — other backslash sequences not followed by '
53941
54104
  const reg = (0, combi_1.regex)(/^'(?:[^'\\]|''|\\'|\\\\|\\(?!'))*'$/);
53942
- // Typed literal: abap.int4'1', abap.char'X', abap.numc(3)'123', etc.
53943
- // Lexed as tokens: abap, ., typename, 'value'
53944
- const abapTypeName = (0, combi_1.regex)(/^(?:int[1-9]|sstring|char|numc|dats|tims|fltp|decfloat\d+|dec|string|raw|xstring|clnt|lang|unit|cuky|curr|quan|d|t|p|n|c|x|f)$/i);
54105
+ const abapTypeName = (0, combi_1.regex)(/^(?:int[1-9]|int8|sstring|char|numc|dats|datn|tims|timn|utcl|utclong|fltp|decfloat\d+|dec|string|rawstring|rstr|raw|xstring|clnt|lang|unit|cuky|curr|quan|geom_ewkb|d34n|d16n|d34d|d16d|d34s|d16s|d34r|d16r|d|t|p|n|c|x|f)$/i);
53945
54106
  const abap = (0, combi_1.seq)("abap", ".", abapTypeName, (0, combi_1.optPrio)((0, combi_1.seq)("(", (0, combi_1.regex)(/^\d+$/), ")")), reg);
53946
54107
  return (0, combi_1.altPrio)(abap, reg);
53947
54108
  }
@@ -54059,8 +54220,10 @@ __exportStar(__webpack_require__(/*! ./cds_composition */ "../core/build/src/cds
54059
54220
  __exportStar(__webpack_require__(/*! ./cds_condition */ "../core/build/src/cds/expressions/cds_condition.js"), exports);
54060
54221
  __exportStar(__webpack_require__(/*! ./cds_define_abstract */ "../core/build/src/cds/expressions/cds_define_abstract.js"), exports);
54061
54222
  __exportStar(__webpack_require__(/*! ./cds_define_custom */ "../core/build/src/cds/expressions/cds_define_custom.js"), exports);
54223
+ __exportStar(__webpack_require__(/*! ./cds_define_external_entity */ "../core/build/src/cds/expressions/cds_define_external_entity.js"), exports);
54062
54224
  __exportStar(__webpack_require__(/*! ./cds_define_hierarchy */ "../core/build/src/cds/expressions/cds_define_hierarchy.js"), exports);
54063
54225
  __exportStar(__webpack_require__(/*! ./cds_define_projection */ "../core/build/src/cds/expressions/cds_define_projection.js"), exports);
54226
+ __exportStar(__webpack_require__(/*! ./cds_define_table_entity */ "../core/build/src/cds/expressions/cds_define_table_entity.js"), exports);
54064
54227
  __exportStar(__webpack_require__(/*! ./cds_define_table_function */ "../core/build/src/cds/expressions/cds_define_table_function.js"), exports);
54065
54228
  __exportStar(__webpack_require__(/*! ./cds_define_view */ "../core/build/src/cds/expressions/cds_define_view.js"), exports);
54066
54229
  __exportStar(__webpack_require__(/*! ./cds_element */ "../core/build/src/cds/expressions/cds_element.js"), exports);
@@ -54143,7 +54306,10 @@ class Config {
54143
54306
  for (const rule of sorted) {
54144
54307
  rules[rule.getMetadata().key] = rule.getConfig();
54145
54308
  }
54146
- const version = ver;
54309
+ const version = ver !== null && ver !== void 0 ? ver : {
54310
+ release: version_1.Release.Newest.name,
54311
+ language: langVer !== null && langVer !== void 0 ? langVer : version_1.LanguageVersion.Normal,
54312
+ };
54147
54313
  // defaults: dont skip anything, report everything. The user can decide to skip stuff
54148
54314
  // its difficult to debug errors not being reported
54149
54315
  const config = {
@@ -54270,12 +54436,14 @@ class Config {
54270
54436
  return v;
54271
54437
  }
54272
54438
  getLanguageVersion() {
54273
- var _a;
54439
+ if (this.config.syntax.languageVersion !== undefined) {
54440
+ return this.config.syntax.languageVersion;
54441
+ }
54274
54442
  const v = this.config.syntax.version;
54275
54443
  if (v !== undefined && typeof v !== "string") {
54276
54444
  return v.language;
54277
54445
  }
54278
- return (_a = this.config.syntax.languageVersion) !== null && _a !== void 0 ? _a : version_1.LanguageVersion.Normal;
54446
+ return version_1.LanguageVersion.Normal;
54279
54447
  }
54280
54448
  checkVersion() {
54281
54449
  const version = this.config.syntax.version;
@@ -54879,49 +55047,6 @@ exports.DDICReferences = DDICReferences;
54879
55047
 
54880
55048
  /***/ },
54881
55049
 
54882
- /***/ "../core/build/src/ddl/ddl_lexer.js"
54883
- /*!******************************************!*\
54884
- !*** ../core/build/src/ddl/ddl_lexer.js ***!
54885
- \******************************************/
54886
- (__unused_webpack_module, exports, __webpack_require__) {
54887
-
54888
- "use strict";
54889
-
54890
- Object.defineProperty(exports, "__esModule", ({ value: true }));
54891
- exports.DDLLexer = void 0;
54892
- const tokens_1 = __webpack_require__(/*! ../abap/1_lexer/tokens */ "../core/build/src/abap/1_lexer/tokens/index.js");
54893
- const position_1 = __webpack_require__(/*! ../position */ "../core/build/src/position.js");
54894
- class DDLLexer {
54895
- static run(file) {
54896
- const step1 = [];
54897
- const lines = file.getRaw().replace(/\r/g, "").split("\n");
54898
- for (const l of lines) {
54899
- if (l.startsWith("@")) {
54900
- continue; // skip annotations for now
54901
- }
54902
- step1.push(...l.split(" "));
54903
- }
54904
- const step2 = [];
54905
- for (const t of step1) {
54906
- if (t === "") {
54907
- continue;
54908
- }
54909
- else if (t.endsWith(";")) {
54910
- step2.push(t.substr(0, t.length - 1));
54911
- step2.push(";");
54912
- }
54913
- else {
54914
- step2.push(t);
54915
- }
54916
- }
54917
- return step2.map(t => new tokens_1.Identifier(new position_1.Position(1, 1), t));
54918
- }
54919
- }
54920
- exports.DDLLexer = DDLLexer;
54921
- //# sourceMappingURL=ddl_lexer.js.map
54922
-
54923
- /***/ },
54924
-
54925
55050
  /***/ "../core/build/src/ddl/ddl_parser.js"
54926
55051
  /*!*******************************************!*\
54927
55052
  !*** ../core/build/src/ddl/ddl_parser.js ***!
@@ -54965,67 +55090,250 @@ var __importStar = (this && this.__importStar) || (function () {
54965
55090
  })();
54966
55091
  Object.defineProperty(exports, "__esModule", ({ value: true }));
54967
55092
  exports.DDLParser = exports.DDLKind = void 0;
55093
+ const tokens_1 = __webpack_require__(/*! ../abap/1_lexer/tokens */ "../core/build/src/abap/1_lexer/tokens/index.js");
54968
55094
  const combi_1 = __webpack_require__(/*! ../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
54969
55095
  const nodes_1 = __webpack_require__(/*! ../abap/nodes */ "../core/build/src/abap/nodes/index.js");
54970
55096
  const version_1 = __webpack_require__(/*! ../version */ "../core/build/src/version.js");
54971
- const ddl_lexer_1 = __webpack_require__(/*! ./ddl_lexer */ "../core/build/src/ddl/ddl_lexer.js");
55097
+ const cds_lexer_1 = __webpack_require__(/*! ../cds/cds_lexer */ "../core/build/src/cds/cds_lexer.js");
54972
55098
  const Expressions = __importStar(__webpack_require__(/*! ./expressions */ "../core/build/src/ddl/expressions/index.js"));
54973
55099
  var DDLKind;
54974
55100
  (function (DDLKind) {
54975
55101
  DDLKind["Structure"] = "structure";
54976
55102
  DDLKind["Table"] = "table";
55103
+ DDLKind["Aspect"] = "aspect";
55104
+ DDLKind["ExtendType"] = "extend-type";
54977
55105
  })(DDLKind || (exports.DDLKind = DDLKind = {}));
54978
55106
  class DDLParser {
54979
55107
  parse(file) {
54980
- const tokens = ddl_lexer_1.DDLLexer.run(file);
55108
+ let tokens = cds_lexer_1.CDSLexer.run(file);
55109
+ tokens = tokens.filter(t => !(t instanceof tokens_1.Comment));
54981
55110
  let res = combi_1.Combi.run(new Expressions.DDLStructure(), tokens, version_1.defaultRelease);
54982
55111
  if (res === undefined) {
54983
55112
  res = combi_1.Combi.run(new Expressions.DDLTable(), tokens, version_1.defaultRelease);
54984
55113
  }
55114
+ if (res === undefined) {
55115
+ res = combi_1.Combi.run(new Expressions.DDLAspect(), tokens, version_1.defaultRelease);
55116
+ }
55117
+ if (res === undefined) {
55118
+ res = combi_1.Combi.run(new Expressions.DDLExtendType(), tokens, version_1.defaultRelease);
55119
+ }
54985
55120
  if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {
54986
55121
  return undefined;
54987
55122
  }
54988
55123
  return this.parsedToResult(res[0]);
54989
55124
  }
54990
55125
  parsedToResult(node) {
54991
- var _a, _b;
54992
55126
  const fields = [];
54993
- let found = node.findDirectExpressions(Expressions.DDLStructureField);
54994
- found = found.concat(node.findDirectExpressions(Expressions.DDLTableField));
54995
- found = found.concat(node.findDirectExpressions(Expressions.DDLInclude));
54996
- for (const f of found) {
54997
- const name = ((_a = f.findDirectExpression(Expressions.DDLName)) === null || _a === void 0 ? void 0 : _a.concatTokens()) || "";
54998
- if (f.get() instanceof Expressions.DDLInclude) {
54999
- fields.push({
55000
- name: ".INCLUDE",
55001
- type: name,
55002
- key: false,
55003
- notNull: false,
55004
- });
55127
+ for (const child of node.getChildren()) {
55128
+ if (!(child instanceof nodes_1.ExpressionNode)) {
55129
+ continue;
55130
+ }
55131
+ const expr = child.get();
55132
+ const isField = expr instanceof Expressions.DDLStructureField
55133
+ || expr instanceof Expressions.DDLTableField
55134
+ || expr instanceof Expressions.DDLInclude
55135
+ || expr instanceof Expressions.DDLNamedInclude;
55136
+ if (!isField) {
55137
+ continue;
55138
+ }
55139
+ const key = this.hasKey(child);
55140
+ const notNull = this.hasNotNull(child);
55141
+ if (expr instanceof Expressions.DDLInclude) {
55142
+ const target = this.compactTokens(child.findDirectExpression(Expressions.DDLName));
55143
+ fields.push({ name: ".INCLUDE", type: target, key, notNull });
55144
+ }
55145
+ else if (expr instanceof Expressions.DDLNamedInclude) {
55146
+ const names = child.findDirectExpressions(Expressions.DDLName);
55147
+ const alias = this.compactTokens(names[0]);
55148
+ const target = this.compactTokens(names[1]);
55149
+ fields.push({ name: alias, type: target, key, notNull });
55005
55150
  }
55006
55151
  else {
55007
- const type = ((_b = f.findDirectExpression(Expressions.DDLType)) === null || _b === void 0 ? void 0 : _b.concatTokens()) || "";
55008
- fields.push({
55009
- name,
55010
- type,
55011
- key: false,
55012
- notNull: false,
55013
- });
55152
+ const name = this.compactTokens(child.findDirectExpression(Expressions.DDLName));
55153
+ const type = this.compactTokens(child.findDirectExpression(Expressions.DDLType));
55154
+ fields.push({ name, type, key, notNull });
55014
55155
  }
55015
55156
  }
55016
55157
  const result = {
55017
- name: node.findDirectExpression(Expressions.DDLName).concatTokens(),
55018
- kind: node.get() instanceof Expressions.DDLStructure ? DDLKind.Structure : DDLKind.Table,
55158
+ name: this.compactTokens(node.findDirectExpression(Expressions.DDLName)),
55159
+ kind: this.kindOf(node),
55019
55160
  fields,
55020
55161
  };
55021
55162
  return result;
55022
55163
  }
55164
+ compactTokens(node) {
55165
+ if (node === undefined) {
55166
+ return "";
55167
+ }
55168
+ return node.concatTokens().replace(/\s+/g, "");
55169
+ }
55170
+ hasKey(node) {
55171
+ var _a, _b, _c;
55172
+ for (const c of node.getChildren()) {
55173
+ const expr = (_b = (_a = c).get) === null || _b === void 0 ? void 0 : _b.call(_a);
55174
+ const ctor = (_c = expr === null || expr === void 0 ? void 0 : expr.constructor) === null || _c === void 0 ? void 0 : _c.name;
55175
+ if (ctor === "CDSAnnotation") {
55176
+ continue;
55177
+ }
55178
+ const tok = c.concatTokens().toUpperCase().trim();
55179
+ if (tok === "KEY") {
55180
+ return true;
55181
+ }
55182
+ if (tok !== "") {
55183
+ return false;
55184
+ }
55185
+ }
55186
+ return false;
55187
+ }
55188
+ hasNotNull(node) {
55189
+ var _a, _b, _c, _d;
55190
+ const children = node.getChildren();
55191
+ for (let i = 0; i < children.length - 1; i++) {
55192
+ const a = (_b = (_a = children[i]).concatTokens) === null || _b === void 0 ? void 0 : _b.call(_a).toUpperCase().trim();
55193
+ const b = (_d = (_c = children[i + 1]).concatTokens) === null || _d === void 0 ? void 0 : _d.call(_c).toUpperCase().trim();
55194
+ if (a === "NOT" && b === "NULL") {
55195
+ return true;
55196
+ }
55197
+ }
55198
+ return false;
55199
+ }
55200
+ kindOf(node) {
55201
+ const expr = node.get();
55202
+ if (expr instanceof Expressions.DDLStructure) {
55203
+ return DDLKind.Structure;
55204
+ }
55205
+ if (expr instanceof Expressions.DDLAspect) {
55206
+ return DDLKind.Aspect;
55207
+ }
55208
+ if (expr instanceof Expressions.DDLExtendType) {
55209
+ return DDLKind.ExtendType;
55210
+ }
55211
+ return DDLKind.Table;
55212
+ }
55023
55213
  }
55024
55214
  exports.DDLParser = DDLParser;
55025
55215
  //# sourceMappingURL=ddl_parser.js.map
55026
55216
 
55027
55217
  /***/ },
55028
55218
 
55219
+ /***/ "../core/build/src/ddl/expressions/ddl_aspect.js"
55220
+ /*!*******************************************************!*\
55221
+ !*** ../core/build/src/ddl/expressions/ddl_aspect.js ***!
55222
+ \*******************************************************/
55223
+ (__unused_webpack_module, exports, __webpack_require__) {
55224
+
55225
+ "use strict";
55226
+
55227
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
55228
+ exports.DDLAspect = void 0;
55229
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
55230
+ const expressions_1 = __webpack_require__(/*! ../../cds/expressions */ "../core/build/src/cds/expressions/index.js");
55231
+ const ddl_extend_1 = __webpack_require__(/*! ./ddl_extend */ "../core/build/src/ddl/expressions/ddl_extend.js");
55232
+ const ddl_include_1 = __webpack_require__(/*! ./ddl_include */ "../core/build/src/ddl/expressions/ddl_include.js");
55233
+ const ddl_name_1 = __webpack_require__(/*! ./ddl_name */ "../core/build/src/ddl/expressions/ddl_name.js");
55234
+ const ddl_named_include_1 = __webpack_require__(/*! ./ddl_named_include */ "../core/build/src/ddl/expressions/ddl_named_include.js");
55235
+ const ddl_table_field_1 = __webpack_require__(/*! ./ddl_table_field */ "../core/build/src/ddl/expressions/ddl_table_field.js");
55236
+ class DDLAspect extends combi_1.Expression {
55237
+ getRunnable() {
55238
+ const entry = (0, combi_1.altPrio)(ddl_named_include_1.DDLNamedInclude, ddl_include_1.DDLInclude, ddl_table_field_1.DDLTableField, ddl_extend_1.DDLExtend);
55239
+ return (0, combi_1.seq)((0, combi_1.star)(expressions_1.CDSAnnotation), "DEFINE", "ASPECT", ddl_name_1.DDLName, "{", (0, combi_1.plusPrio)(entry), "}", (0, combi_1.optPrio)(";"));
55240
+ }
55241
+ }
55242
+ exports.DDLAspect = DDLAspect;
55243
+ //# sourceMappingURL=ddl_aspect.js.map
55244
+
55245
+ /***/ },
55246
+
55247
+ /***/ "../core/build/src/ddl/expressions/ddl_clauses.js"
55248
+ /*!********************************************************!*\
55249
+ !*** ../core/build/src/ddl/expressions/ddl_clauses.js ***!
55250
+ \********************************************************/
55251
+ (__unused_webpack_module, exports, __webpack_require__) {
55252
+
55253
+ "use strict";
55254
+
55255
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
55256
+ exports.DDLValueHelp = exports.DDLForeignKey = exports.DDLForeignKeyTarget = void 0;
55257
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
55258
+ const ddl_literal_1 = __webpack_require__(/*! ./ddl_literal */ "../core/build/src/ddl/expressions/ddl_literal.js");
55259
+ const ddl_name_1 = __webpack_require__(/*! ./ddl_name */ "../core/build/src/ddl/expressions/ddl_name.js");
55260
+ const ddl_where_1 = __webpack_require__(/*! ./ddl_where */ "../core/build/src/ddl/expressions/ddl_where.js");
55261
+ class DDLForeignKeyTarget extends combi_1.Expression {
55262
+ getRunnable() {
55263
+ const cardinality = (0, combi_1.seq)("[", ddl_literal_1.DDLCardinalityValue, ".", ".", ddl_literal_1.DDLCardinalityValue, (0, combi_1.optPrio)((0, combi_1.seq)(",", ddl_literal_1.DDLCardinalityValue)), "]");
55264
+ return (0, combi_1.seq)((0, combi_1.optPrio)(cardinality), ddl_name_1.DDLName);
55265
+ }
55266
+ }
55267
+ exports.DDLForeignKeyTarget = DDLForeignKeyTarget;
55268
+ class DDLForeignKey extends combi_1.Expression {
55269
+ getRunnable() {
55270
+ return (0, combi_1.seq)("WITH", "FOREIGN", "KEY", DDLForeignKeyTarget, (0, combi_1.optPrio)(ddl_where_1.DDLWhere));
55271
+ }
55272
+ }
55273
+ exports.DDLForeignKey = DDLForeignKey;
55274
+ class DDLValueHelp extends combi_1.Expression {
55275
+ getRunnable() {
55276
+ return (0, combi_1.seq)("WITH", "VALUE", "HELP", ddl_name_1.DDLName, (0, combi_1.optPrio)(ddl_where_1.DDLWhere));
55277
+ }
55278
+ }
55279
+ exports.DDLValueHelp = DDLValueHelp;
55280
+ //# sourceMappingURL=ddl_clauses.js.map
55281
+
55282
+ /***/ },
55283
+
55284
+ /***/ "../core/build/src/ddl/expressions/ddl_extend.js"
55285
+ /*!*******************************************************!*\
55286
+ !*** ../core/build/src/ddl/expressions/ddl_extend.js ***!
55287
+ \*******************************************************/
55288
+ (__unused_webpack_module, exports, __webpack_require__) {
55289
+
55290
+ "use strict";
55291
+
55292
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
55293
+ exports.DDLExtend = void 0;
55294
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
55295
+ const expressions_1 = __webpack_require__(/*! ../../cds/expressions */ "../core/build/src/cds/expressions/index.js");
55296
+ const ddl_clauses_1 = __webpack_require__(/*! ./ddl_clauses */ "../core/build/src/ddl/expressions/ddl_clauses.js");
55297
+ const ddl_name_1 = __webpack_require__(/*! ./ddl_name */ "../core/build/src/ddl/expressions/ddl_name.js");
55298
+ class DDLExtend extends combi_1.Expression {
55299
+ getRunnable() {
55300
+ const clause = (0, combi_1.alt)(ddl_clauses_1.DDLForeignKey, ddl_clauses_1.DDLValueHelp);
55301
+ return (0, combi_1.seq)((0, combi_1.star)(expressions_1.CDSAnnotation), "EXTEND", ddl_name_1.DDLName, ":", (0, combi_1.plus)(clause), ";");
55302
+ }
55303
+ }
55304
+ exports.DDLExtend = DDLExtend;
55305
+ //# sourceMappingURL=ddl_extend.js.map
55306
+
55307
+ /***/ },
55308
+
55309
+ /***/ "../core/build/src/ddl/expressions/ddl_extend_type.js"
55310
+ /*!************************************************************!*\
55311
+ !*** ../core/build/src/ddl/expressions/ddl_extend_type.js ***!
55312
+ \************************************************************/
55313
+ (__unused_webpack_module, exports, __webpack_require__) {
55314
+
55315
+ "use strict";
55316
+
55317
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
55318
+ exports.DDLExtendType = void 0;
55319
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
55320
+ const expressions_1 = __webpack_require__(/*! ../../cds/expressions */ "../core/build/src/cds/expressions/index.js");
55321
+ const ddl_include_1 = __webpack_require__(/*! ./ddl_include */ "../core/build/src/ddl/expressions/ddl_include.js");
55322
+ const ddl_name_1 = __webpack_require__(/*! ./ddl_name */ "../core/build/src/ddl/expressions/ddl_name.js");
55323
+ const ddl_named_include_1 = __webpack_require__(/*! ./ddl_named_include */ "../core/build/src/ddl/expressions/ddl_named_include.js");
55324
+ const ddl_structure_field_1 = __webpack_require__(/*! ./ddl_structure_field */ "../core/build/src/ddl/expressions/ddl_structure_field.js");
55325
+ const ddl_table_field_1 = __webpack_require__(/*! ./ddl_table_field */ "../core/build/src/ddl/expressions/ddl_table_field.js");
55326
+ class DDLExtendType extends combi_1.Expression {
55327
+ getRunnable() {
55328
+ const entry = (0, combi_1.altPrio)(ddl_named_include_1.DDLNamedInclude, ddl_include_1.DDLInclude, ddl_table_field_1.DDLTableField, ddl_structure_field_1.DDLStructureField);
55329
+ return (0, combi_1.seq)((0, combi_1.star)(expressions_1.CDSAnnotation), "EXTEND", "TYPE", ddl_name_1.DDLName, "WITH", ddl_name_1.DDLName, "{", (0, combi_1.plusPrio)(entry), "}", (0, combi_1.optPrio)(";"));
55330
+ }
55331
+ }
55332
+ exports.DDLExtendType = DDLExtendType;
55333
+ //# sourceMappingURL=ddl_extend_type.js.map
55334
+
55335
+ /***/ },
55336
+
55029
55337
  /***/ "../core/build/src/ddl/expressions/ddl_include.js"
55030
55338
  /*!********************************************************!*\
55031
55339
  !*** ../core/build/src/ddl/expressions/ddl_include.js ***!
@@ -55037,10 +55345,13 @@ exports.DDLParser = DDLParser;
55037
55345
  Object.defineProperty(exports, "__esModule", ({ value: true }));
55038
55346
  exports.DDLInclude = void 0;
55039
55347
  const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
55348
+ const expressions_1 = __webpack_require__(/*! ../../cds/expressions */ "../core/build/src/cds/expressions/index.js");
55349
+ const ddl_clauses_1 = __webpack_require__(/*! ./ddl_clauses */ "../core/build/src/ddl/expressions/ddl_clauses.js");
55040
55350
  const ddl_name_1 = __webpack_require__(/*! ./ddl_name */ "../core/build/src/ddl/expressions/ddl_name.js");
55041
55351
  class DDLInclude extends combi_1.Expression {
55042
55352
  getRunnable() {
55043
- return (0, combi_1.seq)("INCLUDE", ddl_name_1.DDLName, ";");
55353
+ const trailingClause = (0, combi_1.alt)(ddl_clauses_1.DDLForeignKey, ddl_clauses_1.DDLValueHelp);
55354
+ return (0, combi_1.seq)((0, combi_1.star)(expressions_1.CDSAnnotation), (0, combi_1.optPrio)("KEY"), "INCLUDE", ddl_name_1.DDLName, (0, combi_1.optPrio)((0, combi_1.seq)("WITH", "SUFFIX", ddl_name_1.DDLName)), (0, combi_1.optPrio)("NOT NULL"), (0, combi_1.star)(trailingClause), ";");
55044
55355
  }
55045
55356
  }
55046
55357
  exports.DDLInclude = DDLInclude;
@@ -55048,6 +55359,34 @@ exports.DDLInclude = DDLInclude;
55048
55359
 
55049
55360
  /***/ },
55050
55361
 
55362
+ /***/ "../core/build/src/ddl/expressions/ddl_literal.js"
55363
+ /*!********************************************************!*\
55364
+ !*** ../core/build/src/ddl/expressions/ddl_literal.js ***!
55365
+ \********************************************************/
55366
+ (__unused_webpack_module, exports, __webpack_require__) {
55367
+
55368
+ "use strict";
55369
+
55370
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
55371
+ exports.DDLStringLiteral = exports.DDLCardinalityValue = void 0;
55372
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
55373
+ const cds_integer_1 = __webpack_require__(/*! ../../cds/expressions/cds_integer */ "../core/build/src/cds/expressions/cds_integer.js");
55374
+ class DDLCardinalityValue extends combi_1.Expression {
55375
+ getRunnable() {
55376
+ return (0, combi_1.altPrio)(cds_integer_1.CDSInteger, "*");
55377
+ }
55378
+ }
55379
+ exports.DDLCardinalityValue = DDLCardinalityValue;
55380
+ class DDLStringLiteral extends combi_1.Expression {
55381
+ getRunnable() {
55382
+ return (0, combi_1.regex)(/^'[^']*'$/);
55383
+ }
55384
+ }
55385
+ exports.DDLStringLiteral = DDLStringLiteral;
55386
+ //# sourceMappingURL=ddl_literal.js.map
55387
+
55388
+ /***/ },
55389
+
55051
55390
  /***/ "../core/build/src/ddl/expressions/ddl_name.js"
55052
55391
  /*!*****************************************************!*\
55053
55392
  !*** ../core/build/src/ddl/expressions/ddl_name.js ***!
@@ -55059,9 +55398,10 @@ exports.DDLInclude = DDLInclude;
55059
55398
  Object.defineProperty(exports, "__esModule", ({ value: true }));
55060
55399
  exports.DDLName = void 0;
55061
55400
  const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
55401
+ const cds_name_1 = __webpack_require__(/*! ../../cds/expressions/cds_name */ "../core/build/src/cds/expressions/cds_name.js");
55062
55402
  class DDLName extends combi_1.Expression {
55063
55403
  getRunnable() {
55064
- return (0, combi_1.regex)(/^\w+$/);
55404
+ return (0, combi_1.alt)(cds_name_1.CDSName, (0, combi_1.regex)(/^"[^"]*"$/));
55065
55405
  }
55066
55406
  }
55067
55407
  exports.DDLName = DDLName;
@@ -55069,6 +55409,53 @@ exports.DDLName = DDLName;
55069
55409
 
55070
55410
  /***/ },
55071
55411
 
55412
+ /***/ "../core/build/src/ddl/expressions/ddl_named_include.js"
55413
+ /*!**************************************************************!*\
55414
+ !*** ../core/build/src/ddl/expressions/ddl_named_include.js ***!
55415
+ \**************************************************************/
55416
+ (__unused_webpack_module, exports, __webpack_require__) {
55417
+
55418
+ "use strict";
55419
+
55420
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
55421
+ exports.DDLNamedInclude = void 0;
55422
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
55423
+ const expressions_1 = __webpack_require__(/*! ../../cds/expressions */ "../core/build/src/cds/expressions/index.js");
55424
+ const ddl_clauses_1 = __webpack_require__(/*! ./ddl_clauses */ "../core/build/src/ddl/expressions/ddl_clauses.js");
55425
+ const ddl_name_1 = __webpack_require__(/*! ./ddl_name */ "../core/build/src/ddl/expressions/ddl_name.js");
55426
+ class DDLNamedInclude extends combi_1.Expression {
55427
+ getRunnable() {
55428
+ const trailingClause = (0, combi_1.alt)(ddl_clauses_1.DDLForeignKey, ddl_clauses_1.DDLValueHelp);
55429
+ return (0, combi_1.seq)((0, combi_1.star)(expressions_1.CDSAnnotation), (0, combi_1.optPrio)("KEY"), ddl_name_1.DDLName, ":", "INCLUDE", ddl_name_1.DDLName, (0, combi_1.optPrio)((0, combi_1.seq)("WITH", "SUFFIX", ddl_name_1.DDLName)), (0, combi_1.optPrio)("NOT NULL"), (0, combi_1.star)(trailingClause), ";");
55430
+ }
55431
+ }
55432
+ exports.DDLNamedInclude = DDLNamedInclude;
55433
+ //# sourceMappingURL=ddl_named_include.js.map
55434
+
55435
+ /***/ },
55436
+
55437
+ /***/ "../core/build/src/ddl/expressions/ddl_qualified_name.js"
55438
+ /*!***************************************************************!*\
55439
+ !*** ../core/build/src/ddl/expressions/ddl_qualified_name.js ***!
55440
+ \***************************************************************/
55441
+ (__unused_webpack_module, exports, __webpack_require__) {
55442
+
55443
+ "use strict";
55444
+
55445
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
55446
+ exports.DDLQualifiedName = void 0;
55447
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
55448
+ const ddl_name_1 = __webpack_require__(/*! ./ddl_name */ "../core/build/src/ddl/expressions/ddl_name.js");
55449
+ class DDLQualifiedName extends combi_1.Expression {
55450
+ getRunnable() {
55451
+ return (0, combi_1.seq)(ddl_name_1.DDLName, (0, combi_1.optPrio)((0, combi_1.seq)(".", ddl_name_1.DDLName)));
55452
+ }
55453
+ }
55454
+ exports.DDLQualifiedName = DDLQualifiedName;
55455
+ //# sourceMappingURL=ddl_qualified_name.js.map
55456
+
55457
+ /***/ },
55458
+
55072
55459
  /***/ "../core/build/src/ddl/expressions/ddl_structure.js"
55073
55460
  /*!**********************************************************!*\
55074
55461
  !*** ../core/build/src/ddl/expressions/ddl_structure.js ***!
@@ -55080,12 +55467,15 @@ exports.DDLName = DDLName;
55080
55467
  Object.defineProperty(exports, "__esModule", ({ value: true }));
55081
55468
  exports.DDLStructure = void 0;
55082
55469
  const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
55083
- const ddl_structure_field_1 = __webpack_require__(/*! ./ddl_structure_field */ "../core/build/src/ddl/expressions/ddl_structure_field.js");
55084
- const ddl_name_1 = __webpack_require__(/*! ./ddl_name */ "../core/build/src/ddl/expressions/ddl_name.js");
55470
+ const expressions_1 = __webpack_require__(/*! ../../cds/expressions */ "../core/build/src/cds/expressions/index.js");
55085
55471
  const ddl_include_1 = __webpack_require__(/*! ./ddl_include */ "../core/build/src/ddl/expressions/ddl_include.js");
55472
+ const ddl_name_1 = __webpack_require__(/*! ./ddl_name */ "../core/build/src/ddl/expressions/ddl_name.js");
55473
+ const ddl_named_include_1 = __webpack_require__(/*! ./ddl_named_include */ "../core/build/src/ddl/expressions/ddl_named_include.js");
55474
+ const ddl_structure_field_1 = __webpack_require__(/*! ./ddl_structure_field */ "../core/build/src/ddl/expressions/ddl_structure_field.js");
55086
55475
  class DDLStructure extends combi_1.Expression {
55087
55476
  getRunnable() {
55088
- return (0, combi_1.seq)("DEFINE STRUCTURE", ddl_name_1.DDLName, "{", (0, combi_1.plusPrio)((0, combi_1.altPrio)(ddl_structure_field_1.DDLStructureField, ddl_include_1.DDLInclude)), "}");
55477
+ const entry = (0, combi_1.altPrio)(ddl_named_include_1.DDLNamedInclude, ddl_include_1.DDLInclude, ddl_structure_field_1.DDLStructureField);
55478
+ return (0, combi_1.seq)((0, combi_1.star)(expressions_1.CDSAnnotation), "DEFINE", "STRUCTURE", ddl_name_1.DDLName, "{", (0, combi_1.plusPrio)(entry), "}", (0, combi_1.optPrio)(";"));
55089
55479
  }
55090
55480
  }
55091
55481
  exports.DDLStructure = DDLStructure;
@@ -55104,11 +55494,12 @@ exports.DDLStructure = DDLStructure;
55104
55494
  Object.defineProperty(exports, "__esModule", ({ value: true }));
55105
55495
  exports.DDLStructureField = void 0;
55106
55496
  const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
55497
+ const expressions_1 = __webpack_require__(/*! ../../cds/expressions */ "../core/build/src/cds/expressions/index.js");
55107
55498
  const ddl_name_1 = __webpack_require__(/*! ./ddl_name */ "../core/build/src/ddl/expressions/ddl_name.js");
55108
55499
  const ddl_type_1 = __webpack_require__(/*! ./ddl_type */ "../core/build/src/ddl/expressions/ddl_type.js");
55109
55500
  class DDLStructureField extends combi_1.Expression {
55110
55501
  getRunnable() {
55111
- return (0, combi_1.seq)(ddl_name_1.DDLName, ":", ddl_type_1.DDLType, ";");
55502
+ return (0, combi_1.seq)((0, combi_1.star)(expressions_1.CDSAnnotation), ddl_name_1.DDLName, ":", ddl_type_1.DDLType, (0, combi_1.optPrio)("NOT NULL"), ";");
55112
55503
  }
55113
55504
  }
55114
55505
  exports.DDLStructureField = DDLStructureField;
@@ -55127,12 +55518,16 @@ exports.DDLStructureField = DDLStructureField;
55127
55518
  Object.defineProperty(exports, "__esModule", ({ value: true }));
55128
55519
  exports.DDLTable = void 0;
55129
55520
  const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
55521
+ const expressions_1 = __webpack_require__(/*! ../../cds/expressions */ "../core/build/src/cds/expressions/index.js");
55522
+ const ddl_extend_1 = __webpack_require__(/*! ./ddl_extend */ "../core/build/src/ddl/expressions/ddl_extend.js");
55130
55523
  const ddl_include_1 = __webpack_require__(/*! ./ddl_include */ "../core/build/src/ddl/expressions/ddl_include.js");
55131
55524
  const ddl_name_1 = __webpack_require__(/*! ./ddl_name */ "../core/build/src/ddl/expressions/ddl_name.js");
55525
+ const ddl_named_include_1 = __webpack_require__(/*! ./ddl_named_include */ "../core/build/src/ddl/expressions/ddl_named_include.js");
55132
55526
  const ddl_table_field_1 = __webpack_require__(/*! ./ddl_table_field */ "../core/build/src/ddl/expressions/ddl_table_field.js");
55133
55527
  class DDLTable extends combi_1.Expression {
55134
55528
  getRunnable() {
55135
- return (0, combi_1.seq)("DEFINE TABLE", ddl_name_1.DDLName, "{", (0, combi_1.plusPrio)((0, combi_1.altPrio)(ddl_table_field_1.DDLTableField, ddl_include_1.DDLInclude)), "}");
55529
+ const entry = (0, combi_1.altPrio)(ddl_named_include_1.DDLNamedInclude, ddl_include_1.DDLInclude, ddl_table_field_1.DDLTableField, ddl_extend_1.DDLExtend);
55530
+ return (0, combi_1.seq)((0, combi_1.star)(expressions_1.CDSAnnotation), "DEFINE", "TABLE", ddl_name_1.DDLName, "{", (0, combi_1.plusPrio)(entry), "}", (0, combi_1.optPrio)(";"));
55136
55531
  }
55137
55532
  }
55138
55533
  exports.DDLTable = DDLTable;
@@ -55151,11 +55546,14 @@ exports.DDLTable = DDLTable;
55151
55546
  Object.defineProperty(exports, "__esModule", ({ value: true }));
55152
55547
  exports.DDLTableField = void 0;
55153
55548
  const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
55549
+ const expressions_1 = __webpack_require__(/*! ../../cds/expressions */ "../core/build/src/cds/expressions/index.js");
55550
+ const ddl_clauses_1 = __webpack_require__(/*! ./ddl_clauses */ "../core/build/src/ddl/expressions/ddl_clauses.js");
55154
55551
  const ddl_name_1 = __webpack_require__(/*! ./ddl_name */ "../core/build/src/ddl/expressions/ddl_name.js");
55155
55552
  const ddl_type_1 = __webpack_require__(/*! ./ddl_type */ "../core/build/src/ddl/expressions/ddl_type.js");
55156
55553
  class DDLTableField extends combi_1.Expression {
55157
55554
  getRunnable() {
55158
- return (0, combi_1.seq)((0, combi_1.optPrio)("KEY"), ddl_name_1.DDLName, ":", ddl_type_1.DDLType, (0, combi_1.optPrio)("NOT NULL"), ";");
55555
+ const trailingClause = (0, combi_1.alt)(ddl_clauses_1.DDLForeignKey, ddl_clauses_1.DDLValueHelp);
55556
+ return (0, combi_1.seq)((0, combi_1.star)(expressions_1.CDSAnnotation), (0, combi_1.optPrio)("KEY"), ddl_name_1.DDLName, ":", ddl_type_1.DDLType, (0, combi_1.optPrio)("NOT NULL"), (0, combi_1.star)(trailingClause), ";");
55159
55557
  }
55160
55558
  }
55161
55559
  exports.DDLTableField = DDLTableField;
@@ -55174,9 +55572,15 @@ exports.DDLTableField = DDLTableField;
55174
55572
  Object.defineProperty(exports, "__esModule", ({ value: true }));
55175
55573
  exports.DDLType = void 0;
55176
55574
  const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
55575
+ const cds_integer_1 = __webpack_require__(/*! ../../cds/expressions/cds_integer */ "../core/build/src/cds/expressions/cds_integer.js");
55576
+ const ddl_name_1 = __webpack_require__(/*! ./ddl_name */ "../core/build/src/ddl/expressions/ddl_name.js");
55177
55577
  class DDLType extends combi_1.Expression {
55178
55578
  getRunnable() {
55179
- return (0, combi_1.regex)(/^(abap\.)?\w+(\(\d+\))?$/);
55579
+ const decimals = (0, combi_1.seq)(",", cds_integer_1.CDSInteger);
55580
+ const lenSpec = (0, combi_1.seq)("(", cds_integer_1.CDSInteger, (0, combi_1.optPrio)(decimals), ")");
55581
+ const dotted = (0, combi_1.seq)(ddl_name_1.DDLName, ".", ddl_name_1.DDLName, (0, combi_1.optPrio)(lenSpec));
55582
+ const plain = (0, combi_1.seq)(ddl_name_1.DDLName, (0, combi_1.optPrio)(lenSpec));
55583
+ return (0, combi_1.altPrio)(dotted, plain);
55180
55584
  }
55181
55585
  }
55182
55586
  exports.DDLType = DDLType;
@@ -55184,6 +55588,31 @@ exports.DDLType = DDLType;
55184
55588
 
55185
55589
  /***/ },
55186
55590
 
55591
+ /***/ "../core/build/src/ddl/expressions/ddl_where.js"
55592
+ /*!******************************************************!*\
55593
+ !*** ../core/build/src/ddl/expressions/ddl_where.js ***!
55594
+ \******************************************************/
55595
+ (__unused_webpack_module, exports, __webpack_require__) {
55596
+
55597
+ "use strict";
55598
+
55599
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
55600
+ exports.DDLWhere = void 0;
55601
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
55602
+ const ddl_qualified_name_1 = __webpack_require__(/*! ./ddl_qualified_name */ "../core/build/src/ddl/expressions/ddl_qualified_name.js");
55603
+ const ddl_literal_1 = __webpack_require__(/*! ./ddl_literal */ "../core/build/src/ddl/expressions/ddl_literal.js");
55604
+ class DDLWhere extends combi_1.Expression {
55605
+ getRunnable() {
55606
+ const value = (0, combi_1.alt)(ddl_qualified_name_1.DDLQualifiedName, ddl_literal_1.DDLStringLiteral);
55607
+ const condition = (0, combi_1.seq)(ddl_qualified_name_1.DDLQualifiedName, "=", value);
55608
+ return (0, combi_1.seq)("WHERE", condition, (0, combi_1.star)((0, combi_1.seq)("AND", condition)));
55609
+ }
55610
+ }
55611
+ exports.DDLWhere = DDLWhere;
55612
+ //# sourceMappingURL=ddl_where.js.map
55613
+
55614
+ /***/ },
55615
+
55187
55616
  /***/ "../core/build/src/ddl/expressions/index.js"
55188
55617
  /*!**************************************************!*\
55189
55618
  !*** ../core/build/src/ddl/expressions/index.js ***!
@@ -55207,13 +55636,21 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
55207
55636
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
55208
55637
  };
55209
55638
  Object.defineProperty(exports, "__esModule", ({ value: true }));
55639
+ __exportStar(__webpack_require__(/*! ./ddl_aspect */ "../core/build/src/ddl/expressions/ddl_aspect.js"), exports);
55640
+ __exportStar(__webpack_require__(/*! ./ddl_clauses */ "../core/build/src/ddl/expressions/ddl_clauses.js"), exports);
55641
+ __exportStar(__webpack_require__(/*! ./ddl_extend */ "../core/build/src/ddl/expressions/ddl_extend.js"), exports);
55642
+ __exportStar(__webpack_require__(/*! ./ddl_extend_type */ "../core/build/src/ddl/expressions/ddl_extend_type.js"), exports);
55210
55643
  __exportStar(__webpack_require__(/*! ./ddl_include */ "../core/build/src/ddl/expressions/ddl_include.js"), exports);
55644
+ __exportStar(__webpack_require__(/*! ./ddl_literal */ "../core/build/src/ddl/expressions/ddl_literal.js"), exports);
55211
55645
  __exportStar(__webpack_require__(/*! ./ddl_name */ "../core/build/src/ddl/expressions/ddl_name.js"), exports);
55646
+ __exportStar(__webpack_require__(/*! ./ddl_named_include */ "../core/build/src/ddl/expressions/ddl_named_include.js"), exports);
55647
+ __exportStar(__webpack_require__(/*! ./ddl_qualified_name */ "../core/build/src/ddl/expressions/ddl_qualified_name.js"), exports);
55212
55648
  __exportStar(__webpack_require__(/*! ./ddl_structure_field */ "../core/build/src/ddl/expressions/ddl_structure_field.js"), exports);
55213
55649
  __exportStar(__webpack_require__(/*! ./ddl_structure */ "../core/build/src/ddl/expressions/ddl_structure.js"), exports);
55214
55650
  __exportStar(__webpack_require__(/*! ./ddl_table_field */ "../core/build/src/ddl/expressions/ddl_table_field.js"), exports);
55215
55651
  __exportStar(__webpack_require__(/*! ./ddl_table */ "../core/build/src/ddl/expressions/ddl_table.js"), exports);
55216
55652
  __exportStar(__webpack_require__(/*! ./ddl_type */ "../core/build/src/ddl/expressions/ddl_type.js"), exports);
55653
+ __exportStar(__webpack_require__(/*! ./ddl_where */ "../core/build/src/ddl/expressions/ddl_where.js"), exports);
55217
55654
  //# sourceMappingURL=index.js.map
55218
55655
 
55219
55656
  /***/ },
@@ -55605,8 +56042,8 @@ var __importStar = (this && this.__importStar) || (function () {
55605
56042
  };
55606
56043
  })();
55607
56044
  Object.defineProperty(exports, "__esModule", ({ value: true }));
55608
- exports.SyntaxLogic = exports.ABAPObject = exports.Tokens = exports.ExpressionsCDS = exports.CDSParser = exports.LanguageServerTypes = exports.DDLParser = exports.AbstractFile = exports.ABAPFile = exports.MemoryFile = exports.Edits = exports.ReferenceType = exports.NativeSQL = exports.MacroContent = exports.MacroCall = exports.SpaghettiScopeNode = exports.Token = exports.ScopeType = exports.BasicTypes = exports.TypedIdentifier = exports.AbstractType = exports.VirtualPosition = exports.Comment = exports.Unknown = exports.Empty = exports.Identifier = exports.Nodes = exports.Types = exports.Expressions = exports.Statements = exports.Structures = exports.SkipLogic = exports.Objects = exports.ArtifactsRules = exports.ArtifactsObjects = exports.ArtifactsABAP = exports.BuiltIn = exports.FormLengthStats = exports.FunctionLengthStats = exports.MethodLengthStats = exports.LanguageServer = exports.Registry = exports.CyclomaticComplexityStats = exports.versionToABAPRelease = exports.releaseAtLeast = exports.Release = exports.LanguageVersion = exports.Version = exports.Config = exports.Issue = void 0;
55609
- exports.LSPEdit = exports.RuleTag = exports.Severity = exports.Visibility = exports.Info = exports.Diagnostics = exports.Rename = exports.PrettyPrinter = exports.Position = exports.CurrentScope = exports.RulesRunner = exports.SpaghettiScope = void 0;
56045
+ exports.ABAPObject = exports.Tokens = exports.ExpressionsCDS = exports.CDSParser = exports.LanguageServerTypes = exports.DDLKind = exports.DDLParser = exports.AbstractFile = exports.ABAPFile = exports.MemoryFile = exports.Edits = exports.ReferenceType = exports.NativeSQL = exports.MacroContent = exports.MacroCall = exports.SpaghettiScopeNode = exports.Token = exports.ScopeType = exports.BasicTypes = exports.TypedIdentifier = exports.AbstractType = exports.VirtualPosition = exports.Comment = exports.Unknown = exports.Empty = exports.Identifier = exports.Nodes = exports.Types = exports.Expressions = exports.Statements = exports.Structures = exports.SkipLogic = exports.Objects = exports.ArtifactsRules = exports.ArtifactsObjects = exports.ArtifactsABAP = exports.BuiltIn = exports.FormLengthStats = exports.FunctionLengthStats = exports.MethodLengthStats = exports.LanguageServer = exports.Registry = exports.CyclomaticComplexityStats = exports.versionToABAPRelease = exports.releaseAtLeast = exports.Release = exports.LanguageVersion = exports.Version = exports.Config = exports.Issue = void 0;
56046
+ exports.LSPEdit = exports.RuleTag = exports.Severity = exports.Visibility = exports.Info = exports.Diagnostics = exports.Rename = exports.PrettyPrinter = exports.Position = exports.CurrentScope = exports.RulesRunner = exports.SpaghettiScope = exports.SyntaxLogic = void 0;
55610
56047
  const issue_1 = __webpack_require__(/*! ./issue */ "../core/build/src/issue.js");
55611
56048
  Object.defineProperty(exports, "Issue", ({ enumerable: true, get: function () { return issue_1.Issue; } }));
55612
56049
  const config_1 = __webpack_require__(/*! ./config */ "../core/build/src/config.js");
@@ -55700,6 +56137,7 @@ const severity_1 = __webpack_require__(/*! ./severity */ "../core/build/src/seve
55700
56137
  Object.defineProperty(exports, "Severity", ({ enumerable: true, get: function () { return severity_1.Severity; } }));
55701
56138
  const ddl_parser_1 = __webpack_require__(/*! ./ddl/ddl_parser */ "../core/build/src/ddl/ddl_parser.js");
55702
56139
  Object.defineProperty(exports, "DDLParser", ({ enumerable: true, get: function () { return ddl_parser_1.DDLParser; } }));
56140
+ Object.defineProperty(exports, "DDLKind", ({ enumerable: true, get: function () { return ddl_parser_1.DDLKind; } }));
55703
56141
  const cds_parser_1 = __webpack_require__(/*! ./cds/cds_parser */ "../core/build/src/cds/cds_parser.js");
55704
56142
  Object.defineProperty(exports, "CDSParser", ({ enumerable: true, get: function () { return cds_parser_1.CDSParser; } }));
55705
56143
  const rules_runner_1 = __webpack_require__(/*! ./rules_runner */ "../core/build/src/rules_runner.js");
@@ -60838,6 +61276,13 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
60838
61276
  }
60839
61277
  }
60840
61278
  }
61279
+ if (found === undefined) {
61280
+ // typed virtual element: VIRTUAL <name> : <type>
61281
+ const names = e.findAllExpressions(expressions_1.CDSName);
61282
+ if (e.findDirectTokenByText("VIRTUAL") !== undefined && names.length > 0) {
61283
+ found = names[0];
61284
+ }
61285
+ }
60841
61286
  if (found === undefined) {
60842
61287
  continue;
60843
61288
  }
@@ -68061,6 +68506,7 @@ const ddic_references_1 = __webpack_require__(/*! ./ddic_references */ "../core/
68061
68506
  const rules_runner_1 = __webpack_require__(/*! ./rules_runner */ "../core/build/src/rules_runner.js");
68062
68507
  const msag_references_1 = __webpack_require__(/*! ./msag_references */ "../core/build/src/msag_references.js");
68063
68508
  const macro_references_1 = __webpack_require__(/*! ./macro_references */ "../core/build/src/macro_references.js");
68509
+ const cross_include_macros_1 = __webpack_require__(/*! ./abap/cross_include_macros */ "../core/build/src/abap/cross_include_macros.js");
68064
68510
  // todo, this should really be an instance in case there are multiple Registry'ies
68065
68511
  class ParsingPerformance {
68066
68512
  static clear() {
@@ -68126,7 +68572,7 @@ class Registry {
68126
68572
  }
68127
68573
  static abaplintVersion() {
68128
68574
  // magic, see build script "version.js"
68129
- return "2.119.54";
68575
+ return "2.119.56";
68130
68576
  }
68131
68577
  getDDICReferences() {
68132
68578
  return this.ddicReferences;
@@ -68350,6 +68796,7 @@ class Registry {
68350
68796
  for (const o of this.getObjects()) {
68351
68797
  this.parsePrivate(o);
68352
68798
  }
68799
+ new cross_include_macros_1.CrossIncludeMacros(this).run();
68353
68800
  new find_global_definitions_1.FindGlobalDefinitions(this).run();
68354
68801
  return this;
68355
68802
  }
@@ -68367,6 +68814,7 @@ class Registry {
68367
68814
  if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {
68368
68815
  ParsingPerformance.output();
68369
68816
  }
68817
+ new cross_include_macros_1.CrossIncludeMacros(this).run();
68370
68818
  new find_global_definitions_1.FindGlobalDefinitions(this).run(input === null || input === void 0 ? void 0 : input.progress);
68371
68819
  return this;
68372
68820
  }