@abaplint/core 2.83.0 → 2.83.4

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 (110) hide show
  1. package/README.md +6 -6
  2. package/build/abaplint.d.ts +12 -36
  3. package/build/src/abap/2_statements/expressions/index.js +0 -7
  4. package/build/src/abap/2_statements/statement_parser.js +1 -1
  5. package/build/src/abap/artifacts.js +3 -3
  6. package/build/src/abap/flow/flow_graph.js +7 -7
  7. package/build/src/cds/artifacts.js +18 -0
  8. package/build/src/cds/cds_lexer.js +113 -0
  9. package/build/src/cds/cds_parser.js +28 -0
  10. package/build/src/cds/expressions/cds_annotation.js +17 -0
  11. package/build/src/cds/expressions/cds_as.js +12 -0
  12. package/build/src/cds/expressions/cds_association.js +17 -0
  13. package/build/src/cds/expressions/cds_cast.js +13 -0
  14. package/build/src/cds/expressions/cds_define_abstract.js +14 -0
  15. package/build/src/cds/expressions/cds_define_view.js +14 -0
  16. package/build/src/cds/expressions/cds_element.js +14 -0
  17. package/build/src/cds/expressions/cds_function.js +17 -0
  18. package/build/src/cds/expressions/cds_join.js +13 -0
  19. package/build/src/cds/expressions/cds_name.js +11 -0
  20. package/build/src/cds/expressions/cds_select.js +15 -0
  21. package/build/src/cds/expressions/cds_source.js +12 -0
  22. package/build/src/cds/expressions/cds_string.js +11 -0
  23. package/build/src/cds/expressions/cds_where.js +14 -0
  24. package/build/src/cds/expressions/index.js +27 -0
  25. package/build/src/config.js +1 -0
  26. package/build/src/ddl/artifacts.js +18 -0
  27. package/build/src/ddl/ddl_parser.js +1 -1
  28. package/build/src/{abap/2_statements/expressions/ddl → ddl/expressions}/ddl_include.js +1 -1
  29. package/build/src/{abap/2_statements/expressions/ddl → ddl/expressions}/ddl_name.js +1 -1
  30. package/build/src/{abap/2_statements/expressions/ddl → ddl/expressions}/ddl_structure.js +1 -1
  31. package/build/src/{abap/2_statements/expressions/ddl → ddl/expressions}/ddl_structure_field.js +1 -1
  32. package/build/src/{abap/2_statements/expressions/ddl → ddl/expressions}/ddl_table.js +1 -1
  33. package/build/src/{abap/2_statements/expressions/ddl → ddl/expressions}/ddl_table_field.js +1 -1
  34. package/build/src/{abap/2_statements/expressions/ddl → ddl/expressions}/ddl_type.js +1 -1
  35. package/build/src/ddl/expressions/index.js +20 -0
  36. package/build/src/index.js +2 -2
  37. package/build/src/lsp/help.js +7 -7
  38. package/build/src/objects/data_definition.js +65 -3
  39. package/build/src/registry.js +1 -1
  40. package/build/src/rules/abapdoc.js +1 -1
  41. package/build/src/rules/align_parameters.js +33 -33
  42. package/build/src/rules/ambiguous_statement.js +5 -5
  43. package/build/src/rules/avoid_use.js +6 -6
  44. package/build/src/rules/begin_end_names.js +4 -4
  45. package/build/src/rules/begin_single_include.js +12 -12
  46. package/build/src/rules/call_transaction_authority_check.js +3 -3
  47. package/build/src/rules/cds_parser_error.js +46 -0
  48. package/build/src/rules/chain_mainly_declarations.js +4 -4
  49. package/build/src/rules/check_abstract.js +2 -2
  50. package/build/src/rules/check_comments.js +3 -3
  51. package/build/src/rules/check_include.js +3 -3
  52. package/build/src/rules/check_no_handler_pragma.js +8 -8
  53. package/build/src/rules/check_subrc.js +8 -8
  54. package/build/src/rules/commented_code.js +1 -1
  55. package/build/src/rules/constructor_visibility_public.js +4 -4
  56. package/build/src/rules/contains_tab.js +2 -2
  57. package/build/src/rules/dangerous_statement.js +1 -1
  58. package/build/src/rules/downport.js +35 -35
  59. package/build/src/rules/exit_or_check.js +3 -3
  60. package/build/src/rules/exporting.js +1 -1
  61. package/build/src/rules/forbidden_identifier.js +1 -1
  62. package/build/src/rules/forbidden_void_type.js +2 -2
  63. package/build/src/rules/functional_writing.js +17 -17
  64. package/build/src/rules/global_class.js +10 -10
  65. package/build/src/rules/identical_conditions.js +2 -2
  66. package/build/src/rules/identical_contents.js +15 -15
  67. package/build/src/rules/identical_descriptions.js +4 -4
  68. package/build/src/rules/if_in_if.js +7 -7
  69. package/build/src/rules/implement_methods.js +3 -3
  70. package/build/src/rules/in_statement_indentation.js +11 -11
  71. package/build/src/rules/index.js +1 -0
  72. package/build/src/rules/intf_referencing_clas.js +3 -3
  73. package/build/src/rules/line_break_style.js +2 -2
  74. package/build/src/rules/line_length.js +1 -1
  75. package/build/src/rules/line_only_punc.js +1 -1
  76. package/build/src/rules/local_variable_names.js +2 -2
  77. package/build/src/rules/many_parentheses.js +10 -10
  78. package/build/src/rules/max_one_method_parameter_per_line.js +7 -7
  79. package/build/src/rules/max_one_statement.js +3 -3
  80. package/build/src/rules/nesting.js +1 -1
  81. package/build/src/rules/no_chained_assignment.js +1 -1
  82. package/build/src/rules/no_public_attributes.js +1 -1
  83. package/build/src/rules/no_yoda_conditions.js +4 -4
  84. package/build/src/rules/obsolete_statement.js +40 -38
  85. package/build/src/rules/omit_parameter_name.js +3 -3
  86. package/build/src/rules/omit_receiving.js +13 -13
  87. package/build/src/rules/parser_702_chaining.js +2 -2
  88. package/build/src/rules/parser_error.js +2 -2
  89. package/build/src/rules/parser_missing_space.js +1 -1
  90. package/build/src/rules/prefer_inline.js +16 -16
  91. package/build/src/rules/prefer_is_not.js +7 -7
  92. package/build/src/rules/prefer_raise_exception_new.js +3 -3
  93. package/build/src/rules/prefer_returning_to_exporting.js +1 -1
  94. package/build/src/rules/prefer_xsdbool.js +2 -2
  95. package/build/src/rules/remove_descriptions.js +4 -4
  96. package/build/src/rules/rfc_error_handling.js +9 -9
  97. package/build/src/rules/select_add_order_by.js +30 -15
  98. package/build/src/rules/select_performance.js +2 -2
  99. package/build/src/rules/sicf_consistency.js +4 -4
  100. package/build/src/rules/space_before_dot.js +2 -2
  101. package/build/src/rules/start_at_tab.js +1 -1
  102. package/build/src/rules/sy_modification.js +2 -2
  103. package/build/src/rules/tabl_enhancement_category.js +2 -2
  104. package/build/src/rules/unused_methods.js +9 -9
  105. package/build/src/rules/unused_variables.js +6 -6
  106. package/build/src/rules/use_bool_expression.js +8 -8
  107. package/build/src/rules/use_line_exists.js +6 -6
  108. package/build/src/rules/use_new.js +2 -2
  109. package/build/src/rules/when_others_last.js +6 -6
  110. package/package.json +66 -66
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
- # @abaplint/core
2
-
3
- [abaplint](https://abaplint.org/) core library
4
-
5
- Exposes functionallity like the parser and rules, which can be used in other projects.
6
-
1
+ # @abaplint/core
2
+
3
+ [abaplint](https://abaplint.org/) core library
4
+
5
+ Exposes functionallity like the parser and rules, which can be used in other projects.
6
+
7
7
  For more information see https://github.com/abaplint/abaplint
@@ -170,7 +170,7 @@ declare class ArrowOrDash extends Expression {
170
170
  getRunnable(): IStatementRunnable;
171
171
  }
172
172
 
173
- export declare class Artifacts {
173
+ export declare class ArtifactsABAP {
174
174
  static getStructures(): IStructure[];
175
175
  static getExpressions(): (new () => Expression)[];
176
176
  static getStatements(): IStatement[];
@@ -1114,6 +1114,9 @@ declare class DataControl extends AbstractObject {
1114
1114
 
1115
1115
  declare class DataDefinition extends AbstractObject {
1116
1116
  private sqlViewName;
1117
+ private parserError;
1118
+ private fieldNames;
1119
+ private sources;
1117
1120
  getType(): string;
1118
1121
  getAllowedNaming(): {
1119
1122
  maxLength: number;
@@ -1122,8 +1125,16 @@ declare class DataDefinition extends AbstractObject {
1122
1125
  getSQLViewName(): string | undefined;
1123
1126
  getDescription(): string | undefined;
1124
1127
  parseType(_reg: IRegistry): AbstractType;
1128
+ listSources(): {
1129
+ name: string;
1130
+ as: string | undefined;
1131
+ }[];
1125
1132
  setDirty(): void;
1133
+ findSourceFile(): IFile | undefined;
1134
+ hasParserError(): boolean | undefined;
1126
1135
  parse(): IParseResult;
1136
+ private findFieldNames;
1137
+ private findSources;
1127
1138
  }
1128
1139
 
1129
1140
  declare class DataDefinition_2 extends Expression {
@@ -1188,44 +1199,16 @@ declare class DDIC {
1188
1199
  textToType(text: string | undefined, length: string | undefined, decimals: string | undefined, parent: string, qualify?: boolean): AbstractType;
1189
1200
  }
1190
1201
 
1191
- declare class DDLInclude extends Expression {
1192
- getRunnable(): IStatementRunnable;
1193
- }
1194
-
1195
1202
  declare enum DDLKind {
1196
1203
  Structure = "structure",
1197
1204
  Table = "table"
1198
1205
  }
1199
1206
 
1200
- declare class DDLName extends Expression {
1201
- getRunnable(): IStatementRunnable;
1202
- }
1203
-
1204
1207
  export declare class DDLParser {
1205
1208
  parse(file: IFile): IDDLParserResult | undefined;
1206
1209
  private parsedToResult;
1207
1210
  }
1208
1211
 
1209
- declare class DDLStructure extends Expression {
1210
- getRunnable(): IStatementRunnable;
1211
- }
1212
-
1213
- declare class DDLStructureField extends Expression {
1214
- getRunnable(): IStatementRunnable;
1215
- }
1216
-
1217
- declare class DDLTable extends Expression {
1218
- getRunnable(): IStatementRunnable;
1219
- }
1220
-
1221
- declare class DDLTableField extends Expression {
1222
- getRunnable(): IStatementRunnable;
1223
- }
1224
-
1225
- declare class DDLType extends Expression {
1226
- getRunnable(): IStatementRunnable;
1227
- }
1228
-
1229
1212
  declare class DecFloat16Type extends AbstractType {
1230
1213
  toText(): string;
1231
1214
  isGeneric(): boolean;
@@ -1689,13 +1672,6 @@ declare namespace Expressions {
1689
1672
  DataDefinition_2 as DataDefinition,
1690
1673
  DatabaseConnection,
1691
1674
  DatabaseTable,
1692
- DDLInclude,
1693
- DDLName,
1694
- DDLStructureField,
1695
- DDLStructure,
1696
- DDLTableField,
1697
- DDLTable,
1698
- DDLType,
1699
1675
  Decimals,
1700
1676
  Default,
1701
1677
  DefinitionName,
@@ -47,13 +47,6 @@ __exportStar(require("./corresponding_body"), exports);
47
47
  __exportStar(require("./data_definition"), exports);
48
48
  __exportStar(require("./database_connection"), exports);
49
49
  __exportStar(require("./database_table"), exports);
50
- __exportStar(require("./ddl/ddl_include"), exports);
51
- __exportStar(require("./ddl/ddl_name"), exports);
52
- __exportStar(require("./ddl/ddl_structure_field"), exports);
53
- __exportStar(require("./ddl/ddl_structure"), exports);
54
- __exportStar(require("./ddl/ddl_table_field"), exports);
55
- __exportStar(require("./ddl/ddl_table"), exports);
56
- __exportStar(require("./ddl/ddl_type"), exports);
57
50
  __exportStar(require("./decimals"), exports);
58
51
  __exportStar(require("./default"), exports);
59
52
  __exportStar(require("./definition_name"), exports);
@@ -14,7 +14,7 @@ exports.STATEMENT_MAX_TOKENS = 1000;
14
14
  class StatementMap {
15
15
  constructor() {
16
16
  this.map = {};
17
- for (const stat of artifacts_1.Artifacts.getStatements()) {
17
+ for (const stat of artifacts_1.ArtifactsABAP.getStatements()) {
18
18
  const f = stat.getMatcher().first();
19
19
  if (f.length === 0) {
20
20
  throw new Error("StatementMap, first must have contents");
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Artifacts = void 0;
3
+ exports.ArtifactsABAP = void 0;
4
4
  const Statements = require("./2_statements/statements");
5
5
  const Expressions = require("./2_statements/expressions");
6
6
  const combi_1 = require("./2_statements/combi");
@@ -35,7 +35,7 @@ class List {
35
35
  function className(cla) {
36
36
  return cla.constructor.name;
37
37
  }
38
- class Artifacts {
38
+ class ArtifactsABAP {
39
39
  static getStructures() {
40
40
  const ret = [];
41
41
  const list = Structures;
@@ -77,5 +77,5 @@ class Artifacts {
77
77
  return list.get();
78
78
  }
79
79
  }
80
- exports.Artifacts = Artifacts;
80
+ exports.ArtifactsABAP = ArtifactsABAP;
81
81
  //# sourceMappingURL=artifacts.js.map
@@ -72,13 +72,13 @@ class FlowGraph {
72
72
  this.label = label;
73
73
  }
74
74
  toDigraph() {
75
- return `digraph G {
76
- labelloc="t";
77
- label="${this.label}";
78
- graph [fontname = "helvetica"];
79
- node [fontname = "helvetica", shape="box"];
80
- edge [fontname = "helvetica"];
81
- ${this.toTextEdges()}
75
+ return `digraph G {
76
+ labelloc="t";
77
+ label="${this.label}";
78
+ graph [fontname = "helvetica"];
79
+ node [fontname = "helvetica", shape="box"];
80
+ edge [fontname = "helvetica"];
81
+ ${this.toTextEdges()}
82
82
  }`;
83
83
  }
84
84
  listSources(node) {
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ArtifactsCDS = void 0;
4
+ const Expressions = require("./expressions");
5
+ class ArtifactsCDS {
6
+ static getExpressions() {
7
+ const ret = [];
8
+ const list = Expressions;
9
+ for (const key in Expressions) {
10
+ if (typeof list[key] === "function") {
11
+ ret.push(list[key]);
12
+ }
13
+ }
14
+ return ret;
15
+ }
16
+ }
17
+ exports.ArtifactsCDS = ArtifactsCDS;
18
+ //# sourceMappingURL=artifacts.js.map
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CDSLexer = void 0;
4
+ const tokens_1 = require("../abap/1_lexer/tokens");
5
+ const position_1 = require("../position");
6
+ // todo: Keywords must be all uppercase, all lowercase, or in lowercase with an
7
+ // uppercase initial letter. Other mixes of uppercase and lowercase are not allowed
8
+ class Stream {
9
+ constructor(buffer) {
10
+ this.buffer = buffer;
11
+ }
12
+ takeNext() {
13
+ const next = this.buffer.substring(0, 1);
14
+ this.buffer = this.buffer.substring(1);
15
+ return next;
16
+ }
17
+ peekNext() {
18
+ const next = this.buffer.substring(0, 1);
19
+ return next;
20
+ }
21
+ length() {
22
+ return this.buffer.length;
23
+ }
24
+ }
25
+ class Result {
26
+ constructor() {
27
+ this.result = [];
28
+ }
29
+ add(text, row, col) {
30
+ if (text.length > 0) {
31
+ this.result.push(new tokens_1.Identifier(new position_1.Position(row, col), text));
32
+ }
33
+ return "";
34
+ }
35
+ get() {
36
+ return this.result;
37
+ }
38
+ }
39
+ var Mode;
40
+ (function (Mode) {
41
+ Mode[Mode["Default"] = 0] = "Default";
42
+ Mode[Mode["String"] = 1] = "String";
43
+ Mode[Mode["SingleLineComment"] = 2] = "SingleLineComment";
44
+ Mode[Mode["MultiLineComment"] = 3] = "MultiLineComment";
45
+ })(Mode || (Mode = {}));
46
+ class CDSLexer {
47
+ static run(file) {
48
+ const result = new Result();
49
+ let mode = Mode.Default;
50
+ let row = 1;
51
+ let col = 1;
52
+ let build = "";
53
+ const stream = new Stream(file.getRaw());
54
+ while (stream.length() > 0) {
55
+ const next = stream.takeNext();
56
+ const nextNext = stream.peekNext();
57
+ col++;
58
+ if (mode === Mode.String) {
59
+ build += next;
60
+ if (next === "'") {
61
+ build = result.add(build, row, col);
62
+ mode = Mode.Default;
63
+ }
64
+ continue;
65
+ }
66
+ if (mode === Mode.SingleLineComment) {
67
+ if (next === "\n") {
68
+ mode = Mode.Default;
69
+ }
70
+ continue;
71
+ }
72
+ else if (mode === Mode.Default && next === "/" && nextNext === "/") {
73
+ mode = Mode.SingleLineComment;
74
+ build = result.add(build, row, col);
75
+ continue;
76
+ }
77
+ switch (next) {
78
+ case "'":
79
+ mode = Mode.String;
80
+ build += next;
81
+ break;
82
+ case " ":
83
+ build = result.add(build, row, col);
84
+ break;
85
+ case "\n":
86
+ build = result.add(build, row, col);
87
+ row++;
88
+ col = 0;
89
+ break;
90
+ case ";":
91
+ case ":":
92
+ case ",":
93
+ case ".":
94
+ case "{":
95
+ case "}":
96
+ case "(":
97
+ case ")":
98
+ case "[":
99
+ case "]":
100
+ build = result.add(build, row, col);
101
+ result.add(next, row, col);
102
+ break;
103
+ default:
104
+ build += next;
105
+ break;
106
+ }
107
+ }
108
+ result.add(build, row, col);
109
+ return result.get();
110
+ }
111
+ }
112
+ exports.CDSLexer = CDSLexer;
113
+ //# sourceMappingURL=cds_lexer.js.map
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CDSParser = void 0;
4
+ const combi_1 = require("../abap/2_statements/combi");
5
+ const nodes_1 = require("../abap/nodes");
6
+ const version_1 = require("../version");
7
+ const cds_lexer_1 = require("./cds_lexer");
8
+ const Expressions = require("./expressions");
9
+ // todo: the names of the ABAP + CDS + DDL expressions might overlap, if overlapping the singleton will fail
10
+ class CDSParser {
11
+ parse(file) {
12
+ if (file === undefined) {
13
+ return undefined;
14
+ }
15
+ const tokens = cds_lexer_1.CDSLexer.run(file);
16
+ // console.dir(tokens);
17
+ let res = combi_1.Combi.run(new Expressions.CDSDefineView(), tokens, version_1.defaultVersion);
18
+ if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {
19
+ res = combi_1.Combi.run(new Expressions.CDSDefineAbstract(), tokens, version_1.defaultVersion);
20
+ }
21
+ if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {
22
+ return undefined;
23
+ }
24
+ return res[0];
25
+ }
26
+ }
27
+ exports.CDSParser = CDSParser;
28
+ //# sourceMappingURL=cds_parser.js.map
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CDSAnnotation = void 0;
4
+ const _1 = require(".");
5
+ const combi_1 = require("../../abap/2_statements/combi");
6
+ class CDSAnnotation extends combi_1.Expression {
7
+ getRunnable() {
8
+ // todo: add all the known annotations
9
+ const value = (0, combi_1.alt)(_1.CDSString, "true", "false", (0, combi_1.regex)(/^\d+$/), (0, combi_1.seq)((0, combi_1.regex)(/^\d+$/), ".", (0, combi_1.regex)(/^\d+$/)), (0, combi_1.regex)(/^#[\w_]+$/));
10
+ const namedot = (0, combi_1.seq)(_1.CDSName, (0, combi_1.star)((0, combi_1.seq)(".", _1.CDSName)));
11
+ const valueNested = (0, combi_1.seq)("{", namedot, ":", value, (0, combi_1.star)((0, combi_1.seq)(",", namedot, ":", value)), "}");
12
+ const valueList = (0, combi_1.seq)("[", (0, combi_1.alt)(value, valueNested), (0, combi_1.star)((0, combi_1.seq)(",", (0, combi_1.alt)(value, valueNested))), "]");
13
+ return (0, combi_1.seq)((0, combi_1.regex)(/^@\w+$/), (0, combi_1.star)((0, combi_1.seq)(".", (0, combi_1.regex)(/^\w+$/))), (0, combi_1.opt)(":"), (0, combi_1.opt)((0, combi_1.alt)(valueList, valueNested, value)));
14
+ }
15
+ }
16
+ exports.CDSAnnotation = CDSAnnotation;
17
+ //# sourceMappingURL=cds_annotation.js.map
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CDSAs = void 0;
4
+ const _1 = require(".");
5
+ const combi_1 = require("../../abap/2_statements/combi");
6
+ class CDSAs extends combi_1.Expression {
7
+ getRunnable() {
8
+ return (0, combi_1.seq)("AS", _1.CDSName);
9
+ }
10
+ }
11
+ exports.CDSAs = CDSAs;
12
+ //# sourceMappingURL=cds_as.js.map
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CDSAssociation = void 0;
4
+ const _1 = require(".");
5
+ const combi_1 = require("../../abap/2_statements/combi");
6
+ class CDSAssociation extends combi_1.Expression {
7
+ getRunnable() {
8
+ const cardinality = (0, combi_1.seq)("[", (0, combi_1.alt)("0", "1"), (0, combi_1.opt)((0, combi_1.seq)(".", ".", (0, combi_1.alt)("0", "1", "*"))), "]");
9
+ const as = (0, combi_1.seq)("AS", _1.CDSName);
10
+ const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.plus)((0, combi_1.seq)(".", _1.CDSName)));
11
+ const cond = (0, combi_1.seq)(name, "=", (0, combi_1.alt)(name, _1.CDSString));
12
+ const and = (0, combi_1.seq)("AND", cond);
13
+ return (0, combi_1.seq)("ASSOCIATION", cardinality, "TO", _1.CDSName, (0, combi_1.opt)(as), "ON", cond, (0, combi_1.star)(and));
14
+ }
15
+ }
16
+ exports.CDSAssociation = CDSAssociation;
17
+ //# sourceMappingURL=cds_association.js.map
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CDSCast = void 0;
4
+ const _1 = require(".");
5
+ const combi_1 = require("../../abap/2_statements/combi");
6
+ class CDSCast extends combi_1.Expression {
7
+ getRunnable() {
8
+ const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.opt)((0, combi_1.seq)(".", _1.CDSName)));
9
+ return (0, combi_1.seq)("CAST", "(", (0, combi_1.alt)(name, _1.CDSFunction), "AS", _1.CDSName, (0, combi_1.opt)((0, combi_1.seq)("PRESERVING", "TYPE")), ")");
10
+ }
11
+ }
12
+ exports.CDSCast = CDSCast;
13
+ //# sourceMappingURL=cds_cast.js.map
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CDSDefineAbstract = void 0;
4
+ const _1 = require(".");
5
+ const combi_1 = require("../../abap/2_statements/combi");
6
+ const cds_name_1 = require("./cds_name");
7
+ class CDSDefineAbstract extends combi_1.Expression {
8
+ getRunnable() {
9
+ const field = (0, combi_1.seq)((0, combi_1.str)("KEY"), cds_name_1.CDSName, ":", cds_name_1.CDSName, ";");
10
+ return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.str)("DEFINE ABSTRACT ENTITY"), cds_name_1.CDSName, (0, combi_1.str)("{"), (0, combi_1.plus)(field), (0, combi_1.str)("}"), (0, combi_1.opt)(";"));
11
+ }
12
+ }
13
+ exports.CDSDefineAbstract = CDSDefineAbstract;
14
+ //# sourceMappingURL=cds_define_abstract.js.map
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CDSDefineView = void 0;
4
+ const _1 = require(".");
5
+ const combi_1 = require("../../abap/2_statements/combi");
6
+ const cds_name_1 = require("./cds_name");
7
+ const cds_select_1 = require("./cds_select");
8
+ class CDSDefineView extends combi_1.Expression {
9
+ getRunnable() {
10
+ return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.str)("DEFINE VIEW"), cds_name_1.CDSName, "AS", cds_select_1.CDSSelect, (0, combi_1.opt)(";"));
11
+ }
12
+ }
13
+ exports.CDSDefineView = CDSDefineView;
14
+ //# sourceMappingURL=cds_define_view.js.map
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CDSElement = void 0;
4
+ const _1 = require(".");
5
+ const combi_1 = require("../../abap/2_statements/combi");
6
+ const cds_as_1 = require("./cds_as");
7
+ const cds_cast_1 = require("./cds_cast");
8
+ class CDSElement extends combi_1.Expression {
9
+ getRunnable() {
10
+ return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.optPrio)("KEY"), (0, combi_1.alt)((0, combi_1.seq)(_1.CDSName, (0, combi_1.opt)((0, combi_1.seq)(".", _1.CDSName))), cds_cast_1.CDSCast), (0, combi_1.optPrio)(cds_as_1.CDSAs));
11
+ }
12
+ }
13
+ exports.CDSElement = CDSElement;
14
+ //# sourceMappingURL=cds_element.js.map
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CDSFunction = void 0;
4
+ const _1 = require(".");
5
+ const combi_1 = require("../../abap/2_statements/combi");
6
+ class CDSFunction extends combi_1.Expression {
7
+ getRunnable() {
8
+ const input = (0, combi_1.alt)(_1.CDSName, (0, combi_1.regex)(/^\d+$/));
9
+ const coalesce = (0, combi_1.seq)("COALESCE", "(", input, ",", input, ")");
10
+ const concat = (0, combi_1.seq)("CONCAT", "(", input, ",", input, ")");
11
+ const concat_with_space = (0, combi_1.seq)("CONCAT_WITH_SPACE", "(", input, ",", input, ",", input, ")");
12
+ const substring = (0, combi_1.seq)("SUBSTRING", "(", input, ",", input, ",", input, ")");
13
+ return (0, combi_1.alt)(substring, coalesce, concat, concat_with_space);
14
+ }
15
+ }
16
+ exports.CDSFunction = CDSFunction;
17
+ //# sourceMappingURL=cds_function.js.map
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CDSJoin = void 0;
4
+ const _1 = require(".");
5
+ const combi_1 = require("../../abap/2_statements/combi");
6
+ class CDSJoin extends combi_1.Expression {
7
+ getRunnable() {
8
+ const name = (0, combi_1.seq)(_1.CDSName, ".", _1.CDSName);
9
+ return (0, combi_1.seq)("INNER JOIN", _1.CDSSource, "ON", name, "=", name);
10
+ }
11
+ }
12
+ exports.CDSJoin = CDSJoin;
13
+ //# sourceMappingURL=cds_join.js.map
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CDSName = void 0;
4
+ const combi_1 = require("../../abap/2_statements/combi");
5
+ class CDSName extends combi_1.Expression {
6
+ getRunnable() {
7
+ return (0, combi_1.regex)(/^\$?[\w_]+$/);
8
+ }
9
+ }
10
+ exports.CDSName = CDSName;
11
+ //# sourceMappingURL=cds_name.js.map
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CDSSelect = void 0;
4
+ const _1 = require(".");
5
+ const combi_1 = require("../../abap/2_statements/combi");
6
+ const cds_association_1 = require("./cds_association");
7
+ const cds_element_1 = require("./cds_element");
8
+ const cds_join_1 = require("./cds_join");
9
+ class CDSSelect extends combi_1.Expression {
10
+ getRunnable() {
11
+ return (0, combi_1.seq)((0, combi_1.str)("SELECT FROM"), _1.CDSSource, (0, combi_1.opt)(cds_join_1.CDSJoin), (0, combi_1.star)(cds_association_1.CDSAssociation), (0, combi_1.str)("{"), (0, combi_1.plus)(cds_element_1.CDSElement), (0, combi_1.star)((0, combi_1.seq)(",", cds_element_1.CDSElement)), (0, combi_1.str)("}"), (0, combi_1.opt)(_1.CDSWhere));
12
+ }
13
+ }
14
+ exports.CDSSelect = CDSSelect;
15
+ //# sourceMappingURL=cds_select.js.map
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CDSSource = void 0;
4
+ const _1 = require(".");
5
+ const combi_1 = require("../../abap/2_statements/combi");
6
+ class CDSSource extends combi_1.Expression {
7
+ getRunnable() {
8
+ return (0, combi_1.seq)((0, combi_1.regex)(/^[\w_]+$/), (0, combi_1.opt)(_1.CDSAs));
9
+ }
10
+ }
11
+ exports.CDSSource = CDSSource;
12
+ //# sourceMappingURL=cds_source.js.map
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CDSString = void 0;
4
+ const combi_1 = require("../../abap/2_statements/combi");
5
+ class CDSString extends combi_1.Expression {
6
+ getRunnable() {
7
+ return (0, combi_1.regex)(/^'[\w: -_]+'$/);
8
+ }
9
+ }
10
+ exports.CDSString = CDSString;
11
+ //# sourceMappingURL=cds_string.js.map
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CDSWhere = void 0;
4
+ const _1 = require(".");
5
+ const combi_1 = require("../../abap/2_statements/combi");
6
+ class CDSWhere extends combi_1.Expression {
7
+ getRunnable() {
8
+ const field = (0, combi_1.seq)(_1.CDSName, (0, combi_1.star)((0, combi_1.seq)(".", _1.CDSName)));
9
+ const condition = (0, combi_1.seq)(field, "=", (0, combi_1.alt)(_1.CDSString, field));
10
+ return (0, combi_1.seq)("WHERE", condition, (0, combi_1.star)((0, combi_1.seq)("AND", condition)));
11
+ }
12
+ }
13
+ exports.CDSWhere = CDSWhere;
14
+ //# sourceMappingURL=cds_where.js.map
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./cds_annotation"), exports);
14
+ __exportStar(require("./cds_as"), exports);
15
+ __exportStar(require("./cds_association"), exports);
16
+ __exportStar(require("./cds_cast"), exports);
17
+ __exportStar(require("./cds_define_view"), exports);
18
+ __exportStar(require("./cds_define_abstract"), exports);
19
+ __exportStar(require("./cds_element"), exports);
20
+ __exportStar(require("./cds_function"), exports);
21
+ __exportStar(require("./cds_join"), exports);
22
+ __exportStar(require("./cds_name"), exports);
23
+ __exportStar(require("./cds_select"), exports);
24
+ __exportStar(require("./cds_source"), exports);
25
+ __exportStar(require("./cds_where"), exports);
26
+ __exportStar(require("./cds_string"), exports);
27
+ //# sourceMappingURL=index.js.map
@@ -46,6 +46,7 @@ class Config {
46
46
  global: {
47
47
  files: "/src/**/*.*",
48
48
  exclude: [],
49
+ noIssues: [],
49
50
  skipGeneratedGatewayClasses: true,
50
51
  skipGeneratedPersistentClasses: true,
51
52
  skipGeneratedFunctionGroups: true,
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ArtifactsDDL = void 0;
4
+ const Expressions = require("./expressions");
5
+ class ArtifactsDDL {
6
+ static getExpressions() {
7
+ const ret = [];
8
+ const list = Expressions;
9
+ for (const key in Expressions) {
10
+ if (typeof list[key] === "function") {
11
+ ret.push(list[key]);
12
+ }
13
+ }
14
+ return ret;
15
+ }
16
+ }
17
+ exports.ArtifactsDDL = ArtifactsDDL;
18
+ //# sourceMappingURL=artifacts.js.map
@@ -5,7 +5,7 @@ const combi_1 = require("../abap/2_statements/combi");
5
5
  const nodes_1 = require("../abap/nodes");
6
6
  const version_1 = require("../version");
7
7
  const ddl_lexer_1 = require("./ddl_lexer");
8
- const Expressions = require("../abap/2_statements/expressions");
8
+ const Expressions = require("./expressions");
9
9
  var DDLKind;
10
10
  (function (DDLKind) {
11
11
  DDLKind["Structure"] = "structure";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DDLInclude = void 0;
4
- const combi_1 = require("../../combi");
4
+ const combi_1 = require("../../abap/2_statements/combi");
5
5
  const ddl_name_1 = require("./ddl_name");
6
6
  class DDLInclude extends combi_1.Expression {
7
7
  getRunnable() {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DDLName = void 0;
4
- const combi_1 = require("../../combi");
4
+ const combi_1 = require("../../abap/2_statements/combi");
5
5
  class DDLName extends combi_1.Expression {
6
6
  getRunnable() {
7
7
  return (0, combi_1.regex)(/^\w+$/);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DDLStructure = void 0;
4
- const combi_1 = require("../../combi");
4
+ const combi_1 = require("../../abap/2_statements/combi");
5
5
  const ddl_structure_field_1 = require("./ddl_structure_field");
6
6
  const ddl_name_1 = require("./ddl_name");
7
7
  const ddl_include_1 = require("./ddl_include");