@abaplint/core 2.119.55 → 2.119.57

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 (29) hide show
  1. package/build/abaplint.d.ts +5 -0
  2. package/build/src/abap/2_statements/combi.js +24 -0
  3. package/build/src/abap/2_statements/expand_macros.js +5 -2
  4. package/build/src/abap/2_statements/expressions/_derived_types.js +29 -29
  5. package/build/src/abap/2_statements/expressions/component_chain_simple.js +2 -2
  6. package/build/src/abap/2_statements/expressions/parameter_list_s.js +1 -1
  7. package/build/src/abap/2_statements/expressions/type_table.js +1 -1
  8. package/build/src/abap/2_statements/expressions/type_table_key.js +2 -2
  9. package/build/src/abap/2_statements/expressions/value_body.js +1 -1
  10. package/build/src/abap/5_syntax/expressions/component_chain.js +9 -0
  11. package/build/src/abap/cross_include_macros.js +89 -0
  12. package/build/src/cds/cds_lexer.js +25 -2
  13. package/build/src/cds/expressions/cds_as.js +3 -1
  14. package/build/src/cds/expressions/cds_association.js +2 -1
  15. package/build/src/cds/expressions/cds_define_hierarchy.js +2 -4
  16. package/build/src/cds/expressions/cds_define_table_entity.js +4 -4
  17. package/build/src/cds/expressions/cds_define_view.js +4 -2
  18. package/build/src/cds/expressions/cds_element.js +6 -2
  19. package/build/src/cds/expressions/cds_extend_view.js +3 -1
  20. package/build/src/cds/expressions/cds_parameters_select.js +3 -1
  21. package/build/src/cds/expressions/cds_prefixed_name.js +2 -2
  22. package/build/src/cds/expressions/cds_relation.js +1 -1
  23. package/build/src/cds/expressions/cds_select.js +4 -3
  24. package/build/src/cds/expressions/cds_source.js +1 -4
  25. package/build/src/cds/expressions/cds_string.js +2 -2
  26. package/build/src/cds/expressions/cds_table_field.js +19 -0
  27. package/build/src/cds/expressions/index.js +1 -0
  28. package/build/src/registry.js +4 -1
  29. package/package.json +1 -1
@@ -1046,6 +1046,10 @@ declare class CDSString extends Expression {
1046
1046
  getRunnable(): IStatementRunnable;
1047
1047
  }
1048
1048
 
1049
+ declare class CDSTableField extends Expression {
1050
+ getRunnable(): IStatementRunnable;
1051
+ }
1052
+
1049
1053
  declare class CDSType extends AbstractObject {
1050
1054
  getType(): string;
1051
1055
  getAllowedNaming(): {
@@ -2771,6 +2775,7 @@ declare namespace ExpressionsCDS {
2771
2775
  CDSSelect,
2772
2776
  CDSSource,
2773
2777
  CDSString,
2778
+ CDSTableField,
2774
2779
  CDSType_2 as CDSType,
2775
2780
  CDSWhere,
2776
2781
  CDSWithParameters
@@ -53,6 +53,7 @@ exports.verNotLang = verNotLang;
53
53
  exports.failCombinator = failCombinator;
54
54
  exports.failStar = failStar;
55
55
  exports.stopBefore = stopBefore;
56
+ exports.stopBefore1 = stopBefore1;
56
57
  const Tokens = __importStar(require("../1_lexer/tokens"));
57
58
  const nodes_1 = require("../nodes");
58
59
  const version_1 = require("../../version");
@@ -1033,4 +1034,27 @@ class StopBefore2 {
1033
1034
  function stopBefore(t1, t2) {
1034
1035
  return new StopBefore2(t1, t2);
1035
1036
  }
1037
+ class StopBefore1 {
1038
+ constructor(words) { this.words = words.map(w => w.toUpperCase()); }
1039
+ listKeywords() { return []; }
1040
+ getUsing() { return []; }
1041
+ run(r) {
1042
+ var _a;
1043
+ const result = [];
1044
+ for (const input of r) {
1045
+ const next = (_a = input.peek()) === null || _a === void 0 ? void 0 : _a.getUpperStr();
1046
+ if (next !== undefined && this.words.includes(next)) {
1047
+ continue;
1048
+ }
1049
+ result.push(input);
1050
+ }
1051
+ return result;
1052
+ }
1053
+ railroad() { return "Railroad.Terminal('stopBefore(" + this.words.join("|") + ")')"; }
1054
+ toStr() { return "stopBefore(" + this.words.join(",") + ")"; }
1055
+ first() { return [""]; }
1056
+ }
1057
+ function stopBefore1(...words) {
1058
+ return new StopBefore1(words);
1059
+ }
1036
1060
  //# sourceMappingURL=combi.js.map
@@ -89,6 +89,9 @@ class ExpandMacros {
89
89
  this.globalMacros = globalMacros;
90
90
  this.reg = reg;
91
91
  }
92
+ listMacroNames() {
93
+ return this.macros.listMacroNames();
94
+ }
92
95
  find(statements, file, clear = true) {
93
96
  var _a, _b, _c;
94
97
  let nameToken = undefined;
@@ -142,7 +145,7 @@ class ExpandMacros {
142
145
  for (const statement of statements) {
143
146
  const type = statement.get();
144
147
  if (type instanceof _statement_1.Unknown || type instanceof _statement_1.MacroCall) {
145
- const macroName = this.findName(statement.getTokens());
148
+ const macroName = ExpandMacros.findName(statement.getTokens());
146
149
  if (macroName && this.macros.isMacro(macroName)) {
147
150
  const filename = this.macros.getMacroFilename(macroName);
148
151
  if (filename) {
@@ -234,7 +237,7 @@ class ExpandMacros {
234
237
  }
235
238
  return result;
236
239
  }
237
- findName(tokens) {
240
+ static findName(tokens) {
238
241
  let macroName = undefined;
239
242
  let previous = undefined;
240
243
  for (const i of tokens) {
@@ -9,40 +9,40 @@ function commonDerivedTypes() {
9
9
  const entity = (0, combi_1.alt)(_1.TypeName, _1.EntityAssociation);
10
10
  // more-specific keyword phrases (e.g. "FAILED LATE") must precede less-specific ones ("FAILED")
11
11
  return [
12
- (0, combi_1.ver)(version_1.Release.v774, (0, combi_1.seq)("FAILED LATE", entity)),
13
- (0, combi_1.ver)(version_1.Release.v774, (0, combi_1.seq)("MAPPED LATE", entity)),
14
- (0, combi_1.ver)(version_1.Release.v774, (0, combi_1.seq)("REPORTED LATE", entity)),
15
- (0, combi_1.ver)(version_1.Release.v777, (0, combi_1.seq)("FAILED EARLY", entity)),
16
- (0, combi_1.ver)(version_1.Release.v777, (0, combi_1.seq)("MAPPED EARLY", entity)),
17
- (0, combi_1.ver)(version_1.Release.v777, (0, combi_1.seq)("REPORTED EARLY", entity)),
18
- (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("FAILED", entity)),
19
- (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("MAPPED", entity)),
20
- (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("REPORTED", entity)),
21
- (0, combi_1.ver)(version_1.Release.v773, (0, combi_1.seq)("FUNCTION IMPORT", entity)),
22
- (0, combi_1.ver)(version_1.Release.v773, (0, combi_1.seq)("FUNCTION RESULT", entity)),
23
- (0, combi_1.ver)(version_1.Release.v773, (0, combi_1.seq)("ACTION RESULT", entity)),
24
- (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("INSTANCE AUTHORIZATION KEY", entity)),
25
- (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("INSTANCE AUTHORIZATION REQUEST", entity)),
26
- (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("INSTANCE AUTHORIZATION RESULT", entity)),
27
- (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("INSTANCE FEATURES KEY", entity)),
28
- (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("INSTANCE FEATURES REQUEST", entity)),
29
- (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("INSTANCE FEATURES RESULT", entity)),
30
- (0, combi_1.ver)(version_1.Release.v780, (0, combi_1.seq)("AUTHORIZATION RESULT", entity)),
31
- (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("AUTHORIZATION KEY", entity)),
32
- (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("FEATURES RESULT", entity)),
33
- (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("FEATURES KEY", entity)),
34
- (0, combi_1.ver)(version_1.Release.v780, (0, combi_1.seq)("PERMISSIONS KEY", entity)),
12
+ (0, combi_1.ver)(version_1.Release.v774, (0, combi_1.seq)("FAILED LATE", entity), { also: combi_1.AlsoIn.OpenABAP }),
13
+ (0, combi_1.ver)(version_1.Release.v774, (0, combi_1.seq)("MAPPED LATE", entity), { also: combi_1.AlsoIn.OpenABAP }),
14
+ (0, combi_1.ver)(version_1.Release.v774, (0, combi_1.seq)("REPORTED LATE", entity), { also: combi_1.AlsoIn.OpenABAP }),
15
+ (0, combi_1.ver)(version_1.Release.v777, (0, combi_1.seq)("FAILED EARLY", entity), { also: combi_1.AlsoIn.OpenABAP }),
16
+ (0, combi_1.ver)(version_1.Release.v777, (0, combi_1.seq)("MAPPED EARLY", entity), { also: combi_1.AlsoIn.OpenABAP }),
17
+ (0, combi_1.ver)(version_1.Release.v777, (0, combi_1.seq)("REPORTED EARLY", entity), { also: combi_1.AlsoIn.OpenABAP }),
18
+ (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("FAILED", entity), { also: combi_1.AlsoIn.OpenABAP }),
19
+ (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("MAPPED", entity), { also: combi_1.AlsoIn.OpenABAP }),
20
+ (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("REPORTED", entity), { also: combi_1.AlsoIn.OpenABAP }),
21
+ (0, combi_1.ver)(version_1.Release.v773, (0, combi_1.seq)("FUNCTION IMPORT", entity), { also: combi_1.AlsoIn.OpenABAP }),
22
+ (0, combi_1.ver)(version_1.Release.v773, (0, combi_1.seq)("FUNCTION RESULT", entity), { also: combi_1.AlsoIn.OpenABAP }),
23
+ (0, combi_1.ver)(version_1.Release.v773, (0, combi_1.seq)("ACTION RESULT", entity), { also: combi_1.AlsoIn.OpenABAP }),
24
+ (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("INSTANCE AUTHORIZATION KEY", entity), { also: combi_1.AlsoIn.OpenABAP }),
25
+ (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("INSTANCE AUTHORIZATION REQUEST", entity), { also: combi_1.AlsoIn.OpenABAP }),
26
+ (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("INSTANCE AUTHORIZATION RESULT", entity), { also: combi_1.AlsoIn.OpenABAP }),
27
+ (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("INSTANCE FEATURES KEY", entity), { also: combi_1.AlsoIn.OpenABAP }),
28
+ (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("INSTANCE FEATURES REQUEST", entity), { also: combi_1.AlsoIn.OpenABAP }),
29
+ (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("INSTANCE FEATURES RESULT", entity), { also: combi_1.AlsoIn.OpenABAP }),
30
+ (0, combi_1.ver)(version_1.Release.v780, (0, combi_1.seq)("AUTHORIZATION RESULT", entity), { also: combi_1.AlsoIn.OpenABAP }),
31
+ (0, combi_1.ver)(version_1.Release.v781, (0, combi_1.seq)("AUTHORIZATION KEY", entity), { also: combi_1.AlsoIn.OpenABAP }),
32
+ (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("FEATURES RESULT", entity), { also: combi_1.AlsoIn.OpenABAP }),
33
+ (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("FEATURES KEY", entity), { also: combi_1.AlsoIn.OpenABAP }),
34
+ (0, combi_1.ver)(version_1.Release.v780, (0, combi_1.seq)("PERMISSIONS KEY", entity), { also: combi_1.AlsoIn.OpenABAP }),
35
35
  (0, combi_1.seq)("READ IMPORT", entity),
36
36
  (0, combi_1.seq)("READ RESULT", entity),
37
- (0, combi_1.ver)(version_1.Release.v915, (0, combi_1.seq)("READ CHANGES", entity)),
37
+ (0, combi_1.ver)(version_1.Release.v915, (0, combi_1.seq)("READ CHANGES", entity), { also: combi_1.AlsoIn.OpenABAP }),
38
38
  (0, combi_1.seq)("CREATE", entity),
39
39
  (0, combi_1.seq)("DELETE", entity),
40
40
  (0, combi_1.seq)("UPDATE", entity),
41
- (0, combi_1.ver)(version_1.Release.v777, (0, combi_1.seq)("LOCK", entity)),
42
- (0, combi_1.ver)(version_1.Release.v775, (0, combi_1.seq)("KEY OF", entity)),
43
- (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("DETERMINATION", entity)),
44
- (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("VALIDATION", entity)),
45
- (0, combi_1.ver)(version_1.Release.v778, (0, combi_1.seq)("CHANGE", entity)),
41
+ (0, combi_1.ver)(version_1.Release.v777, (0, combi_1.seq)("LOCK", entity), { also: combi_1.AlsoIn.OpenABAP }),
42
+ (0, combi_1.ver)(version_1.Release.v775, (0, combi_1.seq)("KEY OF", entity), { also: combi_1.AlsoIn.OpenABAP }),
43
+ (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("DETERMINATION", entity), { also: combi_1.AlsoIn.OpenABAP }),
44
+ (0, combi_1.ver)(version_1.Release.v776, (0, combi_1.seq)("VALIDATION", entity), { also: combi_1.AlsoIn.OpenABAP }),
45
+ (0, combi_1.ver)(version_1.Release.v778, (0, combi_1.seq)("CHANGE", entity), { also: combi_1.AlsoIn.OpenABAP }),
46
46
  ];
47
47
  }
48
48
  function derivedTypesAlt(...extra) {
@@ -5,8 +5,8 @@ const combi_1 = require("../combi");
5
5
  const _1 = require(".");
6
6
  class ComponentChainSimple extends combi_1.Expression {
7
7
  getRunnable() {
8
- const chain = (0, combi_1.seq)(_1.ComponentName, (0, combi_1.starPrio)((0, combi_1.seq)(_1.ArrowOrDash, _1.ComponentName)));
9
- const ret = (0, combi_1.seq)(chain, (0, combi_1.optPrio)(_1.FieldOffset), (0, combi_1.optPrio)(_1.FieldLength));
8
+ const chain = (0, combi_1.starPrio)((0, combi_1.altPrio)(_1.Dereference, (0, combi_1.seq)(_1.ArrowOrDash, _1.ComponentName)));
9
+ const ret = (0, combi_1.seq)(_1.ComponentName, chain, (0, combi_1.optPrio)(_1.FieldOffset), (0, combi_1.optPrio)(_1.FieldLength));
10
10
  return ret;
11
11
  }
12
12
  }
@@ -5,7 +5,7 @@ const combi_1 = require("../combi");
5
5
  const _1 = require(".");
6
6
  class ParameterListS extends combi_1.Expression {
7
7
  getRunnable() {
8
- return (0, combi_1.plus)(_1.ParameterS);
8
+ return (0, combi_1.plusPrio)(_1.ParameterS);
9
9
  }
10
10
  }
11
11
  exports.ParameterListS = ParameterListS;
@@ -21,7 +21,7 @@ class TypeTable extends combi_1.Expression {
21
21
  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")));
22
22
  const occurs = (0, combi_1.seq)("OCCURS", (0, combi_1.altPrio)(_1.Integer, field_chain_1.FieldChain));
23
23
  const entity = (0, combi_1.alt)(_1.TypeName, _1.EntityAssociation);
24
- 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)));
24
+ 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 }));
25
25
  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 });
26
26
  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));
27
27
  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));
@@ -9,10 +9,10 @@ class TypeTableKey extends combi_1.Expression {
9
9
  const uniqueness = (0, combi_1.alt)("NON-UNIQUE", "UNIQUE");
10
10
  const defaultKey = "DEFAULT KEY";
11
11
  const emptyKey = (0, combi_1.ver)(version_1.Release.v740sp02, "EMPTY KEY", { also: combi_1.AlsoIn.OpenABAP });
12
- const components = (0, combi_1.plus)((0, combi_1.alt)((0, combi_1.seq)("WITH", (0, combi_1.failStar)()), _1.FieldSub));
12
+ const components = (0, combi_1.plusPrio)((0, combi_1.seq)((0, combi_1.stopBefore1)("WITH", "INITIAL", "WITHOUT"), (0, combi_1.stopBefore)("READ", "-"), _1.FieldSub));
13
13
  const further = (0, combi_1.seq)((0, combi_1.alt)("WITHOUT", "WITH"), "FURTHER SECONDARY KEYS");
14
14
  const alias = (0, combi_1.seq)("ALIAS", _1.Field);
15
- const key = (0, combi_1.seq)("WITH", (0, combi_1.opt)(uniqueness), (0, combi_1.altPrio)(defaultKey, emptyKey, (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.alt)("SORTED", "HASHED")), "KEY", (0, combi_1.alt)((0, combi_1.seq)(_1.Field, (0, combi_1.opt)(alias), "COMPONENTS", components), components))), (0, combi_1.optPrio)(further), (0, combi_1.optPrio)("READ-ONLY"));
15
+ const key = (0, combi_1.seq)("WITH", (0, combi_1.optPrio)(uniqueness), (0, combi_1.altPrio)(defaultKey, emptyKey, (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.alt)("SORTED", "HASHED")), "KEY", (0, combi_1.altPrio)((0, combi_1.seq)(_1.Field, (0, combi_1.opt)(alias), "COMPONENTS", components), components))), (0, combi_1.optPrio)(further), (0, combi_1.optPrio)("READ-ONLY"));
16
16
  return key;
17
17
  }
18
18
  }
@@ -6,7 +6,7 @@ const _1 = require(".");
6
6
  const version_1 = require("../../../version");
7
7
  class ValueBody extends combi_1.Expression {
8
8
  getRunnable() {
9
- const strucOrTab = (0, combi_1.seq)((0, combi_1.optPrio)(_1.Let), (0, combi_1.optPrio)(_1.ValueBase), (0, combi_1.star)(_1.For), (0, combi_1.plusPrio)((0, combi_1.altPrio)(_1.FieldAssignment, _1.ValueBodyLine)));
9
+ const strucOrTab = (0, combi_1.seq)((0, combi_1.optPrio)(_1.Let), (0, combi_1.optPrio)(_1.ValueBase), (0, combi_1.starPrio)(_1.For), (0, combi_1.plusPrio)((0, combi_1.altPrio)(_1.FieldAssignment, _1.ValueBodyLine)));
10
10
  const tabdef = (0, combi_1.ver)(version_1.Release.v740sp08, (0, combi_1.altPrio)("OPTIONAL", (0, combi_1.seq)("DEFAULT", _1.Source)), { also: combi_1.AlsoIn.OpenABAP });
11
11
  return (0, combi_1.optPrio)((0, combi_1.altPrio)(strucOrTab, (0, combi_1.seq)(_1.Source, (0, combi_1.optPrio)(tabdef))));
12
12
  }
@@ -56,6 +56,15 @@ class ComponentChain {
56
56
  if (i === 0 && child.concatTokens().toUpperCase() === "TABLE_LINE") {
57
57
  continue;
58
58
  }
59
+ else if (child.get() instanceof Expressions.Dereference) {
60
+ if (!(context instanceof basic_1.DataReference)) {
61
+ const message = "Not a data reference, cannot be dereferenced";
62
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, child.getFirstToken(), message));
63
+ return void_type_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
64
+ }
65
+ context = context.getType();
66
+ continue;
67
+ }
59
68
  else if (child.get() instanceof Expressions.ArrowOrDash) {
60
69
  const concat = child.concatTokens();
61
70
  if (concat === "-") {
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CrossIncludeMacros = void 0;
4
+ const _abap_object_1 = require("../objects/_abap_object");
5
+ const program_1 = require("../objects/program");
6
+ const _statement_1 = require("./2_statements/statements/_statement");
7
+ const expand_macros_1 = require("./2_statements/expand_macros");
8
+ const include_graph_1 = require("../utils/include_graph");
9
+ // Macros can be defined in one include and used in a sibling include, connected
10
+ // via the main program. Objects are parsed in isolation, so the sibling include
11
+ // initially ends up with Unknown statements. This second pass finds the main
12
+ // program(s) for such includes, collects the macro definitions visible there,
13
+ // and re-parses the include with the macro names as extra global macros.
14
+ class CrossIncludeMacros {
15
+ constructor(reg) {
16
+ this.reg = reg;
17
+ }
18
+ run() {
19
+ const candidates = this.findCandidates();
20
+ if (candidates.length === 0) {
21
+ return;
22
+ }
23
+ const graph = new include_graph_1.IncludeGraph(this.reg);
24
+ const config = this.reg.getConfig();
25
+ const globalMacros = config.getSyntaxSetttings().globalMacros || [];
26
+ for (const prog of candidates) {
27
+ const mains = this.findMains(graph, prog);
28
+ if (mains.size === 0) {
29
+ continue;
30
+ }
31
+ const expand = new expand_macros_1.ExpandMacros(globalMacros, config.getRelease(), this.reg, config.getLanguageVersion());
32
+ for (const main of mains) {
33
+ for (const file of main.getABAPFiles()) {
34
+ // find() follows INCLUDE statements, so this collects macros from the full include chain
35
+ expand.find([...file.getStatements()], file, false);
36
+ }
37
+ }
38
+ const macroNames = expand.listMacroNames();
39
+ if (this.matchesUnknown(prog, new Set(macroNames))) {
40
+ prog.setDirty();
41
+ prog.parse(config.getRelease(), macroNames, this.reg, config.getLanguageVersion());
42
+ }
43
+ }
44
+ }
45
+ //////////////////////////////
46
+ findCandidates() {
47
+ const ret = [];
48
+ for (const obj of this.reg.getObjects()) {
49
+ if (!(obj instanceof program_1.Program) || obj.isInclude() === false) {
50
+ continue;
51
+ }
52
+ for (const file of obj.getABAPFiles()) {
53
+ if (file.getStatements().some(s => s.get() instanceof _statement_1.Unknown)) {
54
+ ret.push(obj);
55
+ break;
56
+ }
57
+ }
58
+ }
59
+ return ret;
60
+ }
61
+ findMains(graph, prog) {
62
+ var _a;
63
+ const ret = new Set();
64
+ const filename = (_a = prog.getMainABAPFile()) === null || _a === void 0 ? void 0 : _a.getFilename();
65
+ for (const mainFilename of graph.listMainForInclude(filename)) {
66
+ const file = this.reg.getFileByName(mainFilename);
67
+ const obj = file ? this.reg.findObjectForFile(file) : undefined;
68
+ if (obj instanceof _abap_object_1.ABAPObject) {
69
+ ret.add(obj);
70
+ }
71
+ }
72
+ return ret;
73
+ }
74
+ matchesUnknown(prog, macroNames) {
75
+ for (const file of prog.getABAPFiles()) {
76
+ for (const s of file.getStatements()) {
77
+ if (s.get() instanceof _statement_1.Unknown) {
78
+ const name = expand_macros_1.ExpandMacros.findName(s.getTokens());
79
+ if (name !== undefined && macroNames.has(name.toUpperCase())) {
80
+ return true;
81
+ }
82
+ }
83
+ }
84
+ }
85
+ return false;
86
+ }
87
+ }
88
+ exports.CrossIncludeMacros = CrossIncludeMacros;
89
+ //# sourceMappingURL=cross_include_macros.js.map
@@ -26,8 +26,9 @@ var Mode;
26
26
  (function (Mode) {
27
27
  Mode[Mode["Default"] = 0] = "Default";
28
28
  Mode[Mode["String"] = 1] = "String";
29
- Mode[Mode["SingleLineComment"] = 2] = "SingleLineComment";
30
- Mode[Mode["MultiLineComment"] = 3] = "MultiLineComment";
29
+ Mode[Mode["DoubleQuoteString"] = 2] = "DoubleQuoteString";
30
+ Mode[Mode["SingleLineComment"] = 3] = "SingleLineComment";
31
+ Mode[Mode["MultiLineComment"] = 4] = "MultiLineComment";
31
32
  })(Mode || (Mode = {}));
32
33
  class Result {
33
34
  constructor() {
@@ -87,6 +88,23 @@ class CDSLexer {
87
88
  }
88
89
  continue;
89
90
  }
91
+ // double-quote string handling
92
+ if (mode === Mode.DoubleQuoteString) {
93
+ build += next;
94
+ if (next === "\\" && nextNext === "\"") {
95
+ build += stream.takeNext();
96
+ col++;
97
+ }
98
+ else if (next === "\"" && nextNext === "\"") {
99
+ build += stream.takeNext();
100
+ col++;
101
+ }
102
+ else if (next === "\"") {
103
+ build = result.add(build, row, col, mode);
104
+ mode = Mode.Default;
105
+ }
106
+ continue;
107
+ }
90
108
  // single line comment handling
91
109
  if (mode === Mode.SingleLineComment) {
92
110
  if (next === "\n") {
@@ -133,6 +151,11 @@ class CDSLexer {
133
151
  mode = Mode.String;
134
152
  build += next;
135
153
  break;
154
+ case "\"":
155
+ build = result.add(build, row, col, mode);
156
+ mode = Mode.DoubleQuoteString;
157
+ build += next;
158
+ break;
136
159
  case " ":
137
160
  case "\t":
138
161
  build = result.add(build, row, col, mode);
@@ -7,7 +7,9 @@ class CDSAs extends combi_1.Expression {
7
7
  getRunnable() {
8
8
  const redirected = (0, combi_1.seq)(": REDIRECTED TO", (0, combi_1.optPrio)((0, combi_1.altPrio)("PARENT", "COMPOSITION CHILD")), _1.CDSName);
9
9
  const colonType = (0, combi_1.seq)(":", (0, combi_1.altPrio)(_1.CDSType, _1.CDSName, "LOCALIZED"));
10
- return (0, combi_1.seq)("AS", _1.CDSName, (0, combi_1.optPrio)((0, combi_1.altPrio)(redirected, colonType)));
10
+ const ident = (0, combi_1.regex)(/^\w+$/);
11
+ const namespacedAlias = (0, combi_1.seq)(ident, "/", ident, "/", ident);
12
+ return (0, combi_1.seq)("AS", (0, combi_1.altPrio)(namespacedAlias, _1.CDSName), (0, combi_1.optPrio)((0, combi_1.altPrio)(redirected, colonType)));
11
13
  }
12
14
  }
13
15
  exports.CDSAs = CDSAs;
@@ -17,8 +17,9 @@ class CDSAssociation extends combi_1.Expression {
17
17
  // Numeric OF form: "association of [0..1] to Target on ..."
18
18
  const ofNumericForm = (0, combi_1.seq)("ASSOCIATION", "OF", numericCardinality, "TO", _1.CDSRelation, "ON", _1.CDSCondition);
19
19
  // "association [0..1] to Target as _Alias on condition" — standard form
20
+ const parentForm = (0, combi_1.seq)("ASSOCIATION", "TO", "PARENT", _1.CDSRelation);
20
21
  const standardForm = (0, combi_1.seq)("ASSOCIATION", (0, combi_1.optPrio)(cds_cardinality_1.CDSCardinality), "TO", (0, combi_1.opt)((0, combi_1.altPrio)(textCardinality, "PARENT")), _1.CDSRelation, "ON", _1.CDSCondition, (0, combi_1.opt)((0, combi_1.seq)("WITH", "DEFAULT", "FILTER", _1.CDSCondition)));
21
- return (0, combi_1.altPrio)(ofTextForm, ofNumericForm, standardForm);
22
+ return (0, combi_1.altPrio)(ofTextForm, ofNumericForm, standardForm, parentForm);
22
23
  }
23
24
  }
24
25
  exports.CDSAssociation = CDSAssociation;
@@ -12,11 +12,9 @@ class CDSDefineHierarchy extends combi_1.Expression {
12
12
  const directory = (0, combi_1.seq)("DIRECTORY", _1.CDSName, "FILTER", "BY", _1.CDSCondition);
13
13
  // DATE PERIOD: period from <field> to <field> [valid from :p to :p]
14
14
  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)));
15
- // DEPTH accepts an integer literal or a parameter reference (:param)
16
- const depthValue = (0, combi_1.altPrio)(_1.CDSInteger, _1.CDSPrefixedName);
17
- // LOAD mode: BULK, INCREMENTAL, or a parameter reference ($parameters.p_load)
15
+ const depthValue = (0, combi_1.altPrio)(_1.CDSString, _1.CDSInteger, _1.CDSPrefixedName);
18
16
  const loadMode = (0, combi_1.altPrio)("BULK", "INCREMENTAL", _1.CDSPrefixedName);
19
- 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"))));
17
+ 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)("DEPTH", depthValue)), (0, combi_1.opt)((0, combi_1.seq)("NODETYPE", _1.CDSName)), (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"))));
20
18
  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)(";"));
21
19
  }
22
20
  }
@@ -5,10 +5,10 @@ const _1 = require(".");
5
5
  const combi_1 = require("../../abap/2_statements/combi");
6
6
  class CDSDefineTableEntity extends combi_1.Expression {
7
7
  getRunnable() {
8
- const nullability = (0, combi_1.optPrio)((0, combi_1.alt)("NOT NULL", "NULL"));
9
- 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, ";");
10
- const assocOrComp = (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), _1.CDSName, ":", (0, combi_1.alt)(_1.CDSComposition, _1.CDSAssociation), ";");
11
- const inlineBody = (0, combi_1.plus)((0, combi_1.alt)(field, assocOrComp));
8
+ // Inline `{ ... }` body: one or more table-field entries. Each entry is
9
+ // wrapped in a CDSTableField node so downstream tooling can pair each
10
+ // field name with its own annotations.
11
+ const inlineBody = (0, combi_1.plus)(_1.CDSTableField);
12
12
  const elementList = (0, combi_1.seq)(_1.CDSElement, (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.opt)(","));
13
13
  const elements = (0, combi_1.seq)((0, combi_1.str)("{"), (0, combi_1.altPrio)("*", elementList), (0, combi_1.str)("}"));
14
14
  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));
@@ -10,8 +10,10 @@ const cds_with_parameters_1 = require("./cds_with_parameters");
10
10
  class CDSDefineView extends combi_1.Expression {
11
11
  getRunnable() {
12
12
  const columnAlias = (0, combi_1.seq)("(", cds_name_1.CDSName, (0, combi_1.star)((0, combi_1.seq)(",", cds_name_1.CDSName)), ")");
13
- 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
14
- (0, combi_1.opt)(";"));
13
+ const parenSelect = (0, combi_1.seq)("(", cds_select_1.CDSSelect, ")");
14
+ const unionBranch = (0, combi_1.altPrio)(parenSelect, cds_select_1.CDSSelect);
15
+ const topLevelSelect = (0, combi_1.altPrio)((0, combi_1.seq)(parenSelect, (0, combi_1.star)((0, combi_1.altPrio)((0, combi_1.seq)("UNION", (0, combi_1.opt)("ALL"), unionBranch), (0, combi_1.seq)("EXCEPT", unionBranch), (0, combi_1.seq)("INTERSECT", unionBranch)))), cds_select_1.CDSSelect);
16
+ 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", topLevelSelect, (0, combi_1.opt)((0, combi_1.seq)("WITH", "HIERARCHY", cds_name_1.CDSName)), (0, combi_1.opt)(";"));
15
17
  }
16
18
  }
17
19
  exports.CDSDefineView = CDSDefineView;
@@ -10,9 +10,13 @@ class CDSElement extends combi_1.Expression {
10
10
  const redirected = (0, combi_1.seq)(": REDIRECTED TO", (0, combi_1.optPrio)((0, combi_1.altPrio)("PARENT", "COMPOSITION CHILD")), _1.CDSName);
11
11
  const colonThing = (0, combi_1.seq)(":", (0, combi_1.altPrio)(_1.CDSType, _1.CDSName, "LOCALIZED"));
12
12
  const extensionWildcard = (0, combi_1.seq)("$extension", ".", "*");
13
- const includeElement = (0, combi_1.seq)("INCLUDE", _1.CDSPrefixedName);
13
+ const excludingNames = (0, combi_1.seq)(_1.CDSName, (0, combi_1.starPrio)((0, combi_1.seq)(",", _1.CDSName)));
14
+ const excluding = (0, combi_1.seq)("EXCLUDING", "{", excludingNames, "}");
15
+ const includeElement = (0, combi_1.seq)("INCLUDE", _1.CDSPrefixedName, (0, combi_1.optPrio)(excluding), (0, combi_1.optPrio)("SIGNATURE ONLY"));
14
16
  const typedVirtual = (0, combi_1.seq)("VIRTUAL", _1.CDSName, ":", _1.CDSType);
15
- 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);
17
+ const pathSegment = (0, combi_1.seq)(".", (0, combi_1.altPrio)(_1.CDSString, _1.CDSName, "*"), (0, combi_1.optPrio)((0, combi_1.altPrio)(_1.CDSParametersSelect, _1.CDSParameters)));
18
+ const funcWithPath = (0, combi_1.seq)(_1.CDSFunction, (0, combi_1.plusPrio)(pathSegment));
19
+ const body = (0, combi_1.altPrio)(extensionWildcard, includeElement, _1.CDSArithmetics, _1.CDSAggregate, _1.CDSString, _1.CDSArithParen, funcWithPath, _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);
16
20
  const elementBody = (0, combi_1.altPrio)(typedVirtual, (0, combi_1.seq)((0, combi_1.altPrio)("KEY", "VIRTUAL"), body), body);
17
21
  return (0, combi_1.seq)((0, combi_1.starPrio)(_1.CDSAnnotation), elementBody, (0, combi_1.optPrio)(cds_as_1.CDSAs));
18
22
  }
@@ -8,7 +8,9 @@ class CDSExtendView extends combi_1.Expression {
8
8
  const namedot = (0, combi_1.seq)(_1.CDSName, (0, combi_1.optPrio)((0, combi_1.seq)(".", _1.CDSName)), (0, combi_1.optPrio)(_1.CDSAs));
9
9
  const valueNested = (0, combi_1.seq)("{", namedot, (0, combi_1.star)((0, combi_1.seq)(",", namedot)), "}");
10
10
  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);
11
- 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)(";"));
11
+ const elementList = (0, combi_1.seq)(_1.CDSElement, (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.opt)(","));
12
+ const elementNested = (0, combi_1.seq)("{", (0, combi_1.altPrio)("*", elementList), "}");
13
+ 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), (0, combi_1.star)(_1.CDSAssociation), (0, combi_1.altPrio)(elementNested, valueNested), (0, combi_1.opt)(";"));
12
14
  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, ";");
13
15
  const assocOrComp = (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), _1.CDSName, ":", (0, combi_1.alt)(_1.CDSComposition, _1.CDSAssociation), ";");
14
16
  const entityBody = (0, combi_1.seq)("{", (0, combi_1.plus)((0, combi_1.alt)(field, assocOrComp)), "}");
@@ -7,7 +7,9 @@ class CDSParametersSelect extends combi_1.Expression {
7
7
  getRunnable() {
8
8
  const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.opt)((0, combi_1.seq)(".", _1.CDSName)));
9
9
  const value = (0, combi_1.alt)(_1.CDSInteger, name, _1.CDSString);
10
- const nameValue = (0, combi_1.seq)(name, ":", value);
10
+ const colonPair = (0, combi_1.seq)(name, ":", value, (0, combi_1.optPrio)("DEFAULT"));
11
+ const arrowPair = (0, combi_1.seq)(name, "=", ">", value);
12
+ const nameValue = (0, combi_1.altPrio)(colonPair, arrowPair);
11
13
  return (0, combi_1.seq)("(", nameValue, (0, combi_1.star)((0, combi_1.seq)(",", nameValue)), ")");
12
14
  }
13
15
  }
@@ -16,13 +16,13 @@ class CDSPrefixedName extends combi_1.Expression {
16
16
  const cardinalityJoin = (0, combi_1.seq)("[", cardSpec, ":", joinType, "]");
17
17
  const cardinalityJoinWhere = (0, combi_1.seq)("[", cardSpec, ":", joinType, "WHERE", cds_condition_1.CDSCondition, "]");
18
18
  const joinWhere = (0, combi_1.seq)("[", joinType, "WHERE", cds_condition_1.CDSCondition, "]");
19
- const textCard = (0, combi_1.altPrio)("TO EXACT ONE", "TO ONE", "TO MANY");
19
+ const textCard = (0, combi_1.altPrio)("MANY TO EXACT ONE", "MANY TO ONE", "ONE TO MANY", "ONE TO ONE", "TO EXACT ONE", "TO ONE", "TO MANY");
20
20
  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))), "]");
21
21
  const cardNum = (0, combi_1.altPrio)(cds_integer_1.CDSInteger, "*");
22
22
  const rangeCard = (0, combi_1.seq)(cds_integer_1.CDSInteger, ".", ".", cardNum);
23
23
  const rangeCardFilter = (0, combi_1.seq)("[", rangeCard, ":", cds_condition_1.CDSCondition, "]");
24
24
  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, "]"));
25
- 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));
25
+ 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));
26
26
  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));
27
27
  }
28
28
  }
@@ -6,7 +6,7 @@ const combi_1 = require("../../abap/2_statements/combi");
6
6
  class CDSRelation extends combi_1.Expression {
7
7
  getRunnable() {
8
8
  const pre = (0, combi_1.seq)("/", (0, combi_1.regex)(/^[\w_]+$/), "/");
9
- return (0, combi_1.seq)((0, combi_1.opt)(pre), (0, combi_1.regex)(/^[\w_]+$/), (0, combi_1.opt)(_1.CDSAs));
9
+ return (0, combi_1.seq)((0, combi_1.opt)(pre), (0, combi_1.regex)(/^[\w_]+$/), (0, combi_1.opt)(_1.CDSParametersSelect), (0, combi_1.opt)(_1.CDSAs));
10
10
  }
11
11
  }
12
12
  exports.CDSRelation = CDSRelation;
@@ -11,11 +11,12 @@ class CDSSelect extends combi_1.Expression {
11
11
  const distinct = (0, combi_1.str)("DISTINCT");
12
12
  const elementList = (0, combi_1.seq)(_1.CDSElement, (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.opt)(","));
13
13
  const elements = (0, combi_1.seq)((0, combi_1.str)("{"), (0, combi_1.altPrio)("*", elementList), (0, combi_1.str)("}"));
14
- const aspectBinding = (0, combi_1.seq)(_1.CDSPrefixedName, "=", ">", _1.CDSPrefixedName);
15
- const bindAspect = (0, combi_1.seq)("BIND", "ASPECT", _1.CDSName, "(", aspectBinding, (0, combi_1.starPrio)((0, combi_1.seq)(",", aspectBinding)), ")");
14
+ const aspectValue = (0, combi_1.altPrio)(_1.CDSString, _1.CDSPrefixedName);
15
+ const aspectBinding = (0, combi_1.seq)(_1.CDSPrefixedName, "=", ">", aspectValue);
16
+ const bindAspect = (0, combi_1.seq)("BIND", "ASPECT", _1.CDSName, "(", aspectBinding, (0, combi_1.starPrio)((0, combi_1.seq)(",", aspectBinding)), ")", (0, combi_1.optPrio)((0, combi_1.seq)("AS", _1.CDSName)));
16
17
  const parenSelect = (0, combi_1.seq)("(", CDSSelect, ")");
17
18
  const unionBranch = (0, combi_1.altPrio)(parenSelect, CDSSelect);
18
- 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))));
19
+ 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.starPrio)(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))));
19
20
  }
20
21
  }
21
22
  exports.CDSSelect = CDSSelect;
@@ -6,10 +6,7 @@ const combi_1 = require("../../abap/2_statements/combi");
6
6
  class CDSSource extends combi_1.Expression {
7
7
  getRunnable() {
8
8
  const staticFilter = (0, combi_1.seq)("[", _1.CDSCondition, "]");
9
- // Dotted path: T._Assoc association path as FROM source
10
- const dottedName = (0, combi_1.seq)(_1.CDSName, ".", _1.CDSName);
11
- const namedSource = (0, combi_1.altPrio)(dottedName, _1.CDSName);
12
- 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)));
9
+ const singleSource = (0, combi_1.seq)(_1.CDSPrefixedName, (0, combi_1.optPrio)(_1.CDSParametersSelect), (0, combi_1.optPrio)(staticFilter), (0, combi_1.opt)((0, combi_1.altPrio)(_1.CDSAs, _1.CDSName)));
13
10
  const funcSingleSource = (0, combi_1.seq)(_1.CDSFunction, (0, combi_1.opt)((0, combi_1.altPrio)(_1.CDSAs, _1.CDSName)));
14
11
  const parenSource = (0, combi_1.seq)("(", (0, combi_1.altPrio)(CDSSource, singleSource), (0, combi_1.star)(_1.CDSJoin), ")");
15
12
  return (0, combi_1.altPrio)(parenSource, funcSingleSource, singleSource);
@@ -4,8 +4,8 @@ exports.CDSString = void 0;
4
4
  const combi_1 = require("../../abap/2_statements/combi");
5
5
  class CDSString extends combi_1.Expression {
6
6
  getRunnable() {
7
- const reg = (0, combi_1.regex)(/^'(?:[^'\\]|''|\\'|\\\\|\\(?!'))*'$/);
8
- 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);
7
+ const reg = (0, combi_1.regex)(/^(?:'(?:[^'\\]|''|\\'|\\\\|\\(?!'))*'|"(?:[^"\\]|""|\\"|\\\\|\\(?!"))*")$/);
8
+ const abapTypeName = (0, combi_1.regex)(/^(?:int[1-9]|int8|sstring|sstr|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);
9
9
  const abap = (0, combi_1.seq)("abap", ".", abapTypeName, (0, combi_1.optPrio)((0, combi_1.seq)("(", (0, combi_1.regex)(/^\d+$/), ")")), reg);
10
10
  return (0, combi_1.altPrio)(abap, reg);
11
11
  }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CDSTableField = void 0;
4
+ const _1 = require(".");
5
+ const combi_1 = require("../../abap/2_statements/combi");
6
+ // A single field or association/composition inside a `define table entity { ... }`
7
+ // inline body. Wraps annotations + name + type together so tooling can iterate
8
+ // per-field with associated field-level annotations (matches the CDSElement
9
+ // shape used for select-list elements).
10
+ class CDSTableField extends combi_1.Expression {
11
+ getRunnable() {
12
+ const nullability = (0, combi_1.optPrio)((0, combi_1.alt)("NOT NULL", "NULL"));
13
+ const field = (0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.str)("KEY")), _1.CDSName, ":", _1.CDSType, nullability);
14
+ const assocOrComp = (0, combi_1.seq)(_1.CDSName, ":", (0, combi_1.alt)(_1.CDSComposition, _1.CDSAssociation));
15
+ return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.alt)(field, assocOrComp), ";");
16
+ }
17
+ }
18
+ exports.CDSTableField = CDSTableField;
19
+ //# sourceMappingURL=cds_table_field.js.map
@@ -54,6 +54,7 @@ __exportStar(require("./cds_relation"), exports);
54
54
  __exportStar(require("./cds_select"), exports);
55
55
  __exportStar(require("./cds_source"), exports);
56
56
  __exportStar(require("./cds_string"), exports);
57
+ __exportStar(require("./cds_table_field"), exports);
57
58
  __exportStar(require("./cds_type"), exports);
58
59
  __exportStar(require("./cds_where"), exports);
59
60
  __exportStar(require("./cds_with_parameters"), exports);
@@ -9,6 +9,7 @@ const ddic_references_1 = require("./ddic_references");
9
9
  const rules_runner_1 = require("./rules_runner");
10
10
  const msag_references_1 = require("./msag_references");
11
11
  const macro_references_1 = require("./macro_references");
12
+ const cross_include_macros_1 = require("./abap/cross_include_macros");
12
13
  // todo, this should really be an instance in case there are multiple Registry'ies
13
14
  class ParsingPerformance {
14
15
  static clear() {
@@ -74,7 +75,7 @@ class Registry {
74
75
  }
75
76
  static abaplintVersion() {
76
77
  // magic, see build script "version.js"
77
- return "2.119.55";
78
+ return "2.119.57";
78
79
  }
79
80
  getDDICReferences() {
80
81
  return this.ddicReferences;
@@ -298,6 +299,7 @@ class Registry {
298
299
  for (const o of this.getObjects()) {
299
300
  this.parsePrivate(o);
300
301
  }
302
+ new cross_include_macros_1.CrossIncludeMacros(this).run();
301
303
  new find_global_definitions_1.FindGlobalDefinitions(this).run();
302
304
  return this;
303
305
  }
@@ -315,6 +317,7 @@ class Registry {
315
317
  if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {
316
318
  ParsingPerformance.output();
317
319
  }
320
+ new cross_include_macros_1.CrossIncludeMacros(this).run();
318
321
  new find_global_definitions_1.FindGlobalDefinitions(this).run(input === null || input === void 0 ? void 0 : input.progress);
319
322
  return this;
320
323
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.119.55",
3
+ "version": "2.119.57",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",