@abaplint/core 2.119.53 → 2.119.55

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 (55) hide show
  1. package/build/abaplint.d.ts +25 -4
  2. package/build/src/abap/2_statements/combi.js +1 -1
  3. package/build/src/abap/2_statements/expressions/_lob_handle_type.js +17 -0
  4. package/build/src/abap/2_statements/expressions/data_definition.js +2 -1
  5. package/build/src/abap/2_statements/expressions/form_param_type.js +2 -1
  6. package/build/src/abap/2_statements/expressions/index.js +1 -0
  7. package/build/src/abap/2_statements/expressions/method_def_changing.js +3 -1
  8. package/build/src/abap/2_statements/expressions/method_def_importing.js +3 -1
  9. package/build/src/abap/2_statements/expressions/type.js +3 -2
  10. package/build/src/abap/2_statements/expressions/type_simple_ref.js +13 -0
  11. package/build/src/abap/2_statements/expressions/type_structure.js +4 -4
  12. package/build/src/abap/2_statements/expressions/type_table.js +1 -1
  13. package/build/src/abap/2_statements/statements/fieldsymbol.js +3 -1
  14. package/build/src/abap/2_statements/statements/type.js +4 -1
  15. package/build/src/abap/5_syntax/statements/get_permissions.js +59 -0
  16. package/build/src/abap/5_syntax/syntax.js +2 -0
  17. package/build/src/cds/cds_parser.js +6 -0
  18. package/build/src/cds/expressions/cds_aggregate.js +3 -5
  19. package/build/src/cds/expressions/cds_define_abstract.js +1 -1
  20. package/build/src/cds/expressions/cds_define_external_entity.js +20 -0
  21. package/build/src/cds/expressions/cds_define_hierarchy.js +7 -1
  22. package/build/src/cds/expressions/cds_define_projection.js +3 -1
  23. package/build/src/cds/expressions/cds_define_table_entity.js +19 -0
  24. package/build/src/cds/expressions/cds_define_view.js +2 -1
  25. package/build/src/cds/expressions/cds_element.js +4 -7
  26. package/build/src/cds/expressions/cds_extend_view.js +8 -3
  27. package/build/src/cds/expressions/cds_function.js +5 -4
  28. package/build/src/cds/expressions/cds_prefixed_name.js +2 -15
  29. package/build/src/cds/expressions/cds_provider_contract.js +1 -1
  30. package/build/src/cds/expressions/cds_select.js +5 -2
  31. package/build/src/cds/expressions/cds_source.js +6 -5
  32. package/build/src/cds/expressions/cds_string.js +1 -8
  33. package/build/src/cds/expressions/index.js +2 -0
  34. package/build/src/config.js +8 -3
  35. package/build/src/ddl/ddl_parser.js +89 -24
  36. package/build/src/ddl/expressions/ddl_aspect.js +18 -0
  37. package/build/src/ddl/expressions/ddl_clauses.js +27 -0
  38. package/build/src/ddl/expressions/ddl_extend.js +15 -0
  39. package/build/src/ddl/expressions/ddl_extend_type.js +18 -0
  40. package/build/src/ddl/expressions/ddl_include.js +4 -1
  41. package/build/src/ddl/expressions/ddl_literal.js +18 -0
  42. package/build/src/ddl/expressions/ddl_name.js +2 -1
  43. package/build/src/ddl/expressions/ddl_named_include.js +15 -0
  44. package/build/src/ddl/expressions/ddl_qualified_name.js +12 -0
  45. package/build/src/ddl/expressions/ddl_structure.js +6 -3
  46. package/build/src/ddl/expressions/ddl_structure_field.js +2 -1
  47. package/build/src/ddl/expressions/ddl_table.js +5 -1
  48. package/build/src/ddl/expressions/ddl_table_field.js +4 -1
  49. package/build/src/ddl/expressions/ddl_type.js +7 -1
  50. package/build/src/ddl/expressions/ddl_where.js +15 -0
  51. package/build/src/ddl/expressions/index.js +8 -0
  52. package/build/src/index.js +3 -2
  53. package/build/src/objects/data_definition.js +7 -0
  54. package/build/src/registry.js +1 -1
  55. package/package.json +1 -1
@@ -927,6 +927,10 @@ declare class CDSDefineCustom extends Expression {
927
927
  getRunnable(): IStatementRunnable;
928
928
  }
929
929
 
930
+ declare class CDSDefineExternalEntity extends Expression {
931
+ getRunnable(): IStatementRunnable;
932
+ }
933
+
930
934
  declare class CDSDefineHierarchy extends Expression {
931
935
  getRunnable(): IStatementRunnable;
932
936
  }
@@ -935,6 +939,10 @@ declare class CDSDefineProjection extends Expression {
935
939
  getRunnable(): IStatementRunnable;
936
940
  }
937
941
 
942
+ declare class CDSDefineTableEntity extends Expression {
943
+ getRunnable(): IStatementRunnable;
944
+ }
945
+
938
946
  declare class CDSDefineTableFunction extends Expression {
939
947
  getRunnable(): IStatementRunnable;
940
948
  }
@@ -1862,14 +1870,20 @@ declare class DDIC {
1862
1870
  }): AbstractType;
1863
1871
  }
1864
1872
 
1865
- declare enum DDLKind {
1873
+ export declare enum DDLKind {
1866
1874
  Structure = "structure",
1867
- Table = "table"
1875
+ Table = "table",
1876
+ Aspect = "aspect",
1877
+ ExtendType = "extend-type"
1868
1878
  }
1869
1879
 
1870
1880
  export declare class DDLParser {
1871
1881
  parse(file: IFile): IDDLParserResult | undefined;
1872
1882
  private parsedToResult;
1883
+ private compactTokens;
1884
+ private hasKey;
1885
+ private hasNotNull;
1886
+ private kindOf;
1873
1887
  }
1874
1888
 
1875
1889
  declare class DecFloat16Type extends AbstractType {
@@ -2702,6 +2716,7 @@ declare namespace Expressions {
2702
2716
  TypeStructure,
2703
2717
  TypeTableKey,
2704
2718
  TypeTable,
2719
+ TypeSimpleRef,
2705
2720
  Type_2 as Type,
2706
2721
  ValueBase,
2707
2722
  ValueBodyLine,
@@ -2733,8 +2748,10 @@ declare namespace ExpressionsCDS {
2733
2748
  CDSCondition,
2734
2749
  CDSDefineAbstract,
2735
2750
  CDSDefineCustom,
2751
+ CDSDefineExternalEntity,
2736
2752
  CDSDefineHierarchy,
2737
2753
  CDSDefineProjection,
2754
+ CDSDefineTableEntity,
2738
2755
  CDSDefineTableFunction,
2739
2756
  CDSDefineView,
2740
2757
  CDSElement,
@@ -3470,13 +3487,13 @@ declare interface IDDICReferences {
3470
3487
  }[];
3471
3488
  }
3472
3489
 
3473
- declare interface IDDLParserResult {
3490
+ export declare interface IDDLParserResult {
3474
3491
  name: string;
3475
3492
  kind: DDLKind;
3476
3493
  fields: IDDLParserResultField[];
3477
3494
  }
3478
3495
 
3479
- declare interface IDDLParserResultField {
3496
+ export declare interface IDDLParserResultField {
3480
3497
  key: boolean;
3481
3498
  name: string;
3482
3499
  type: string;
@@ -8250,6 +8267,10 @@ declare class Types_2 implements IStructure {
8250
8267
  getMatcher(): IStructureRunnable;
8251
8268
  }
8252
8269
 
8270
+ declare class TypeSimpleRef extends Expression {
8271
+ getRunnable(): IStatementRunnable;
8272
+ }
8273
+
8253
8274
  declare class TypeStructure extends Expression {
8254
8275
  getRunnable(): IStatementRunnable;
8255
8276
  }
@@ -81,7 +81,7 @@ class Regex {
81
81
  return result;
82
82
  }
83
83
  railroad() {
84
- return "Railroad.Terminal(\"" + this.regexp.source.replace(/\\/g, "\\\\") + "\")";
84
+ return "Railroad.Terminal(\"" + this.regexp.source.replace(/\\/g, "\\\\").replace(/"/g, "\\\"") + "\")";
85
85
  }
86
86
  toStr() {
87
87
  return this.regexp.toString();
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.lobColumns = lobColumns;
4
+ exports.lobKind = lobKind;
5
+ exports.lobHandleType = lobHandleType;
6
+ const combi_1 = require("../combi");
7
+ const _1 = require(".");
8
+ function lobColumns() {
9
+ return (0, combi_1.altPrio)((0, combi_1.seq)("FOR", (0, combi_1.opt)("OTHER"), (0, combi_1.altPrio)("BLOB", "CLOB"), "COLUMNS"), (0, combi_1.seq)("FOR", "ALL", (0, combi_1.opt)("OTHER"), (0, combi_1.altPrio)("BLOB", "CLOB"), "COLUMNS"), (0, combi_1.seq)("FOR", "ALL", "COLUMNS"), (0, combi_1.seq)("FOR", "COLUMNS", (0, combi_1.plus)(_1.FieldChain)));
10
+ }
11
+ function lobKind() {
12
+ return (0, combi_1.altPrio)("LOCATOR", "READER", "WRITER", (0, combi_1.seq)("LOB", "HANDLE"));
13
+ }
14
+ function lobHandleType() {
15
+ return (0, combi_1.seq)("TYPE", _1.TypeName, (0, combi_1.opt)("READ-ONLY"), (0, combi_1.plus)((0, combi_1.seq)(lobKind(), lobColumns())));
16
+ }
17
+ //# sourceMappingURL=_lob_handle_type.js.map
@@ -37,12 +37,13 @@ exports.DataDefinition = void 0;
37
37
  const combi_1 = require("../combi");
38
38
  const Expressions = __importStar(require("."));
39
39
  const version_1 = require("../../../version");
40
+ const _lob_handle_type_1 = require("./_lob_handle_type");
40
41
  class DataDefinition extends combi_1.Expression {
41
42
  getRunnable() {
42
43
  const simple = (0, combi_1.opt)((0, combi_1.per)("READ-ONLY", Expressions.Type, Expressions.Length, Expressions.Decimals, Expressions.Value));
43
44
  const table = (0, combi_1.seq)(Expressions.TypeTable, (0, combi_1.optPrio)("READ-ONLY"));
44
45
  const boxed = (0, combi_1.ver)(version_1.Release.v702, "BOXED");
45
- return (0, combi_1.seq)(Expressions.DefinitionName, (0, combi_1.optPrio)(Expressions.ConstantFieldLength), (0, combi_1.alt)(simple, table, Expressions.TypeStructure), (0, combi_1.optPrio)(boxed));
46
+ return (0, combi_1.seq)(Expressions.DefinitionName, (0, combi_1.optPrio)(Expressions.ConstantFieldLength), (0, combi_1.altPrio)((0, combi_1.ver)(version_1.Release.v731, (0, _lob_handle_type_1.lobHandleType)()), (0, combi_1.alt)(simple, table, Expressions.TypeStructure)), (0, combi_1.optPrio)(boxed));
46
47
  }
47
48
  }
48
49
  exports.DataDefinition = DataDefinition;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FormParamType = void 0;
4
4
  const combi_1 = require("../combi");
5
5
  const _1 = require(".");
6
+ const version_1 = require("../../../version");
6
7
  class FormParamType extends combi_1.Expression {
7
8
  getRunnable() {
8
9
  const def = (0, combi_1.seq)("DEFAULT", (0, combi_1.alt)(_1.Constant, _1.FieldChain));
@@ -10,7 +11,7 @@ class FormParamType extends combi_1.Expression {
10
11
  const tabseq = (0, combi_1.seq)(table, (0, combi_1.optPrio)((0, combi_1.seq)("OF", _1.TypeName)));
11
12
  const ret = (0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.alt)("REF TO", "LINE OF")), _1.TypeName, (0, combi_1.opt)(def));
12
13
  const like = (0, combi_1.seq)("LIKE", (0, combi_1.optPrio)((0, combi_1.alt)("REF TO", "LINE OF")), _1.FieldChain);
13
- return (0, combi_1.alt)((0, combi_1.seq)("TYPE", (0, combi_1.altPrio)(tabseq, ret)), like);
14
+ return (0, combi_1.alt)((0, combi_1.seq)("TYPE", (0, combi_1.altPrio)(tabseq, (0, combi_1.ver)(version_1.Release.v916, (0, combi_1.seq)("ANY", "STRUCTURE")), ret)), like);
14
15
  }
15
16
  }
16
17
  exports.FormParamType = FormParamType;
@@ -279,6 +279,7 @@ __exportStar(require("./type_param"), exports);
279
279
  __exportStar(require("./type_structure"), exports);
280
280
  __exportStar(require("./type_table_key"), exports);
281
281
  __exportStar(require("./type_table"), exports);
282
+ __exportStar(require("./type_simple_ref"), exports);
282
283
  __exportStar(require("./type"), exports);
283
284
  __exportStar(require("./value_base"), exports);
284
285
  __exportStar(require("./value_body_line"), exports);
@@ -3,9 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MethodDefChanging = void 0;
4
4
  const combi_1 = require("../combi");
5
5
  const _1 = require(".");
6
+ const version_1 = require("../../../version");
6
7
  class MethodDefChanging extends combi_1.Expression {
7
8
  getRunnable() {
8
- return (0, combi_1.seq)("CHANGING", (0, combi_1.plus)(_1.MethodParamOptional));
9
+ const anyStructureParam = (0, combi_1.ver)(version_1.Release.v916, (0, combi_1.seq)(_1.MethodParamName, "TYPE", "ANY", "STRUCTURE", (0, combi_1.optPrio)("OPTIONAL")));
10
+ return (0, combi_1.seq)("CHANGING", (0, combi_1.plus)((0, combi_1.altPrio)(anyStructureParam, _1.MethodParamOptional)));
9
11
  }
10
12
  }
11
13
  exports.MethodDefChanging = MethodDefChanging;
@@ -3,10 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MethodDefImporting = void 0;
4
4
  const combi_1 = require("../combi");
5
5
  const _1 = require(".");
6
+ const version_1 = require("../../../version");
6
7
  class MethodDefImporting extends combi_1.Expression {
7
8
  getRunnable() {
8
9
  const field = (0, combi_1.regex)(/^!?(\/\w+\/)?\w+$/);
9
- return (0, combi_1.seq)("IMPORTING", (0, combi_1.plus)(_1.MethodParamOptional), (0, combi_1.optPrio)((0, combi_1.seq)("PREFERRED PARAMETER", field)));
10
+ const anyStructureParam = (0, combi_1.ver)(version_1.Release.v916, (0, combi_1.seq)(_1.MethodParamName, "TYPE", "ANY", "STRUCTURE", (0, combi_1.optPrio)("OPTIONAL")));
11
+ return (0, combi_1.seq)("IMPORTING", (0, combi_1.plus)((0, combi_1.altPrio)(anyStructureParam, _1.MethodParamOptional)), (0, combi_1.optPrio)((0, combi_1.seq)("PREFERRED PARAMETER", field)));
10
12
  }
11
13
  }
12
14
  exports.MethodDefImporting = MethodDefImporting;
@@ -6,11 +6,12 @@ const _1 = require(".");
6
6
  const version_1 = require("../../../version");
7
7
  class Type extends combi_1.Expression {
8
8
  getRunnable() {
9
- const indicators = (0, combi_1.seq)("WITH INDICATORS", _1.ComponentName, (0, combi_1.optPrio)((0, combi_1.seq)("TYPE", _1.TypeName)));
9
+ const indicatorSpec = (0, combi_1.altPrio)((0, combi_1.ver)(version_1.Release.v784, "AS BITFIELD"), (0, combi_1.seq)("TYPE", _1.TypeName));
10
+ const indicators = (0, combi_1.seq)("WITH INDICATORS", _1.ComponentName, (0, combi_1.optPrio)(indicatorSpec));
10
11
  const typeType = (0, combi_1.seq)(_1.TypeName, (0, combi_1.optPrio)(_1.Default));
11
12
  const like = (0, combi_1.altPrio)((0, combi_1.seq)("LINE OF", _1.FieldChain), (0, combi_1.seq)("REF TO", _1.FieldChain), _1.FieldChain);
12
13
  const type = (0, combi_1.altPrio)((0, combi_1.seq)("LINE OF", typeType), (0, combi_1.seq)("REF TO", typeType), (0, combi_1.seq)(typeType, (0, combi_1.optPrio)(_1.LOBHandle)));
13
- const ret = (0, combi_1.seq)((0, combi_1.altPrio)((0, combi_1.seq)("LIKE", like), (0, combi_1.seq)("TYPE", type)), (0, combi_1.optPrio)((0, combi_1.ver)(version_1.Release.v755, indicators)));
14
+ const ret = (0, combi_1.seq)((0, combi_1.altPrio)((0, combi_1.seq)("LIKE", like), (0, combi_1.seq)("TYPE", type)), (0, combi_1.optPrio)((0, combi_1.ver)(version_1.Release.v781, indicators)));
14
15
  return ret;
15
16
  }
16
17
  }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TypeSimpleRef = void 0;
4
+ const combi_1 = require("../combi");
5
+ const _1 = require(".");
6
+ class TypeSimpleRef extends combi_1.Expression {
7
+ getRunnable() {
8
+ const tableKind = (0, combi_1.seq)((0, combi_1.alt)("ANY", "STANDARD", "HASHED", "SORTED", "INDEX"), "TABLE");
9
+ return (0, combi_1.altPrio)((0, combi_1.seq)("LINE", "OF", _1.TypeName), (0, combi_1.seq)("REF", "TO", _1.TypeName), tableKind, (0, combi_1.seq)("ANY", "STRUCTURE"), _1.TypeName);
10
+ }
11
+ }
12
+ exports.TypeSimpleRef = TypeSimpleRef;
13
+ //# sourceMappingURL=type_simple_ref.js.map
@@ -8,10 +8,10 @@ const _derived_types_1 = require("./_derived_types");
8
8
  class TypeStructure extends combi_1.Expression {
9
9
  getRunnable() {
10
10
  const entity = (0, combi_1.alt)(_1.TypeName, _1.EntityAssociation);
11
- 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));
12
- const structure = (0, combi_1.ver)(version_1.Release.v774, (0, combi_1.seq)("STRUCTURE FOR", derivedTypes));
13
- 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))));
14
- const request = (0, combi_1.ver)(version_1.Release.v778, (0, combi_1.seq)("REQUEST FOR", (0, combi_1.alt)("CHANGE", "DELETE"), _1.NamespaceSimpleName));
11
+ 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));
12
+ const structure = (0, combi_1.ver)(version_1.Release.v774, (0, combi_1.seq)("STRUCTURE FOR", derivedTypes), { also: combi_1.AlsoIn.OpenABAP });
13
+ 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 });
14
+ 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 });
15
15
  return (0, combi_1.seq)("TYPE", (0, combi_1.altPrio)(structure, response, request), (0, combi_1.optPrio)("VALUE IS INITIAL"));
16
16
  }
17
17
  }
@@ -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.seq)("READ LINK", entity), (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)), (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)));
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));
@@ -3,10 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FieldSymbol = void 0;
4
4
  const combi_1 = require("../combi");
5
5
  const expressions_1 = require("../expressions");
6
+ const version_1 = require("../../../version");
6
7
  class FieldSymbol {
7
8
  getMatcher() {
8
9
  const stru = (0, combi_1.seq)("STRUCTURE", expressions_1.TypeName, "DEFAULT", expressions_1.Field);
9
- return (0, combi_1.seq)("FIELD-SYMBOLS", expressions_1.FieldSymbol, (0, combi_1.opt)((0, combi_1.alt)(expressions_1.Type, expressions_1.TypeTable, stru)));
10
+ const anyStructure = (0, combi_1.ver)(version_1.Release.v916, (0, combi_1.seq)("TYPE", "ANY", "STRUCTURE"));
11
+ return (0, combi_1.seq)("FIELD-SYMBOLS", expressions_1.FieldSymbol, (0, combi_1.opt)((0, combi_1.alt)(anyStructure, expressions_1.Type, expressions_1.TypeTable, stru)));
10
12
  }
11
13
  }
12
14
  exports.FieldSymbol = FieldSymbol;
@@ -37,10 +37,13 @@ exports.Type = void 0;
37
37
  const combi_1 = require("../combi");
38
38
  const Expressions = __importStar(require("../expressions"));
39
39
  const version_1 = require("../../../version");
40
+ const _lob_handle_type_1 = require("../expressions/_lob_handle_type");
40
41
  class Type {
41
42
  getMatcher() {
42
43
  const simple = (0, combi_1.per)(Expressions.Type, Expressions.Decimals, Expressions.Length);
43
- const def = (0, combi_1.seq)(Expressions.NamespaceSimpleName, (0, combi_1.opt)(Expressions.ConstantFieldLength), (0, combi_1.opt)((0, combi_1.alt)(simple, Expressions.TypeTable, Expressions.TypeStructure)));
44
+ const clientSpecified = (0, combi_1.ver)(version_1.Release.v760, (0, combi_1.seq)("TYPE", Expressions.TypeName, "CLIENT", "SPECIFIED", Expressions.FieldChain, (0, combi_1.opt)((0, combi_1.plus)((0, combi_1.seq)((0, _lob_handle_type_1.lobKind)(), (0, _lob_handle_type_1.lobColumns)())))));
45
+ const anyStructure = (0, combi_1.ver)(version_1.Release.v916, (0, combi_1.seq)("TYPE", "ANY", "STRUCTURE", (0, combi_1.opt)((0, combi_1.seq)("CONTAINING", (0, combi_1.plus)((0, combi_1.seq)(Expressions.DefinitionName, "TYPE", Expressions.TypeSimpleRef))))));
46
+ const def = (0, combi_1.seq)(Expressions.NamespaceSimpleName, (0, combi_1.opt)(Expressions.ConstantFieldLength), (0, combi_1.opt)((0, combi_1.altPrio)((0, combi_1.ver)(version_1.Release.v731, (0, _lob_handle_type_1.lobHandleType)()), clientSpecified, anyStructure, (0, combi_1.alt)(simple, Expressions.TypeTable, Expressions.TypeStructure))));
44
47
  // todo, BOXED is only allowed with structures inside structures?
45
48
  const boxed = (0, combi_1.ver)(version_1.Release.v702, "BOXED");
46
49
  const ret = (0, combi_1.seq)("TYPES", def, (0, combi_1.opt)(boxed));
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.GetPermissions = void 0;
37
+ const Expressions = __importStar(require("../../2_statements/expressions"));
38
+ const source_1 = require("../expressions/source");
39
+ const target_1 = require("../expressions/target");
40
+ const inline_data_1 = require("../expressions/inline_data");
41
+ const basic_1 = require("../../types/basic");
42
+ class GetPermissions {
43
+ runSyntax(node, input) {
44
+ for (const s of node.findDirectExpressions(Expressions.Source)) {
45
+ source_1.Source.runSyntax(s, input);
46
+ }
47
+ for (const t of node.findDirectExpressions(Expressions.Target)) {
48
+ const inline = t === null || t === void 0 ? void 0 : t.findDirectExpression(Expressions.InlineData);
49
+ if (inline) {
50
+ inline_data_1.InlineData.runSyntax(inline, input, basic_1.VoidType.get("GetPermissions"));
51
+ }
52
+ else {
53
+ target_1.Target.runSyntax(t, input);
54
+ }
55
+ }
56
+ }
57
+ }
58
+ exports.GetPermissions = GetPermissions;
59
+ //# sourceMappingURL=get_permissions.js.map
@@ -183,6 +183,7 @@ const insert_field_group_1 = require("./statements/insert_field_group");
183
183
  const read_entities_1 = require("./statements/read_entities");
184
184
  const modify_entities_1 = require("./statements/modify_entities");
185
185
  const commit_entities_1 = require("./statements/commit_entities");
186
+ const get_permissions_1 = require("./statements/get_permissions");
186
187
  const read_dataset_1 = require("./statements/read_dataset");
187
188
  const _syntax_input_1 = require("./_syntax_input");
188
189
  const assert_error_1 = require("./assert_error");
@@ -312,6 +313,7 @@ if (Object.keys(map).length === 0) {
312
313
  addToMap(new parameter_1.Parameter());
313
314
  addToMap(new fieldsymbol_1.FieldSymbol());
314
315
  addToMap(new read_entities_1.ReadEntities());
316
+ addToMap(new get_permissions_1.GetPermissions());
315
317
  addToMap(new read_dataset_1.ReadDataset());
316
318
  addToMap(new modify_entities_1.ModifyEntities());
317
319
  addToMap(new commit_entities_1.CommitEntities());
@@ -70,6 +70,12 @@ class CDSParser {
70
70
  if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {
71
71
  res = combi_1.Combi.run(new Expressions.CDSDefineHierarchy(), tokens, version_1.defaultRelease);
72
72
  }
73
+ if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {
74
+ res = combi_1.Combi.run(new Expressions.CDSDefineExternalEntity(), tokens, version_1.defaultRelease);
75
+ }
76
+ if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {
77
+ res = combi_1.Combi.run(new Expressions.CDSDefineTableEntity(), tokens, version_1.defaultRelease);
78
+ }
73
79
  if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {
74
80
  return undefined;
75
81
  }
@@ -5,12 +5,10 @@ const _1 = require(".");
5
5
  const combi_1 = require("../../abap/2_statements/combi");
6
6
  class CDSAggregate extends combi_1.Expression {
7
7
  getRunnable() {
8
- // CDSPrefixedName handles dotted paths with path filters e.g. a._Assoc[filter].Field
9
- // CDSArithmetics handles expressions like sum(A + B), max(A * 100)
10
- // fieldAsType handles avg(field AS type) / sum(field AS type) — SAP inline type coercion
11
8
  const fieldAsType = (0, combi_1.seq)(_1.CDSPrefixedName, "AS", _1.CDSType);
12
- const value = (0, combi_1.altPrio)(_1.CDSArithmetics, _1.CDSCast, _1.CDSCase, _1.CDSFunction, fieldAsType, _1.CDSPrefixedName, _1.CDSString, "*");
13
- 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, ")");
9
+ const funcAsType = (0, combi_1.seq)(_1.CDSFunction, "AS", _1.CDSType);
10
+ const value = (0, combi_1.altPrio)(_1.CDSArithmetics, _1.CDSCast, _1.CDSCase, funcAsType, _1.CDSFunction, fieldAsType, _1.CDSPrefixedName, _1.CDSString, "*");
11
+ 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)), ")");
14
12
  }
15
13
  }
16
14
  exports.CDSAggregate = CDSAggregate;
@@ -8,7 +8,7 @@ class CDSDefineAbstract extends combi_1.Expression {
8
8
  getRunnable() {
9
9
  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, ";");
10
10
  const compsiOrAssoci = (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), cds_name_1.CDSName, ":", (0, combi_1.alt)(_1.CDSComposition, _1.CDSAssociation), ";");
11
- 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)(";"));
11
+ 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)(";"));
12
12
  }
13
13
  }
14
14
  exports.CDSDefineAbstract = CDSDefineAbstract;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CDSDefineExternalEntity = void 0;
4
+ const _1 = require(".");
5
+ const combi_1 = require("../../abap/2_statements/combi");
6
+ class CDSDefineExternalEntity extends combi_1.Expression {
7
+ getRunnable() {
8
+ const extNameValue = (0, combi_1.alt)(_1.CDSName, (0, combi_1.regex)(/^"[^"]*"$/));
9
+ const externalName = (0, combi_1.seq)("EXTERNAL", "NAME", extNameValue);
10
+ const nullability = (0, combi_1.optPrio)((0, combi_1.alt)("NOT NULL", "NULL"));
11
+ 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), ";");
12
+ const assocOrComp = (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), _1.CDSName, ":", (0, combi_1.alt)(_1.CDSComposition, _1.CDSAssociation), ";");
13
+ const body = (0, combi_1.plus)((0, combi_1.alt)(field, assocOrComp));
14
+ 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));
15
+ const staticEntity = (0, combi_1.seq)("STATIC", "ENTITY", _1.CDSName, (0, combi_1.opt)(externalName));
16
+ 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)(";"));
17
+ }
18
+ }
19
+ exports.CDSDefineExternalEntity = CDSDefineExternalEntity;
20
+ //# sourceMappingURL=cds_define_external_entity.js.map
@@ -10,7 +10,13 @@ class CDSDefineHierarchy extends combi_1.Expression {
10
10
  const siblingsOrderField = (0, combi_1.seq)(_1.CDSPrefixedName, (0, combi_1.optPrio)(sortDirection));
11
11
  const siblingsOrder = (0, combi_1.seq)("SIBLINGS", "ORDER", "BY", siblingsOrderField, (0, combi_1.star)((0, combi_1.seq)(",", siblingsOrderField)));
12
12
  const directory = (0, combi_1.seq)("DIRECTORY", _1.CDSName, "FILTER", "BY", _1.CDSCondition);
13
- 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"))));
13
+ // DATE PERIOD: period from <field> to <field> [valid from :p to :p]
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)
18
+ 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"))));
14
20
  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)(";"));
15
21
  }
16
22
  }
@@ -6,7 +6,9 @@ const __1 = require("../..");
6
6
  const combi_1 = require("../../abap/2_statements/combi");
7
7
  class CDSDefineProjection extends combi_1.Expression {
8
8
  getRunnable() {
9
- 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)(";"));
9
+ // redefine association _Assoc redirected to [composition child | parent] Entity
10
+ 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);
11
+ 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)(";"));
10
12
  }
11
13
  }
12
14
  exports.CDSDefineProjection = CDSDefineProjection;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CDSDefineTableEntity = void 0;
4
+ const _1 = require(".");
5
+ const combi_1 = require("../../abap/2_statements/combi");
6
+ class CDSDefineTableEntity extends combi_1.Expression {
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));
12
+ const elementList = (0, combi_1.seq)(_1.CDSElement, (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.opt)(","));
13
+ const elements = (0, combi_1.seq)((0, combi_1.str)("{"), (0, combi_1.altPrio)("*", elementList), (0, combi_1.str)("}"));
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));
15
+ 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)(";"));
16
+ }
17
+ }
18
+ exports.CDSDefineTableEntity = CDSDefineTableEntity;
19
+ //# sourceMappingURL=cds_define_table_entity.js.map
@@ -10,7 +10,8 @@ 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"), "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)(";"));
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)(";"));
14
15
  }
15
16
  }
16
17
  exports.CDSDefineView = CDSDefineView;
@@ -9,14 +9,11 @@ class CDSElement extends combi_1.Expression {
9
9
  getRunnable() {
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
- // $extension.* — extension field wildcard
13
12
  const extensionWildcard = (0, combi_1.seq)("$extension", ".", "*");
14
- 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);
15
- // KEY/VIRTUAL keyword handling via altPrio:
16
- // - Try keyword form first: if keyword consumed but body fails (e.g. "virtual.Field"),
17
- // altPrio backtracks to plain body (which handles "virtual" as a datasource alias prefix).
18
- // - This gives exactly 1 state in all cases (no exponential blowup from opt()).
19
- const elementBody = (0, combi_1.altPrio)((0, combi_1.seq)((0, combi_1.altPrio)("KEY", "VIRTUAL"), body), body);
13
+ const includeElement = (0, combi_1.seq)("INCLUDE", _1.CDSPrefixedName);
14
+ 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);
16
+ const elementBody = (0, combi_1.altPrio)(typedVirtual, (0, combi_1.seq)((0, combi_1.altPrio)("KEY", "VIRTUAL"), body), body);
20
17
  return (0, combi_1.seq)((0, combi_1.starPrio)(_1.CDSAnnotation), elementBody, (0, combi_1.optPrio)(cds_as_1.CDSAs));
21
18
  }
22
19
  }
@@ -3,12 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CDSExtendView = void 0;
4
4
  const _1 = require(".");
5
5
  const combi_1 = require("../../abap/2_statements/combi");
6
- const cds_name_1 = require("./cds_name");
7
6
  class CDSExtendView extends combi_1.Expression {
8
7
  getRunnable() {
9
- 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));
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));
10
9
  const valueNested = (0, combi_1.seq)("{", namedot, (0, combi_1.star)((0, combi_1.seq)(",", namedot)), "}");
11
- 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)(";"));
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)(";"));
12
+ 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
+ const assocOrComp = (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), _1.CDSName, ":", (0, combi_1.alt)(_1.CDSComposition, _1.CDSAssociation), ";");
14
+ const entityBody = (0, combi_1.seq)("{", (0, combi_1.plus)((0, combi_1.alt)(field, assocOrComp)), "}");
15
+ 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)(";"));
16
+ return (0, combi_1.alt)(extendAbstractOrCustom, extendView);
12
17
  }
13
18
  }
14
19
  exports.CDSExtendView = CDSExtendView;
@@ -58,12 +58,13 @@ class CDSFunction extends combi_1.Expression {
58
58
  const occurrencesRegexpr = (0, combi_1.seq)("OCCURRENCES_REGEXPR", "(", conversionInputs, ")");
59
59
  const substrRegexpr = (0, combi_1.seq)("SUBSTR_REGEXPR", "(", conversionInputs, ")");
60
60
  const locateRegexpr = (0, combi_1.seq)("LOCATE_REGEXPR", "(", conversionInputs, ")");
61
- // Generic fallback: user-defined/extension functions like GET_NUMERIC_VALUE(arg).
62
- // Use a regex that excludes CDS keywords that would otherwise be matched by CDSName.
63
- // Must contain at least one underscore to distinguish from keywords (e.g. GET_NUMERIC_VALUE).
64
61
  const extFuncName = (0, combi_1.regex)(/^[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)+$/i);
65
62
  const genericArgs = (0, combi_1.seq)(_1.CDSFunctionInput, (0, combi_1.starPrio)((0, combi_1.seq)(",", _1.CDSFunctionInput)));
66
- const genericFunc = (0, combi_1.seq)(extFuncName, "(", genericArgs, ")");
63
+ const namedArgValue = (0, combi_1.altPrio)((0, combi_1.seq)("INTERVAL", _1.CDSFunctionInput, _1.CDSName), _1.CDSFunctionInput, _1.CDSName);
64
+ const namedArgArrow = (0, combi_1.seq)(_1.CDSName, "=", ">", namedArgValue);
65
+ const namedArgColon = (0, combi_1.seq)(_1.CDSName, ":", namedArgValue);
66
+ 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))));
67
+ const genericFunc = (0, combi_1.seq)(extFuncName, "(", (0, combi_1.optPrio)((0, combi_1.altPrio)(namedArgs, genericArgs)), ")");
67
68
  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);
68
69
  }
69
70
  }
@@ -10,31 +10,18 @@ const cds_integer_1 = require("./cds_integer");
10
10
  const cds_string_1 = require("./cds_string");
11
11
  class CDSPrefixedName extends combi_1.Expression {
12
12
  getRunnable() {
13
- // Path filter variants:
14
- // [inner], [left outer], [cross] — join-type redirect
15
- // [1:left outer], [1:inner] — cardinality + join-type
16
- // [1: condition] — cardinality + filter condition
17
- // [condition] — filter condition only
18
13
  const joinType = (0, combi_1.altPrio)("LEFT OUTER", "INNER", "CROSS");
19
14
  const joinRedirect = (0, combi_1.seq)("[", joinType, "]");
20
- // Cardinality spec: integer or * (e.g. [*:inner], [1:inner])
21
15
  const cardSpec = (0, combi_1.altPrio)(cds_integer_1.CDSInteger, "*");
22
16
  const cardinalityJoin = (0, combi_1.seq)("[", cardSpec, ":", joinType, "]");
23
- // [1: left outer where condition] — cardinality + join-type + WHERE filter
24
17
  const cardinalityJoinWhere = (0, combi_1.seq)("[", cardSpec, ":", joinType, "WHERE", cds_condition_1.CDSCondition, "]");
25
- // [left outer where condition] — join-type + WHERE filter (no cardinality prefix)
26
18
  const joinWhere = (0, combi_1.seq)("[", joinType, "WHERE", cds_condition_1.CDSCondition, "]");
27
- // Text cardinality forms: [to one: cond], [to many: cond]
28
- const textCard = (0, combi_1.altPrio)("TO ONE", "TO MANY");
29
- const textCardFilter = (0, combi_1.seq)("[", textCard, ":", cds_condition_1.CDSCondition, "]");
30
- // Numeric range cardinality: [0..1: cond], [1..1: cond], [0..*: cond], [n..m: cond]
19
+ const textCard = (0, combi_1.altPrio)("TO EXACT ONE", "TO ONE", "TO MANY");
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))), "]");
31
21
  const cardNum = (0, combi_1.altPrio)(cds_integer_1.CDSInteger, "*");
32
22
  const rangeCard = (0, combi_1.seq)(cds_integer_1.CDSInteger, ".", ".", cardNum);
33
23
  const rangeCardFilter = (0, combi_1.seq)("[", rangeCard, ":", cds_condition_1.CDSCondition, "]");
34
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, "]"));
35
- // Each dotted segment may have its own path filter: A[cond].B[cond].C
36
- // The final segment may also be a string literal: #enum.'value'
37
- // A segment may have a parameterized call: _Assoc( P_Key : value ) or _Assoc[filter]
38
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));
39
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));
40
27
  }