@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.
- package/build/abaplint.d.ts +25 -4
- package/build/src/abap/2_statements/combi.js +1 -1
- package/build/src/abap/2_statements/expressions/_lob_handle_type.js +17 -0
- package/build/src/abap/2_statements/expressions/data_definition.js +2 -1
- package/build/src/abap/2_statements/expressions/form_param_type.js +2 -1
- package/build/src/abap/2_statements/expressions/index.js +1 -0
- package/build/src/abap/2_statements/expressions/method_def_changing.js +3 -1
- package/build/src/abap/2_statements/expressions/method_def_importing.js +3 -1
- package/build/src/abap/2_statements/expressions/type.js +3 -2
- package/build/src/abap/2_statements/expressions/type_simple_ref.js +13 -0
- package/build/src/abap/2_statements/expressions/type_structure.js +4 -4
- package/build/src/abap/2_statements/expressions/type_table.js +1 -1
- package/build/src/abap/2_statements/statements/fieldsymbol.js +3 -1
- package/build/src/abap/2_statements/statements/type.js +4 -1
- package/build/src/abap/5_syntax/statements/get_permissions.js +59 -0
- package/build/src/abap/5_syntax/syntax.js +2 -0
- package/build/src/cds/cds_parser.js +6 -0
- package/build/src/cds/expressions/cds_aggregate.js +3 -5
- package/build/src/cds/expressions/cds_define_abstract.js +1 -1
- package/build/src/cds/expressions/cds_define_external_entity.js +20 -0
- package/build/src/cds/expressions/cds_define_hierarchy.js +7 -1
- package/build/src/cds/expressions/cds_define_projection.js +3 -1
- package/build/src/cds/expressions/cds_define_table_entity.js +19 -0
- package/build/src/cds/expressions/cds_define_view.js +2 -1
- package/build/src/cds/expressions/cds_element.js +4 -7
- package/build/src/cds/expressions/cds_extend_view.js +8 -3
- package/build/src/cds/expressions/cds_function.js +5 -4
- package/build/src/cds/expressions/cds_prefixed_name.js +2 -15
- package/build/src/cds/expressions/cds_provider_contract.js +1 -1
- package/build/src/cds/expressions/cds_select.js +5 -2
- package/build/src/cds/expressions/cds_source.js +6 -5
- package/build/src/cds/expressions/cds_string.js +1 -8
- package/build/src/cds/expressions/index.js +2 -0
- package/build/src/config.js +8 -3
- package/build/src/ddl/ddl_parser.js +89 -24
- package/build/src/ddl/expressions/ddl_aspect.js +18 -0
- package/build/src/ddl/expressions/ddl_clauses.js +27 -0
- package/build/src/ddl/expressions/ddl_extend.js +15 -0
- package/build/src/ddl/expressions/ddl_extend_type.js +18 -0
- package/build/src/ddl/expressions/ddl_include.js +4 -1
- package/build/src/ddl/expressions/ddl_literal.js +18 -0
- package/build/src/ddl/expressions/ddl_name.js +2 -1
- package/build/src/ddl/expressions/ddl_named_include.js +15 -0
- package/build/src/ddl/expressions/ddl_qualified_name.js +12 -0
- package/build/src/ddl/expressions/ddl_structure.js +6 -3
- package/build/src/ddl/expressions/ddl_structure_field.js +2 -1
- package/build/src/ddl/expressions/ddl_table.js +5 -1
- package/build/src/ddl/expressions/ddl_table_field.js +4 -1
- package/build/src/ddl/expressions/ddl_type.js +7 -1
- package/build/src/ddl/expressions/ddl_where.js +15 -0
- package/build/src/ddl/expressions/index.js +8 -0
- package/build/src/index.js +3 -2
- package/build/src/objects/data_definition.js +7 -0
- package/build/src/registry.js +1 -1
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ exports.CDSProviderContract = void 0;
|
|
|
4
4
|
const combi_1 = require("../../abap/2_statements/combi");
|
|
5
5
|
class CDSProviderContract extends combi_1.Expression {
|
|
6
6
|
getRunnable() {
|
|
7
|
-
return (0, combi_1.seq)("PROVIDER CONTRACT", (0, combi_1.alt)("TRANSACTIONAL_QUERY", "TRANSACTIONAL_INTERFACE", "ANALYTICAL_QUERY"));
|
|
7
|
+
return (0, combi_1.seq)("PROVIDER CONTRACT", (0, combi_1.alt)("TRANSACTIONAL_QUERY", "TRANSACTIONAL_INTERFACE", "ANALYTICAL_QUERY", "SQL_QUERY", "STRUCTURED_QUERY"));
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
exports.CDSProviderContract = CDSProviderContract;
|
|
@@ -9,10 +9,13 @@ class CDSSelect extends combi_1.Expression {
|
|
|
9
9
|
getRunnable() {
|
|
10
10
|
const fields = (0, combi_1.seq)((0, combi_1.star)((0, combi_1.seq)(_1.CDSElement, ",")), _1.CDSElement);
|
|
11
11
|
const distinct = (0, combi_1.str)("DISTINCT");
|
|
12
|
-
// elem (,elem)* [,] — handles separator commas and optional trailing comma
|
|
13
12
|
const elementList = (0, combi_1.seq)(_1.CDSElement, (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.opt)(","));
|
|
14
13
|
const elements = (0, combi_1.seq)((0, combi_1.str)("{"), (0, combi_1.altPrio)("*", elementList), (0, combi_1.str)("}"));
|
|
15
|
-
|
|
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)), ")");
|
|
16
|
+
const parenSelect = (0, combi_1.seq)("(", CDSSelect, ")");
|
|
17
|
+
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))));
|
|
16
19
|
}
|
|
17
20
|
}
|
|
18
21
|
exports.CDSSelect = CDSSelect;
|
|
@@ -5,13 +5,14 @@ const _1 = require(".");
|
|
|
5
5
|
const combi_1 = require("../../abap/2_statements/combi");
|
|
6
6
|
class CDSSource extends combi_1.Expression {
|
|
7
7
|
getRunnable() {
|
|
8
|
-
// Static where filter in FROM: SomeTable [Field = 'Value']
|
|
9
8
|
const staticFilter = (0, combi_1.seq)("[", _1.CDSCondition, "]");
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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)));
|
|
13
|
+
const funcSingleSource = (0, combi_1.seq)(_1.CDSFunction, (0, combi_1.opt)((0, combi_1.altPrio)(_1.CDSAs, _1.CDSName)));
|
|
13
14
|
const parenSource = (0, combi_1.seq)("(", (0, combi_1.altPrio)(CDSSource, singleSource), (0, combi_1.star)(_1.CDSJoin), ")");
|
|
14
|
-
return (0, combi_1.altPrio)(parenSource, singleSource);
|
|
15
|
+
return (0, combi_1.altPrio)(parenSource, funcSingleSource, singleSource);
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
18
|
exports.CDSSource = CDSSource;
|
|
@@ -4,15 +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
|
-
// Allow any character except unescaped single quote; escape sequences:
|
|
8
|
-
// '' — escaped single quote (doubling)
|
|
9
|
-
// \' — escaped single quote (backslash form)
|
|
10
|
-
// \\ — escaped backslash (e.g. '\\' in ltrim/rtrim calls)
|
|
11
|
-
// \x — other backslash sequences not followed by '
|
|
12
7
|
const reg = (0, combi_1.regex)(/^'(?:[^'\\]|''|\\'|\\\\|\\(?!'))*'$/);
|
|
13
|
-
|
|
14
|
-
// Lexed as tokens: abap, ., typename, 'value'
|
|
15
|
-
const abapTypeName = (0, combi_1.regex)(/^(?:int[1-9]|sstring|char|numc|dats|tims|fltp|decfloat\d+|dec|string|raw|xstring|clnt|lang|unit|cuky|curr|quan|d|t|p|n|c|x|f)$/i);
|
|
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);
|
|
16
9
|
const abap = (0, combi_1.seq)("abap", ".", abapTypeName, (0, combi_1.optPrio)((0, combi_1.seq)("(", (0, combi_1.regex)(/^\d+$/), ")")), reg);
|
|
17
10
|
return (0, combi_1.altPrio)(abap, reg);
|
|
18
11
|
}
|
|
@@ -31,8 +31,10 @@ __exportStar(require("./cds_composition"), exports);
|
|
|
31
31
|
__exportStar(require("./cds_condition"), exports);
|
|
32
32
|
__exportStar(require("./cds_define_abstract"), exports);
|
|
33
33
|
__exportStar(require("./cds_define_custom"), exports);
|
|
34
|
+
__exportStar(require("./cds_define_external_entity"), exports);
|
|
34
35
|
__exportStar(require("./cds_define_hierarchy"), exports);
|
|
35
36
|
__exportStar(require("./cds_define_projection"), exports);
|
|
37
|
+
__exportStar(require("./cds_define_table_entity"), exports);
|
|
36
38
|
__exportStar(require("./cds_define_table_function"), exports);
|
|
37
39
|
__exportStar(require("./cds_define_view"), exports);
|
|
38
40
|
__exportStar(require("./cds_element"), exports);
|
package/build/src/config.js
CHANGED
|
@@ -47,7 +47,10 @@ class Config {
|
|
|
47
47
|
for (const rule of sorted) {
|
|
48
48
|
rules[rule.getMetadata().key] = rule.getConfig();
|
|
49
49
|
}
|
|
50
|
-
const version = ver
|
|
50
|
+
const version = ver !== null && ver !== void 0 ? ver : {
|
|
51
|
+
release: version_1.Release.Newest.name,
|
|
52
|
+
language: langVer !== null && langVer !== void 0 ? langVer : version_1.LanguageVersion.Normal,
|
|
53
|
+
};
|
|
51
54
|
// defaults: dont skip anything, report everything. The user can decide to skip stuff
|
|
52
55
|
// its difficult to debug errors not being reported
|
|
53
56
|
const config = {
|
|
@@ -174,12 +177,14 @@ class Config {
|
|
|
174
177
|
return v;
|
|
175
178
|
}
|
|
176
179
|
getLanguageVersion() {
|
|
177
|
-
|
|
180
|
+
if (this.config.syntax.languageVersion !== undefined) {
|
|
181
|
+
return this.config.syntax.languageVersion;
|
|
182
|
+
}
|
|
178
183
|
const v = this.config.syntax.version;
|
|
179
184
|
if (v !== undefined && typeof v !== "string") {
|
|
180
185
|
return v.language;
|
|
181
186
|
}
|
|
182
|
-
return
|
|
187
|
+
return version_1.LanguageVersion.Normal;
|
|
183
188
|
}
|
|
184
189
|
checkVersion() {
|
|
185
190
|
const version = this.config.syntax.version;
|
|
@@ -34,61 +34,126 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.DDLParser = exports.DDLKind = void 0;
|
|
37
|
+
const tokens_1 = require("../abap/1_lexer/tokens");
|
|
37
38
|
const combi_1 = require("../abap/2_statements/combi");
|
|
38
39
|
const nodes_1 = require("../abap/nodes");
|
|
39
40
|
const version_1 = require("../version");
|
|
40
|
-
const
|
|
41
|
+
const cds_lexer_1 = require("../cds/cds_lexer");
|
|
41
42
|
const Expressions = __importStar(require("./expressions"));
|
|
42
43
|
var DDLKind;
|
|
43
44
|
(function (DDLKind) {
|
|
44
45
|
DDLKind["Structure"] = "structure";
|
|
45
46
|
DDLKind["Table"] = "table";
|
|
47
|
+
DDLKind["Aspect"] = "aspect";
|
|
48
|
+
DDLKind["ExtendType"] = "extend-type";
|
|
46
49
|
})(DDLKind || (exports.DDLKind = DDLKind = {}));
|
|
47
50
|
class DDLParser {
|
|
48
51
|
parse(file) {
|
|
49
|
-
|
|
52
|
+
let tokens = cds_lexer_1.CDSLexer.run(file);
|
|
53
|
+
tokens = tokens.filter(t => !(t instanceof tokens_1.Comment));
|
|
50
54
|
let res = combi_1.Combi.run(new Expressions.DDLStructure(), tokens, version_1.defaultRelease);
|
|
51
55
|
if (res === undefined) {
|
|
52
56
|
res = combi_1.Combi.run(new Expressions.DDLTable(), tokens, version_1.defaultRelease);
|
|
53
57
|
}
|
|
58
|
+
if (res === undefined) {
|
|
59
|
+
res = combi_1.Combi.run(new Expressions.DDLAspect(), tokens, version_1.defaultRelease);
|
|
60
|
+
}
|
|
61
|
+
if (res === undefined) {
|
|
62
|
+
res = combi_1.Combi.run(new Expressions.DDLExtendType(), tokens, version_1.defaultRelease);
|
|
63
|
+
}
|
|
54
64
|
if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {
|
|
55
65
|
return undefined;
|
|
56
66
|
}
|
|
57
67
|
return this.parsedToResult(res[0]);
|
|
58
68
|
}
|
|
59
69
|
parsedToResult(node) {
|
|
60
|
-
var _a, _b;
|
|
61
70
|
const fields = [];
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
for (const child of node.getChildren()) {
|
|
72
|
+
if (!(child instanceof nodes_1.ExpressionNode)) {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
const expr = child.get();
|
|
76
|
+
const isField = expr instanceof Expressions.DDLStructureField
|
|
77
|
+
|| expr instanceof Expressions.DDLTableField
|
|
78
|
+
|| expr instanceof Expressions.DDLInclude
|
|
79
|
+
|| expr instanceof Expressions.DDLNamedInclude;
|
|
80
|
+
if (!isField) {
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
const key = this.hasKey(child);
|
|
84
|
+
const notNull = this.hasNotNull(child);
|
|
85
|
+
if (expr instanceof Expressions.DDLInclude) {
|
|
86
|
+
const target = this.compactTokens(child.findDirectExpression(Expressions.DDLName));
|
|
87
|
+
fields.push({ name: ".INCLUDE", type: target, key, notNull });
|
|
88
|
+
}
|
|
89
|
+
else if (expr instanceof Expressions.DDLNamedInclude) {
|
|
90
|
+
const names = child.findDirectExpressions(Expressions.DDLName);
|
|
91
|
+
const alias = this.compactTokens(names[0]);
|
|
92
|
+
const target = this.compactTokens(names[1]);
|
|
93
|
+
fields.push({ name: alias, type: target, key, notNull });
|
|
74
94
|
}
|
|
75
95
|
else {
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
type,
|
|
80
|
-
key: false,
|
|
81
|
-
notNull: false,
|
|
82
|
-
});
|
|
96
|
+
const name = this.compactTokens(child.findDirectExpression(Expressions.DDLName));
|
|
97
|
+
const type = this.compactTokens(child.findDirectExpression(Expressions.DDLType));
|
|
98
|
+
fields.push({ name, type, key, notNull });
|
|
83
99
|
}
|
|
84
100
|
}
|
|
85
101
|
const result = {
|
|
86
|
-
name: node.findDirectExpression(Expressions.DDLName)
|
|
87
|
-
kind:
|
|
102
|
+
name: this.compactTokens(node.findDirectExpression(Expressions.DDLName)),
|
|
103
|
+
kind: this.kindOf(node),
|
|
88
104
|
fields,
|
|
89
105
|
};
|
|
90
106
|
return result;
|
|
91
107
|
}
|
|
108
|
+
compactTokens(node) {
|
|
109
|
+
if (node === undefined) {
|
|
110
|
+
return "";
|
|
111
|
+
}
|
|
112
|
+
return node.concatTokens().replace(/\s+/g, "");
|
|
113
|
+
}
|
|
114
|
+
hasKey(node) {
|
|
115
|
+
var _a, _b, _c;
|
|
116
|
+
for (const c of node.getChildren()) {
|
|
117
|
+
const expr = (_b = (_a = c).get) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
118
|
+
const ctor = (_c = expr === null || expr === void 0 ? void 0 : expr.constructor) === null || _c === void 0 ? void 0 : _c.name;
|
|
119
|
+
if (ctor === "CDSAnnotation") {
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
const tok = c.concatTokens().toUpperCase().trim();
|
|
123
|
+
if (tok === "KEY") {
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
126
|
+
if (tok !== "") {
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
hasNotNull(node) {
|
|
133
|
+
var _a, _b, _c, _d;
|
|
134
|
+
const children = node.getChildren();
|
|
135
|
+
for (let i = 0; i < children.length - 1; i++) {
|
|
136
|
+
const a = (_b = (_a = children[i]).concatTokens) === null || _b === void 0 ? void 0 : _b.call(_a).toUpperCase().trim();
|
|
137
|
+
const b = (_d = (_c = children[i + 1]).concatTokens) === null || _d === void 0 ? void 0 : _d.call(_c).toUpperCase().trim();
|
|
138
|
+
if (a === "NOT" && b === "NULL") {
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
kindOf(node) {
|
|
145
|
+
const expr = node.get();
|
|
146
|
+
if (expr instanceof Expressions.DDLStructure) {
|
|
147
|
+
return DDLKind.Structure;
|
|
148
|
+
}
|
|
149
|
+
if (expr instanceof Expressions.DDLAspect) {
|
|
150
|
+
return DDLKind.Aspect;
|
|
151
|
+
}
|
|
152
|
+
if (expr instanceof Expressions.DDLExtendType) {
|
|
153
|
+
return DDLKind.ExtendType;
|
|
154
|
+
}
|
|
155
|
+
return DDLKind.Table;
|
|
156
|
+
}
|
|
92
157
|
}
|
|
93
158
|
exports.DDLParser = DDLParser;
|
|
94
159
|
//# sourceMappingURL=ddl_parser.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DDLAspect = void 0;
|
|
4
|
+
const combi_1 = require("../../abap/2_statements/combi");
|
|
5
|
+
const expressions_1 = require("../../cds/expressions");
|
|
6
|
+
const ddl_extend_1 = require("./ddl_extend");
|
|
7
|
+
const ddl_include_1 = require("./ddl_include");
|
|
8
|
+
const ddl_name_1 = require("./ddl_name");
|
|
9
|
+
const ddl_named_include_1 = require("./ddl_named_include");
|
|
10
|
+
const ddl_table_field_1 = require("./ddl_table_field");
|
|
11
|
+
class DDLAspect extends combi_1.Expression {
|
|
12
|
+
getRunnable() {
|
|
13
|
+
const entry = (0, combi_1.altPrio)(ddl_named_include_1.DDLNamedInclude, ddl_include_1.DDLInclude, ddl_table_field_1.DDLTableField, ddl_extend_1.DDLExtend);
|
|
14
|
+
return (0, combi_1.seq)((0, combi_1.star)(expressions_1.CDSAnnotation), "DEFINE", "ASPECT", ddl_name_1.DDLName, "{", (0, combi_1.plusPrio)(entry), "}", (0, combi_1.optPrio)(";"));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.DDLAspect = DDLAspect;
|
|
18
|
+
//# sourceMappingURL=ddl_aspect.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DDLValueHelp = exports.DDLForeignKey = exports.DDLForeignKeyTarget = void 0;
|
|
4
|
+
const combi_1 = require("../../abap/2_statements/combi");
|
|
5
|
+
const ddl_literal_1 = require("./ddl_literal");
|
|
6
|
+
const ddl_name_1 = require("./ddl_name");
|
|
7
|
+
const ddl_where_1 = require("./ddl_where");
|
|
8
|
+
class DDLForeignKeyTarget extends combi_1.Expression {
|
|
9
|
+
getRunnable() {
|
|
10
|
+
const cardinality = (0, combi_1.seq)("[", ddl_literal_1.DDLCardinalityValue, ".", ".", ddl_literal_1.DDLCardinalityValue, (0, combi_1.optPrio)((0, combi_1.seq)(",", ddl_literal_1.DDLCardinalityValue)), "]");
|
|
11
|
+
return (0, combi_1.seq)((0, combi_1.optPrio)(cardinality), ddl_name_1.DDLName);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.DDLForeignKeyTarget = DDLForeignKeyTarget;
|
|
15
|
+
class DDLForeignKey extends combi_1.Expression {
|
|
16
|
+
getRunnable() {
|
|
17
|
+
return (0, combi_1.seq)("WITH", "FOREIGN", "KEY", DDLForeignKeyTarget, (0, combi_1.optPrio)(ddl_where_1.DDLWhere));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.DDLForeignKey = DDLForeignKey;
|
|
21
|
+
class DDLValueHelp extends combi_1.Expression {
|
|
22
|
+
getRunnable() {
|
|
23
|
+
return (0, combi_1.seq)("WITH", "VALUE", "HELP", ddl_name_1.DDLName, (0, combi_1.optPrio)(ddl_where_1.DDLWhere));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.DDLValueHelp = DDLValueHelp;
|
|
27
|
+
//# sourceMappingURL=ddl_clauses.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DDLExtend = void 0;
|
|
4
|
+
const combi_1 = require("../../abap/2_statements/combi");
|
|
5
|
+
const expressions_1 = require("../../cds/expressions");
|
|
6
|
+
const ddl_clauses_1 = require("./ddl_clauses");
|
|
7
|
+
const ddl_name_1 = require("./ddl_name");
|
|
8
|
+
class DDLExtend extends combi_1.Expression {
|
|
9
|
+
getRunnable() {
|
|
10
|
+
const clause = (0, combi_1.alt)(ddl_clauses_1.DDLForeignKey, ddl_clauses_1.DDLValueHelp);
|
|
11
|
+
return (0, combi_1.seq)((0, combi_1.star)(expressions_1.CDSAnnotation), "EXTEND", ddl_name_1.DDLName, ":", (0, combi_1.plus)(clause), ";");
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.DDLExtend = DDLExtend;
|
|
15
|
+
//# sourceMappingURL=ddl_extend.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DDLExtendType = void 0;
|
|
4
|
+
const combi_1 = require("../../abap/2_statements/combi");
|
|
5
|
+
const expressions_1 = require("../../cds/expressions");
|
|
6
|
+
const ddl_include_1 = require("./ddl_include");
|
|
7
|
+
const ddl_name_1 = require("./ddl_name");
|
|
8
|
+
const ddl_named_include_1 = require("./ddl_named_include");
|
|
9
|
+
const ddl_structure_field_1 = require("./ddl_structure_field");
|
|
10
|
+
const ddl_table_field_1 = require("./ddl_table_field");
|
|
11
|
+
class DDLExtendType extends combi_1.Expression {
|
|
12
|
+
getRunnable() {
|
|
13
|
+
const entry = (0, combi_1.altPrio)(ddl_named_include_1.DDLNamedInclude, ddl_include_1.DDLInclude, ddl_table_field_1.DDLTableField, ddl_structure_field_1.DDLStructureField);
|
|
14
|
+
return (0, combi_1.seq)((0, combi_1.star)(expressions_1.CDSAnnotation), "EXTEND", "TYPE", ddl_name_1.DDLName, "WITH", ddl_name_1.DDLName, "{", (0, combi_1.plusPrio)(entry), "}", (0, combi_1.optPrio)(";"));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.DDLExtendType = DDLExtendType;
|
|
18
|
+
//# sourceMappingURL=ddl_extend_type.js.map
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DDLInclude = void 0;
|
|
4
4
|
const combi_1 = require("../../abap/2_statements/combi");
|
|
5
|
+
const expressions_1 = require("../../cds/expressions");
|
|
6
|
+
const ddl_clauses_1 = require("./ddl_clauses");
|
|
5
7
|
const ddl_name_1 = require("./ddl_name");
|
|
6
8
|
class DDLInclude extends combi_1.Expression {
|
|
7
9
|
getRunnable() {
|
|
8
|
-
|
|
10
|
+
const trailingClause = (0, combi_1.alt)(ddl_clauses_1.DDLForeignKey, ddl_clauses_1.DDLValueHelp);
|
|
11
|
+
return (0, combi_1.seq)((0, combi_1.star)(expressions_1.CDSAnnotation), (0, combi_1.optPrio)("KEY"), "INCLUDE", ddl_name_1.DDLName, (0, combi_1.optPrio)((0, combi_1.seq)("WITH", "SUFFIX", ddl_name_1.DDLName)), (0, combi_1.optPrio)("NOT NULL"), (0, combi_1.star)(trailingClause), ";");
|
|
9
12
|
}
|
|
10
13
|
}
|
|
11
14
|
exports.DDLInclude = DDLInclude;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DDLStringLiteral = exports.DDLCardinalityValue = void 0;
|
|
4
|
+
const combi_1 = require("../../abap/2_statements/combi");
|
|
5
|
+
const cds_integer_1 = require("../../cds/expressions/cds_integer");
|
|
6
|
+
class DDLCardinalityValue extends combi_1.Expression {
|
|
7
|
+
getRunnable() {
|
|
8
|
+
return (0, combi_1.altPrio)(cds_integer_1.CDSInteger, "*");
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.DDLCardinalityValue = DDLCardinalityValue;
|
|
12
|
+
class DDLStringLiteral extends combi_1.Expression {
|
|
13
|
+
getRunnable() {
|
|
14
|
+
return (0, combi_1.regex)(/^'[^']*'$/);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.DDLStringLiteral = DDLStringLiteral;
|
|
18
|
+
//# sourceMappingURL=ddl_literal.js.map
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DDLName = void 0;
|
|
4
4
|
const combi_1 = require("../../abap/2_statements/combi");
|
|
5
|
+
const cds_name_1 = require("../../cds/expressions/cds_name");
|
|
5
6
|
class DDLName extends combi_1.Expression {
|
|
6
7
|
getRunnable() {
|
|
7
|
-
return (0, combi_1.regex)(
|
|
8
|
+
return (0, combi_1.alt)(cds_name_1.CDSName, (0, combi_1.regex)(/^"[^"]*"$/));
|
|
8
9
|
}
|
|
9
10
|
}
|
|
10
11
|
exports.DDLName = DDLName;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DDLNamedInclude = void 0;
|
|
4
|
+
const combi_1 = require("../../abap/2_statements/combi");
|
|
5
|
+
const expressions_1 = require("../../cds/expressions");
|
|
6
|
+
const ddl_clauses_1 = require("./ddl_clauses");
|
|
7
|
+
const ddl_name_1 = require("./ddl_name");
|
|
8
|
+
class DDLNamedInclude extends combi_1.Expression {
|
|
9
|
+
getRunnable() {
|
|
10
|
+
const trailingClause = (0, combi_1.alt)(ddl_clauses_1.DDLForeignKey, ddl_clauses_1.DDLValueHelp);
|
|
11
|
+
return (0, combi_1.seq)((0, combi_1.star)(expressions_1.CDSAnnotation), (0, combi_1.optPrio)("KEY"), ddl_name_1.DDLName, ":", "INCLUDE", ddl_name_1.DDLName, (0, combi_1.optPrio)((0, combi_1.seq)("WITH", "SUFFIX", ddl_name_1.DDLName)), (0, combi_1.optPrio)("NOT NULL"), (0, combi_1.star)(trailingClause), ";");
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.DDLNamedInclude = DDLNamedInclude;
|
|
15
|
+
//# sourceMappingURL=ddl_named_include.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DDLQualifiedName = void 0;
|
|
4
|
+
const combi_1 = require("../../abap/2_statements/combi");
|
|
5
|
+
const ddl_name_1 = require("./ddl_name");
|
|
6
|
+
class DDLQualifiedName extends combi_1.Expression {
|
|
7
|
+
getRunnable() {
|
|
8
|
+
return (0, combi_1.seq)(ddl_name_1.DDLName, (0, combi_1.optPrio)((0, combi_1.seq)(".", ddl_name_1.DDLName)));
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.DDLQualifiedName = DDLQualifiedName;
|
|
12
|
+
//# sourceMappingURL=ddl_qualified_name.js.map
|
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DDLStructure = void 0;
|
|
4
4
|
const combi_1 = require("../../abap/2_statements/combi");
|
|
5
|
-
const
|
|
6
|
-
const ddl_name_1 = require("./ddl_name");
|
|
5
|
+
const expressions_1 = require("../../cds/expressions");
|
|
7
6
|
const ddl_include_1 = require("./ddl_include");
|
|
7
|
+
const ddl_name_1 = require("./ddl_name");
|
|
8
|
+
const ddl_named_include_1 = require("./ddl_named_include");
|
|
9
|
+
const ddl_structure_field_1 = require("./ddl_structure_field");
|
|
8
10
|
class DDLStructure extends combi_1.Expression {
|
|
9
11
|
getRunnable() {
|
|
10
|
-
|
|
12
|
+
const entry = (0, combi_1.altPrio)(ddl_named_include_1.DDLNamedInclude, ddl_include_1.DDLInclude, ddl_structure_field_1.DDLStructureField);
|
|
13
|
+
return (0, combi_1.seq)((0, combi_1.star)(expressions_1.CDSAnnotation), "DEFINE", "STRUCTURE", ddl_name_1.DDLName, "{", (0, combi_1.plusPrio)(entry), "}", (0, combi_1.optPrio)(";"));
|
|
11
14
|
}
|
|
12
15
|
}
|
|
13
16
|
exports.DDLStructure = DDLStructure;
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DDLStructureField = void 0;
|
|
4
4
|
const combi_1 = require("../../abap/2_statements/combi");
|
|
5
|
+
const expressions_1 = require("../../cds/expressions");
|
|
5
6
|
const ddl_name_1 = require("./ddl_name");
|
|
6
7
|
const ddl_type_1 = require("./ddl_type");
|
|
7
8
|
class DDLStructureField extends combi_1.Expression {
|
|
8
9
|
getRunnable() {
|
|
9
|
-
return (0, combi_1.seq)(ddl_name_1.DDLName, ":", ddl_type_1.DDLType, ";");
|
|
10
|
+
return (0, combi_1.seq)((0, combi_1.star)(expressions_1.CDSAnnotation), ddl_name_1.DDLName, ":", ddl_type_1.DDLType, (0, combi_1.optPrio)("NOT NULL"), ";");
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
exports.DDLStructureField = DDLStructureField;
|
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DDLTable = void 0;
|
|
4
4
|
const combi_1 = require("../../abap/2_statements/combi");
|
|
5
|
+
const expressions_1 = require("../../cds/expressions");
|
|
6
|
+
const ddl_extend_1 = require("./ddl_extend");
|
|
5
7
|
const ddl_include_1 = require("./ddl_include");
|
|
6
8
|
const ddl_name_1 = require("./ddl_name");
|
|
9
|
+
const ddl_named_include_1 = require("./ddl_named_include");
|
|
7
10
|
const ddl_table_field_1 = require("./ddl_table_field");
|
|
8
11
|
class DDLTable extends combi_1.Expression {
|
|
9
12
|
getRunnable() {
|
|
10
|
-
|
|
13
|
+
const entry = (0, combi_1.altPrio)(ddl_named_include_1.DDLNamedInclude, ddl_include_1.DDLInclude, ddl_table_field_1.DDLTableField, ddl_extend_1.DDLExtend);
|
|
14
|
+
return (0, combi_1.seq)((0, combi_1.star)(expressions_1.CDSAnnotation), "DEFINE", "TABLE", ddl_name_1.DDLName, "{", (0, combi_1.plusPrio)(entry), "}", (0, combi_1.optPrio)(";"));
|
|
11
15
|
}
|
|
12
16
|
}
|
|
13
17
|
exports.DDLTable = DDLTable;
|
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DDLTableField = void 0;
|
|
4
4
|
const combi_1 = require("../../abap/2_statements/combi");
|
|
5
|
+
const expressions_1 = require("../../cds/expressions");
|
|
6
|
+
const ddl_clauses_1 = require("./ddl_clauses");
|
|
5
7
|
const ddl_name_1 = require("./ddl_name");
|
|
6
8
|
const ddl_type_1 = require("./ddl_type");
|
|
7
9
|
class DDLTableField extends combi_1.Expression {
|
|
8
10
|
getRunnable() {
|
|
9
|
-
|
|
11
|
+
const trailingClause = (0, combi_1.alt)(ddl_clauses_1.DDLForeignKey, ddl_clauses_1.DDLValueHelp);
|
|
12
|
+
return (0, combi_1.seq)((0, combi_1.star)(expressions_1.CDSAnnotation), (0, combi_1.optPrio)("KEY"), ddl_name_1.DDLName, ":", ddl_type_1.DDLType, (0, combi_1.optPrio)("NOT NULL"), (0, combi_1.star)(trailingClause), ";");
|
|
10
13
|
}
|
|
11
14
|
}
|
|
12
15
|
exports.DDLTableField = DDLTableField;
|
|
@@ -2,9 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DDLType = void 0;
|
|
4
4
|
const combi_1 = require("../../abap/2_statements/combi");
|
|
5
|
+
const cds_integer_1 = require("../../cds/expressions/cds_integer");
|
|
6
|
+
const ddl_name_1 = require("./ddl_name");
|
|
5
7
|
class DDLType extends combi_1.Expression {
|
|
6
8
|
getRunnable() {
|
|
7
|
-
|
|
9
|
+
const decimals = (0, combi_1.seq)(",", cds_integer_1.CDSInteger);
|
|
10
|
+
const lenSpec = (0, combi_1.seq)("(", cds_integer_1.CDSInteger, (0, combi_1.optPrio)(decimals), ")");
|
|
11
|
+
const dotted = (0, combi_1.seq)(ddl_name_1.DDLName, ".", ddl_name_1.DDLName, (0, combi_1.optPrio)(lenSpec));
|
|
12
|
+
const plain = (0, combi_1.seq)(ddl_name_1.DDLName, (0, combi_1.optPrio)(lenSpec));
|
|
13
|
+
return (0, combi_1.altPrio)(dotted, plain);
|
|
8
14
|
}
|
|
9
15
|
}
|
|
10
16
|
exports.DDLType = DDLType;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DDLWhere = void 0;
|
|
4
|
+
const combi_1 = require("../../abap/2_statements/combi");
|
|
5
|
+
const ddl_qualified_name_1 = require("./ddl_qualified_name");
|
|
6
|
+
const ddl_literal_1 = require("./ddl_literal");
|
|
7
|
+
class DDLWhere extends combi_1.Expression {
|
|
8
|
+
getRunnable() {
|
|
9
|
+
const value = (0, combi_1.alt)(ddl_qualified_name_1.DDLQualifiedName, ddl_literal_1.DDLStringLiteral);
|
|
10
|
+
const condition = (0, combi_1.seq)(ddl_qualified_name_1.DDLQualifiedName, "=", value);
|
|
11
|
+
return (0, combi_1.seq)("WHERE", condition, (0, combi_1.star)((0, combi_1.seq)("AND", condition)));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.DDLWhere = DDLWhere;
|
|
15
|
+
//# sourceMappingURL=ddl_where.js.map
|
|
@@ -14,11 +14,19 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ddl_aspect"), exports);
|
|
18
|
+
__exportStar(require("./ddl_clauses"), exports);
|
|
19
|
+
__exportStar(require("./ddl_extend"), exports);
|
|
20
|
+
__exportStar(require("./ddl_extend_type"), exports);
|
|
17
21
|
__exportStar(require("./ddl_include"), exports);
|
|
22
|
+
__exportStar(require("./ddl_literal"), exports);
|
|
18
23
|
__exportStar(require("./ddl_name"), exports);
|
|
24
|
+
__exportStar(require("./ddl_named_include"), exports);
|
|
25
|
+
__exportStar(require("./ddl_qualified_name"), exports);
|
|
19
26
|
__exportStar(require("./ddl_structure_field"), exports);
|
|
20
27
|
__exportStar(require("./ddl_structure"), exports);
|
|
21
28
|
__exportStar(require("./ddl_table_field"), exports);
|
|
22
29
|
__exportStar(require("./ddl_table"), exports);
|
|
23
30
|
__exportStar(require("./ddl_type"), exports);
|
|
31
|
+
__exportStar(require("./ddl_where"), exports);
|
|
24
32
|
//# sourceMappingURL=index.js.map
|
package/build/src/index.js
CHANGED
|
@@ -33,8 +33,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.
|
|
37
|
-
exports.LSPEdit = exports.RuleTag = exports.Severity = exports.Visibility = exports.Info = exports.Diagnostics = exports.Rename = exports.PrettyPrinter = exports.Position = exports.CurrentScope = exports.RulesRunner = exports.SpaghettiScope = void 0;
|
|
36
|
+
exports.ABAPObject = exports.Tokens = exports.ExpressionsCDS = exports.CDSParser = exports.LanguageServerTypes = exports.DDLKind = exports.DDLParser = exports.AbstractFile = exports.ABAPFile = exports.MemoryFile = exports.Edits = exports.ReferenceType = exports.NativeSQL = exports.MacroContent = exports.MacroCall = exports.SpaghettiScopeNode = exports.Token = exports.ScopeType = exports.BasicTypes = exports.TypedIdentifier = exports.AbstractType = exports.VirtualPosition = exports.Comment = exports.Unknown = exports.Empty = exports.Identifier = exports.Nodes = exports.Types = exports.Expressions = exports.Statements = exports.Structures = exports.SkipLogic = exports.Objects = exports.ArtifactsRules = exports.ArtifactsObjects = exports.ArtifactsABAP = exports.BuiltIn = exports.FormLengthStats = exports.FunctionLengthStats = exports.MethodLengthStats = exports.LanguageServer = exports.Registry = exports.CyclomaticComplexityStats = exports.versionToABAPRelease = exports.releaseAtLeast = exports.Release = exports.LanguageVersion = exports.Version = exports.Config = exports.Issue = void 0;
|
|
37
|
+
exports.LSPEdit = exports.RuleTag = exports.Severity = exports.Visibility = exports.Info = exports.Diagnostics = exports.Rename = exports.PrettyPrinter = exports.Position = exports.CurrentScope = exports.RulesRunner = exports.SpaghettiScope = exports.SyntaxLogic = void 0;
|
|
38
38
|
const issue_1 = require("./issue");
|
|
39
39
|
Object.defineProperty(exports, "Issue", { enumerable: true, get: function () { return issue_1.Issue; } });
|
|
40
40
|
const config_1 = require("./config");
|
|
@@ -128,6 +128,7 @@ const severity_1 = require("./severity");
|
|
|
128
128
|
Object.defineProperty(exports, "Severity", { enumerable: true, get: function () { return severity_1.Severity; } });
|
|
129
129
|
const ddl_parser_1 = require("./ddl/ddl_parser");
|
|
130
130
|
Object.defineProperty(exports, "DDLParser", { enumerable: true, get: function () { return ddl_parser_1.DDLParser; } });
|
|
131
|
+
Object.defineProperty(exports, "DDLKind", { enumerable: true, get: function () { return ddl_parser_1.DDLKind; } });
|
|
131
132
|
const cds_parser_1 = require("./cds/cds_parser");
|
|
132
133
|
Object.defineProperty(exports, "CDSParser", { enumerable: true, get: function () { return cds_parser_1.CDSParser; } });
|
|
133
134
|
const rules_runner_1 = require("./rules_runner");
|
|
@@ -153,6 +153,13 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
|
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
|
+
if (found === undefined) {
|
|
157
|
+
// typed virtual element: VIRTUAL <name> : <type>
|
|
158
|
+
const names = e.findAllExpressions(expressions_1.CDSName);
|
|
159
|
+
if (e.findDirectTokenByText("VIRTUAL") !== undefined && names.length > 0) {
|
|
160
|
+
found = names[0];
|
|
161
|
+
}
|
|
162
|
+
}
|
|
156
163
|
if (found === undefined) {
|
|
157
164
|
continue;
|
|
158
165
|
}
|
package/build/src/registry.js
CHANGED