@abaplint/core 2.119.56 → 2.119.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/abaplint.d.ts +5 -0
- package/build/src/abap/2_statements/combi.js +24 -0
- package/build/src/abap/2_statements/expressions/component_chain_simple.js +2 -2
- package/build/src/abap/2_statements/expressions/parameter_list_s.js +1 -1
- package/build/src/abap/2_statements/expressions/type_table_key.js +2 -2
- package/build/src/abap/2_statements/expressions/value_body.js +1 -1
- package/build/src/abap/5_syntax/expressions/component_chain.js +9 -0
- package/build/src/cds/cds_lexer.js +25 -2
- package/build/src/cds/expressions/cds_as.js +3 -1
- package/build/src/cds/expressions/cds_association.js +2 -1
- package/build/src/cds/expressions/cds_define_hierarchy.js +2 -4
- package/build/src/cds/expressions/cds_define_table_entity.js +4 -4
- package/build/src/cds/expressions/cds_define_view.js +4 -2
- package/build/src/cds/expressions/cds_element.js +6 -2
- package/build/src/cds/expressions/cds_extend_view.js +3 -1
- package/build/src/cds/expressions/cds_parameters_select.js +3 -1
- package/build/src/cds/expressions/cds_prefixed_name.js +2 -2
- package/build/src/cds/expressions/cds_relation.js +1 -1
- package/build/src/cds/expressions/cds_select.js +4 -3
- package/build/src/cds/expressions/cds_source.js +1 -4
- package/build/src/cds/expressions/cds_string.js +2 -2
- package/build/src/cds/expressions/cds_table_field.js +19 -0
- package/build/src/cds/expressions/index.js +1 -0
- package/build/src/registry.js +1 -1
- package/package.json +1 -1
package/build/abaplint.d.ts
CHANGED
|
@@ -1046,6 +1046,10 @@ declare class CDSString extends Expression {
|
|
|
1046
1046
|
getRunnable(): IStatementRunnable;
|
|
1047
1047
|
}
|
|
1048
1048
|
|
|
1049
|
+
declare class CDSTableField extends Expression {
|
|
1050
|
+
getRunnable(): IStatementRunnable;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1049
1053
|
declare class CDSType extends AbstractObject {
|
|
1050
1054
|
getType(): string;
|
|
1051
1055
|
getAllowedNaming(): {
|
|
@@ -2771,6 +2775,7 @@ declare namespace ExpressionsCDS {
|
|
|
2771
2775
|
CDSSelect,
|
|
2772
2776
|
CDSSource,
|
|
2773
2777
|
CDSString,
|
|
2778
|
+
CDSTableField,
|
|
2774
2779
|
CDSType_2 as CDSType,
|
|
2775
2780
|
CDSWhere,
|
|
2776
2781
|
CDSWithParameters
|
|
@@ -53,6 +53,7 @@ exports.verNotLang = verNotLang;
|
|
|
53
53
|
exports.failCombinator = failCombinator;
|
|
54
54
|
exports.failStar = failStar;
|
|
55
55
|
exports.stopBefore = stopBefore;
|
|
56
|
+
exports.stopBefore1 = stopBefore1;
|
|
56
57
|
const Tokens = __importStar(require("../1_lexer/tokens"));
|
|
57
58
|
const nodes_1 = require("../nodes");
|
|
58
59
|
const version_1 = require("../../version");
|
|
@@ -1033,4 +1034,27 @@ class StopBefore2 {
|
|
|
1033
1034
|
function stopBefore(t1, t2) {
|
|
1034
1035
|
return new StopBefore2(t1, t2);
|
|
1035
1036
|
}
|
|
1037
|
+
class StopBefore1 {
|
|
1038
|
+
constructor(words) { this.words = words.map(w => w.toUpperCase()); }
|
|
1039
|
+
listKeywords() { return []; }
|
|
1040
|
+
getUsing() { return []; }
|
|
1041
|
+
run(r) {
|
|
1042
|
+
var _a;
|
|
1043
|
+
const result = [];
|
|
1044
|
+
for (const input of r) {
|
|
1045
|
+
const next = (_a = input.peek()) === null || _a === void 0 ? void 0 : _a.getUpperStr();
|
|
1046
|
+
if (next !== undefined && this.words.includes(next)) {
|
|
1047
|
+
continue;
|
|
1048
|
+
}
|
|
1049
|
+
result.push(input);
|
|
1050
|
+
}
|
|
1051
|
+
return result;
|
|
1052
|
+
}
|
|
1053
|
+
railroad() { return "Railroad.Terminal('stopBefore(" + this.words.join("|") + ")')"; }
|
|
1054
|
+
toStr() { return "stopBefore(" + this.words.join(",") + ")"; }
|
|
1055
|
+
first() { return [""]; }
|
|
1056
|
+
}
|
|
1057
|
+
function stopBefore1(...words) {
|
|
1058
|
+
return new StopBefore1(words);
|
|
1059
|
+
}
|
|
1036
1060
|
//# sourceMappingURL=combi.js.map
|
|
@@ -5,8 +5,8 @@ const combi_1 = require("../combi");
|
|
|
5
5
|
const _1 = require(".");
|
|
6
6
|
class ComponentChainSimple extends combi_1.Expression {
|
|
7
7
|
getRunnable() {
|
|
8
|
-
const chain = (0, combi_1.
|
|
9
|
-
const ret = (0, combi_1.seq)(chain, (0, combi_1.optPrio)(_1.FieldOffset), (0, combi_1.optPrio)(_1.FieldLength));
|
|
8
|
+
const chain = (0, combi_1.starPrio)((0, combi_1.altPrio)(_1.Dereference, (0, combi_1.seq)(_1.ArrowOrDash, _1.ComponentName)));
|
|
9
|
+
const ret = (0, combi_1.seq)(_1.ComponentName, chain, (0, combi_1.optPrio)(_1.FieldOffset), (0, combi_1.optPrio)(_1.FieldLength));
|
|
10
10
|
return ret;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -5,7 +5,7 @@ const combi_1 = require("../combi");
|
|
|
5
5
|
const _1 = require(".");
|
|
6
6
|
class ParameterListS extends combi_1.Expression {
|
|
7
7
|
getRunnable() {
|
|
8
|
-
return (0, combi_1.
|
|
8
|
+
return (0, combi_1.plusPrio)(_1.ParameterS);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
exports.ParameterListS = ParameterListS;
|
|
@@ -9,10 +9,10 @@ class TypeTableKey extends combi_1.Expression {
|
|
|
9
9
|
const uniqueness = (0, combi_1.alt)("NON-UNIQUE", "UNIQUE");
|
|
10
10
|
const defaultKey = "DEFAULT KEY";
|
|
11
11
|
const emptyKey = (0, combi_1.ver)(version_1.Release.v740sp02, "EMPTY KEY", { also: combi_1.AlsoIn.OpenABAP });
|
|
12
|
-
const components = (0, combi_1.
|
|
12
|
+
const components = (0, combi_1.plusPrio)((0, combi_1.seq)((0, combi_1.stopBefore1)("WITH", "INITIAL", "WITHOUT"), (0, combi_1.stopBefore)("READ", "-"), _1.FieldSub));
|
|
13
13
|
const further = (0, combi_1.seq)((0, combi_1.alt)("WITHOUT", "WITH"), "FURTHER SECONDARY KEYS");
|
|
14
14
|
const alias = (0, combi_1.seq)("ALIAS", _1.Field);
|
|
15
|
-
const key = (0, combi_1.seq)("WITH", (0, combi_1.
|
|
15
|
+
const key = (0, combi_1.seq)("WITH", (0, combi_1.optPrio)(uniqueness), (0, combi_1.altPrio)(defaultKey, emptyKey, (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.alt)("SORTED", "HASHED")), "KEY", (0, combi_1.altPrio)((0, combi_1.seq)(_1.Field, (0, combi_1.opt)(alias), "COMPONENTS", components), components))), (0, combi_1.optPrio)(further), (0, combi_1.optPrio)("READ-ONLY"));
|
|
16
16
|
return key;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -6,7 +6,7 @@ const _1 = require(".");
|
|
|
6
6
|
const version_1 = require("../../../version");
|
|
7
7
|
class ValueBody extends combi_1.Expression {
|
|
8
8
|
getRunnable() {
|
|
9
|
-
const strucOrTab = (0, combi_1.seq)((0, combi_1.optPrio)(_1.Let), (0, combi_1.optPrio)(_1.ValueBase), (0, combi_1.
|
|
9
|
+
const strucOrTab = (0, combi_1.seq)((0, combi_1.optPrio)(_1.Let), (0, combi_1.optPrio)(_1.ValueBase), (0, combi_1.starPrio)(_1.For), (0, combi_1.plusPrio)((0, combi_1.altPrio)(_1.FieldAssignment, _1.ValueBodyLine)));
|
|
10
10
|
const tabdef = (0, combi_1.ver)(version_1.Release.v740sp08, (0, combi_1.altPrio)("OPTIONAL", (0, combi_1.seq)("DEFAULT", _1.Source)), { also: combi_1.AlsoIn.OpenABAP });
|
|
11
11
|
return (0, combi_1.optPrio)((0, combi_1.altPrio)(strucOrTab, (0, combi_1.seq)(_1.Source, (0, combi_1.optPrio)(tabdef))));
|
|
12
12
|
}
|
|
@@ -56,6 +56,15 @@ class ComponentChain {
|
|
|
56
56
|
if (i === 0 && child.concatTokens().toUpperCase() === "TABLE_LINE") {
|
|
57
57
|
continue;
|
|
58
58
|
}
|
|
59
|
+
else if (child.get() instanceof Expressions.Dereference) {
|
|
60
|
+
if (!(context instanceof basic_1.DataReference)) {
|
|
61
|
+
const message = "Not a data reference, cannot be dereferenced";
|
|
62
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, child.getFirstToken(), message));
|
|
63
|
+
return void_type_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
64
|
+
}
|
|
65
|
+
context = context.getType();
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
59
68
|
else if (child.get() instanceof Expressions.ArrowOrDash) {
|
|
60
69
|
const concat = child.concatTokens();
|
|
61
70
|
if (concat === "-") {
|
|
@@ -26,8 +26,9 @@ var Mode;
|
|
|
26
26
|
(function (Mode) {
|
|
27
27
|
Mode[Mode["Default"] = 0] = "Default";
|
|
28
28
|
Mode[Mode["String"] = 1] = "String";
|
|
29
|
-
Mode[Mode["
|
|
30
|
-
Mode[Mode["
|
|
29
|
+
Mode[Mode["DoubleQuoteString"] = 2] = "DoubleQuoteString";
|
|
30
|
+
Mode[Mode["SingleLineComment"] = 3] = "SingleLineComment";
|
|
31
|
+
Mode[Mode["MultiLineComment"] = 4] = "MultiLineComment";
|
|
31
32
|
})(Mode || (Mode = {}));
|
|
32
33
|
class Result {
|
|
33
34
|
constructor() {
|
|
@@ -87,6 +88,23 @@ class CDSLexer {
|
|
|
87
88
|
}
|
|
88
89
|
continue;
|
|
89
90
|
}
|
|
91
|
+
// double-quote string handling
|
|
92
|
+
if (mode === Mode.DoubleQuoteString) {
|
|
93
|
+
build += next;
|
|
94
|
+
if (next === "\\" && nextNext === "\"") {
|
|
95
|
+
build += stream.takeNext();
|
|
96
|
+
col++;
|
|
97
|
+
}
|
|
98
|
+
else if (next === "\"" && nextNext === "\"") {
|
|
99
|
+
build += stream.takeNext();
|
|
100
|
+
col++;
|
|
101
|
+
}
|
|
102
|
+
else if (next === "\"") {
|
|
103
|
+
build = result.add(build, row, col, mode);
|
|
104
|
+
mode = Mode.Default;
|
|
105
|
+
}
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
90
108
|
// single line comment handling
|
|
91
109
|
if (mode === Mode.SingleLineComment) {
|
|
92
110
|
if (next === "\n") {
|
|
@@ -133,6 +151,11 @@ class CDSLexer {
|
|
|
133
151
|
mode = Mode.String;
|
|
134
152
|
build += next;
|
|
135
153
|
break;
|
|
154
|
+
case "\"":
|
|
155
|
+
build = result.add(build, row, col, mode);
|
|
156
|
+
mode = Mode.DoubleQuoteString;
|
|
157
|
+
build += next;
|
|
158
|
+
break;
|
|
136
159
|
case " ":
|
|
137
160
|
case "\t":
|
|
138
161
|
build = result.add(build, row, col, mode);
|
|
@@ -7,7 +7,9 @@ class CDSAs extends combi_1.Expression {
|
|
|
7
7
|
getRunnable() {
|
|
8
8
|
const redirected = (0, combi_1.seq)(": REDIRECTED TO", (0, combi_1.optPrio)((0, combi_1.altPrio)("PARENT", "COMPOSITION CHILD")), _1.CDSName);
|
|
9
9
|
const colonType = (0, combi_1.seq)(":", (0, combi_1.altPrio)(_1.CDSType, _1.CDSName, "LOCALIZED"));
|
|
10
|
-
|
|
10
|
+
const ident = (0, combi_1.regex)(/^\w+$/);
|
|
11
|
+
const namespacedAlias = (0, combi_1.seq)(ident, "/", ident, "/", ident);
|
|
12
|
+
return (0, combi_1.seq)("AS", (0, combi_1.altPrio)(namespacedAlias, _1.CDSName), (0, combi_1.optPrio)((0, combi_1.altPrio)(redirected, colonType)));
|
|
11
13
|
}
|
|
12
14
|
}
|
|
13
15
|
exports.CDSAs = CDSAs;
|
|
@@ -17,8 +17,9 @@ class CDSAssociation extends combi_1.Expression {
|
|
|
17
17
|
// Numeric OF form: "association of [0..1] to Target on ..."
|
|
18
18
|
const ofNumericForm = (0, combi_1.seq)("ASSOCIATION", "OF", numericCardinality, "TO", _1.CDSRelation, "ON", _1.CDSCondition);
|
|
19
19
|
// "association [0..1] to Target as _Alias on condition" — standard form
|
|
20
|
+
const parentForm = (0, combi_1.seq)("ASSOCIATION", "TO", "PARENT", _1.CDSRelation);
|
|
20
21
|
const standardForm = (0, combi_1.seq)("ASSOCIATION", (0, combi_1.optPrio)(cds_cardinality_1.CDSCardinality), "TO", (0, combi_1.opt)((0, combi_1.altPrio)(textCardinality, "PARENT")), _1.CDSRelation, "ON", _1.CDSCondition, (0, combi_1.opt)((0, combi_1.seq)("WITH", "DEFAULT", "FILTER", _1.CDSCondition)));
|
|
21
|
-
return (0, combi_1.altPrio)(ofTextForm, ofNumericForm, standardForm);
|
|
22
|
+
return (0, combi_1.altPrio)(ofTextForm, ofNumericForm, standardForm, parentForm);
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
exports.CDSAssociation = CDSAssociation;
|
|
@@ -12,11 +12,9 @@ class CDSDefineHierarchy extends combi_1.Expression {
|
|
|
12
12
|
const directory = (0, combi_1.seq)("DIRECTORY", _1.CDSName, "FILTER", "BY", _1.CDSCondition);
|
|
13
13
|
// DATE PERIOD: period from <field> to <field> [valid from :p to :p]
|
|
14
14
|
const datePeriod = (0, combi_1.seq)("PERIOD", "FROM", _1.CDSName, "TO", _1.CDSName, (0, combi_1.opt)((0, combi_1.seq)("VALID", "FROM", _1.CDSPrefixedName, "TO", _1.CDSPrefixedName)));
|
|
15
|
-
|
|
16
|
-
const depthValue = (0, combi_1.altPrio)(_1.CDSInteger, _1.CDSPrefixedName);
|
|
17
|
-
// LOAD mode: BULK, INCREMENTAL, or a parameter reference ($parameters.p_load)
|
|
15
|
+
const depthValue = (0, combi_1.altPrio)(_1.CDSString, _1.CDSInteger, _1.CDSPrefixedName);
|
|
18
16
|
const loadMode = (0, combi_1.altPrio)("BULK", "INCREMENTAL", _1.CDSPrefixedName);
|
|
19
|
-
const hierarchyBody = (0, combi_1.seq)("SOURCE", _1.CDSName, (0, combi_1.opt)(_1.CDSParametersSelect), "CHILD", "TO", "PARENT", "ASSOCIATION", _1.CDSName, (0, combi_1.opt)(directory), (0, combi_1.opt)(datePeriod), (0, combi_1.opt)((0, combi_1.seq)("START", "WHERE", _1.CDSCondition)), (0, combi_1.opt)(siblingsOrder), (0, combi_1.opt)((0, combi_1.seq)("LOAD", loadMode)), (0, combi_1.opt)((0, combi_1.seq)("
|
|
17
|
+
const hierarchyBody = (0, combi_1.seq)("SOURCE", _1.CDSName, (0, combi_1.opt)(_1.CDSParametersSelect), "CHILD", "TO", "PARENT", "ASSOCIATION", _1.CDSName, (0, combi_1.opt)(directory), (0, combi_1.opt)(datePeriod), (0, combi_1.opt)((0, combi_1.seq)("START", "WHERE", _1.CDSCondition)), (0, combi_1.opt)(siblingsOrder), (0, combi_1.opt)((0, combi_1.seq)("LOAD", loadMode)), (0, combi_1.opt)((0, combi_1.seq)("DEPTH", depthValue)), (0, combi_1.opt)((0, combi_1.seq)("NODETYPE", _1.CDSName)), (0, combi_1.opt)((0, combi_1.seq)("MULTIPLE", "PARENTS", (0, combi_1.altPrio)("NOT ALLOWED", "ALLOWED", (0, combi_1.seq)("LEAVES", (0, combi_1.optPrio)("ONLY"))))), (0, combi_1.opt)((0, combi_1.seq)("ORPHANS", (0, combi_1.altPrio)("IGNORE", "ROOT", "ERROR"))), (0, combi_1.opt)((0, combi_1.seq)("CYCLES", (0, combi_1.altPrio)("BREAKUP", "ERROR"))), (0, combi_1.opt)((0, combi_1.seq)("GENERATE", "SPANTREE")), (0, combi_1.opt)((0, combi_1.seq)("CACHE", (0, combi_1.altPrio)("ON", "OFF", "FORCE"))));
|
|
20
18
|
return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), "DEFINE", "HIERARCHY", _1.CDSName, (0, combi_1.opt)(_1.CDSWithParameters), "AS", "PARENT", "CHILD", "HIERARCHY", "(", hierarchyBody, ")", "{", (0, combi_1.seq)(field, (0, combi_1.star)((0, combi_1.seq)(",", field))), "}", (0, combi_1.opt)(";"));
|
|
21
19
|
}
|
|
22
20
|
}
|
|
@@ -5,10 +5,10 @@ const _1 = require(".");
|
|
|
5
5
|
const combi_1 = require("../../abap/2_statements/combi");
|
|
6
6
|
class CDSDefineTableEntity extends combi_1.Expression {
|
|
7
7
|
getRunnable() {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const inlineBody = (0, combi_1.plus)(
|
|
8
|
+
// Inline `{ ... }` body: one or more table-field entries. Each entry is
|
|
9
|
+
// wrapped in a CDSTableField node so downstream tooling can pair each
|
|
10
|
+
// field name with its own annotations.
|
|
11
|
+
const inlineBody = (0, combi_1.plus)(_1.CDSTableField);
|
|
12
12
|
const elementList = (0, combi_1.seq)(_1.CDSElement, (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.opt)(","));
|
|
13
13
|
const elements = (0, combi_1.seq)((0, combi_1.str)("{"), (0, combi_1.altPrio)("*", elementList), (0, combi_1.str)("}"));
|
|
14
14
|
const selectBody = (0, combi_1.seq)("AS", "SELECT", "FROM", _1.CDSSource, (0, combi_1.star)(_1.CDSJoin), (0, combi_1.star)((0, combi_1.altPrio)(_1.CDSComposition, _1.CDSAssociation)), (0, combi_1.opt)(elements), (0, combi_1.optPrio)(_1.CDSWhere));
|
|
@@ -10,8 +10,10 @@ const cds_with_parameters_1 = require("./cds_with_parameters");
|
|
|
10
10
|
class CDSDefineView extends combi_1.Expression {
|
|
11
11
|
getRunnable() {
|
|
12
12
|
const columnAlias = (0, combi_1.seq)("(", cds_name_1.CDSName, (0, combi_1.star)((0, combi_1.seq)(",", cds_name_1.CDSName)), ")");
|
|
13
|
-
|
|
14
|
-
(0, combi_1.
|
|
13
|
+
const parenSelect = (0, combi_1.seq)("(", cds_select_1.CDSSelect, ")");
|
|
14
|
+
const unionBranch = (0, combi_1.altPrio)(parenSelect, cds_select_1.CDSSelect);
|
|
15
|
+
const topLevelSelect = (0, combi_1.altPrio)((0, combi_1.seq)(parenSelect, (0, combi_1.star)((0, combi_1.altPrio)((0, combi_1.seq)("UNION", (0, combi_1.opt)("ALL"), unionBranch), (0, combi_1.seq)("EXCEPT", unionBranch), (0, combi_1.seq)("INTERSECT", unionBranch)))), cds_select_1.CDSSelect);
|
|
16
|
+
return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.opt)("DEFINE"), (0, combi_1.opt)("ROOT"), (0, combi_1.opt)("WRITABLE"), "VIEW", (0, combi_1.ver)(__1.Release.v755, (0, combi_1.opt)("ENTITY")), cds_name_1.CDSName, (0, combi_1.opt)(columnAlias), (0, combi_1.opt)(cds_with_parameters_1.CDSWithParameters), "AS", topLevelSelect, (0, combi_1.opt)((0, combi_1.seq)("WITH", "HIERARCHY", cds_name_1.CDSName)), (0, combi_1.opt)(";"));
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
19
|
exports.CDSDefineView = CDSDefineView;
|
|
@@ -10,9 +10,13 @@ class CDSElement extends combi_1.Expression {
|
|
|
10
10
|
const redirected = (0, combi_1.seq)(": REDIRECTED TO", (0, combi_1.optPrio)((0, combi_1.altPrio)("PARENT", "COMPOSITION CHILD")), _1.CDSName);
|
|
11
11
|
const colonThing = (0, combi_1.seq)(":", (0, combi_1.altPrio)(_1.CDSType, _1.CDSName, "LOCALIZED"));
|
|
12
12
|
const extensionWildcard = (0, combi_1.seq)("$extension", ".", "*");
|
|
13
|
-
const
|
|
13
|
+
const excludingNames = (0, combi_1.seq)(_1.CDSName, (0, combi_1.starPrio)((0, combi_1.seq)(",", _1.CDSName)));
|
|
14
|
+
const excluding = (0, combi_1.seq)("EXCLUDING", "{", excludingNames, "}");
|
|
15
|
+
const includeElement = (0, combi_1.seq)("INCLUDE", _1.CDSPrefixedName, (0, combi_1.optPrio)(excluding), (0, combi_1.optPrio)("SIGNATURE ONLY"));
|
|
14
16
|
const typedVirtual = (0, combi_1.seq)("VIRTUAL", _1.CDSName, ":", _1.CDSType);
|
|
15
|
-
const
|
|
17
|
+
const pathSegment = (0, combi_1.seq)(".", (0, combi_1.altPrio)(_1.CDSString, _1.CDSName, "*"), (0, combi_1.optPrio)((0, combi_1.altPrio)(_1.CDSParametersSelect, _1.CDSParameters)));
|
|
18
|
+
const funcWithPath = (0, combi_1.seq)(_1.CDSFunction, (0, combi_1.plusPrio)(pathSegment));
|
|
19
|
+
const body = (0, combi_1.altPrio)(extensionWildcard, includeElement, _1.CDSArithmetics, _1.CDSAggregate, _1.CDSString, _1.CDSArithParen, funcWithPath, _1.CDSFunction, cds_cast_1.CDSCast, _1.CDSCase, (0, combi_1.seq)("(", _1.CDSCase, ")"), (0, combi_1.seq)(_1.CDSPrefixedName, (0, combi_1.optPrio)(cds_as_1.CDSAs), (0, combi_1.optPrio)((0, combi_1.altPrio)(redirected, colonThing))), _1.CDSInteger);
|
|
16
20
|
const elementBody = (0, combi_1.altPrio)(typedVirtual, (0, combi_1.seq)((0, combi_1.altPrio)("KEY", "VIRTUAL"), body), body);
|
|
17
21
|
return (0, combi_1.seq)((0, combi_1.starPrio)(_1.CDSAnnotation), elementBody, (0, combi_1.optPrio)(cds_as_1.CDSAs));
|
|
18
22
|
}
|
|
@@ -8,7 +8,9 @@ class CDSExtendView extends combi_1.Expression {
|
|
|
8
8
|
const namedot = (0, combi_1.seq)(_1.CDSName, (0, combi_1.optPrio)((0, combi_1.seq)(".", _1.CDSName)), (0, combi_1.optPrio)(_1.CDSAs));
|
|
9
9
|
const valueNested = (0, combi_1.seq)("{", namedot, (0, combi_1.star)((0, combi_1.seq)(",", namedot)), "}");
|
|
10
10
|
const redefineAssoc = (0, combi_1.seq)("REDEFINE", "ASSOCIATION", _1.CDSPrefixedName, (0, combi_1.optPrio)((0, combi_1.seq)("[", _1.CDSCondition, "]")), (0, combi_1.opt)(_1.CDSAs), "REDIRECTED", "TO", (0, combi_1.optPrio)((0, combi_1.altPrio)((0, combi_1.seq)("COMPOSITION", "CHILD"), "PARENT")), _1.CDSName);
|
|
11
|
-
const
|
|
11
|
+
const elementList = (0, combi_1.seq)(_1.CDSElement, (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.opt)(","));
|
|
12
|
+
const elementNested = (0, combi_1.seq)("{", (0, combi_1.altPrio)("*", elementList), "}");
|
|
13
|
+
const extendView = (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.str)("EXTEND VIEW"), (0, combi_1.opt)((0, combi_1.str)("ENTITY")), _1.CDSName, (0, combi_1.str)("WITH"), (0, combi_1.opt)(_1.CDSName), (0, combi_1.star)(redefineAssoc), (0, combi_1.star)(_1.CDSAssociation), (0, combi_1.altPrio)(elementNested, valueNested), (0, combi_1.opt)(";"));
|
|
12
14
|
const field = (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.optPrio)((0, combi_1.str)("KEY")), _1.CDSName, ":", _1.CDSType, ";");
|
|
13
15
|
const assocOrComp = (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), _1.CDSName, ":", (0, combi_1.alt)(_1.CDSComposition, _1.CDSAssociation), ";");
|
|
14
16
|
const entityBody = (0, combi_1.seq)("{", (0, combi_1.plus)((0, combi_1.alt)(field, assocOrComp)), "}");
|
|
@@ -7,7 +7,9 @@ class CDSParametersSelect extends combi_1.Expression {
|
|
|
7
7
|
getRunnable() {
|
|
8
8
|
const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.opt)((0, combi_1.seq)(".", _1.CDSName)));
|
|
9
9
|
const value = (0, combi_1.alt)(_1.CDSInteger, name, _1.CDSString);
|
|
10
|
-
const
|
|
10
|
+
const colonPair = (0, combi_1.seq)(name, ":", value, (0, combi_1.optPrio)("DEFAULT"));
|
|
11
|
+
const arrowPair = (0, combi_1.seq)(name, "=", ">", value);
|
|
12
|
+
const nameValue = (0, combi_1.altPrio)(colonPair, arrowPair);
|
|
11
13
|
return (0, combi_1.seq)("(", nameValue, (0, combi_1.star)((0, combi_1.seq)(",", nameValue)), ")");
|
|
12
14
|
}
|
|
13
15
|
}
|
|
@@ -16,13 +16,13 @@ class CDSPrefixedName extends combi_1.Expression {
|
|
|
16
16
|
const cardinalityJoin = (0, combi_1.seq)("[", cardSpec, ":", joinType, "]");
|
|
17
17
|
const cardinalityJoinWhere = (0, combi_1.seq)("[", cardSpec, ":", joinType, "WHERE", cds_condition_1.CDSCondition, "]");
|
|
18
18
|
const joinWhere = (0, combi_1.seq)("[", joinType, "WHERE", cds_condition_1.CDSCondition, "]");
|
|
19
|
-
const textCard = (0, combi_1.altPrio)("TO EXACT ONE", "TO ONE", "TO MANY");
|
|
19
|
+
const textCard = (0, combi_1.altPrio)("MANY TO EXACT ONE", "MANY TO ONE", "ONE TO MANY", "ONE TO ONE", "TO EXACT ONE", "TO ONE", "TO MANY");
|
|
20
20
|
const textCardFilter = (0, combi_1.seq)("[", textCard, (0, combi_1.optPrio)((0, combi_1.seq)(":", (0, combi_1.altPrio)((0, combi_1.seq)(joinType, "WHERE", cds_condition_1.CDSCondition), joinType, cds_condition_1.CDSCondition))), "]");
|
|
21
21
|
const cardNum = (0, combi_1.altPrio)(cds_integer_1.CDSInteger, "*");
|
|
22
22
|
const rangeCard = (0, combi_1.seq)(cds_integer_1.CDSInteger, ".", ".", cardNum);
|
|
23
23
|
const rangeCardFilter = (0, combi_1.seq)("[", rangeCard, ":", cds_condition_1.CDSCondition, "]");
|
|
24
24
|
const pathFilter = (0, combi_1.altPrio)(cardinalityJoinWhere, joinWhere, cardinalityJoin, joinRedirect, textCardFilter, rangeCardFilter, (0, combi_1.seq)("[", cardSpec, ":", cds_condition_1.CDSCondition, "]"), (0, combi_1.seq)("[", cds_condition_1.CDSCondition, "]"));
|
|
25
|
-
const segment = (0, combi_1.seq)(".", (0, combi_1.altPrio)(cds_string_1.CDSString, cds_name_1.CDSName), (0, combi_1.optPrio)((0, combi_1.altPrio)(cds_parameters_select_1.CDSParametersSelect, cds_parameters_1.CDSParameters)), (0, combi_1.optPrio)(pathFilter));
|
|
25
|
+
const segment = (0, combi_1.seq)(".", (0, combi_1.altPrio)(cds_string_1.CDSString, cds_name_1.CDSName, "*"), (0, combi_1.optPrio)((0, combi_1.altPrio)(cds_parameters_select_1.CDSParametersSelect, cds_parameters_1.CDSParameters)), (0, combi_1.optPrio)(pathFilter));
|
|
26
26
|
return (0, combi_1.seq)(cds_name_1.CDSName, (0, combi_1.optPrio)((0, combi_1.altPrio)(cds_parameters_1.CDSParameters, cds_parameters_select_1.CDSParametersSelect)), (0, combi_1.optPrio)(pathFilter), (0, combi_1.star)(segment));
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -6,7 +6,7 @@ const combi_1 = require("../../abap/2_statements/combi");
|
|
|
6
6
|
class CDSRelation extends combi_1.Expression {
|
|
7
7
|
getRunnable() {
|
|
8
8
|
const pre = (0, combi_1.seq)("/", (0, combi_1.regex)(/^[\w_]+$/), "/");
|
|
9
|
-
return (0, combi_1.seq)((0, combi_1.opt)(pre), (0, combi_1.regex)(/^[\w_]+$/), (0, combi_1.opt)(_1.CDSAs));
|
|
9
|
+
return (0, combi_1.seq)((0, combi_1.opt)(pre), (0, combi_1.regex)(/^[\w_]+$/), (0, combi_1.opt)(_1.CDSParametersSelect), (0, combi_1.opt)(_1.CDSAs));
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
exports.CDSRelation = CDSRelation;
|
|
@@ -11,11 +11,12 @@ class CDSSelect extends combi_1.Expression {
|
|
|
11
11
|
const distinct = (0, combi_1.str)("DISTINCT");
|
|
12
12
|
const elementList = (0, combi_1.seq)(_1.CDSElement, (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.opt)(","));
|
|
13
13
|
const elements = (0, combi_1.seq)((0, combi_1.str)("{"), (0, combi_1.altPrio)("*", elementList), (0, combi_1.str)("}"));
|
|
14
|
-
const
|
|
15
|
-
const
|
|
14
|
+
const aspectValue = (0, combi_1.altPrio)(_1.CDSString, _1.CDSPrefixedName);
|
|
15
|
+
const aspectBinding = (0, combi_1.seq)(_1.CDSPrefixedName, "=", ">", aspectValue);
|
|
16
|
+
const bindAspect = (0, combi_1.seq)("BIND", "ASPECT", _1.CDSName, "(", aspectBinding, (0, combi_1.starPrio)((0, combi_1.seq)(",", aspectBinding)), ")", (0, combi_1.optPrio)((0, combi_1.seq)("AS", _1.CDSName)));
|
|
16
17
|
const parenSelect = (0, combi_1.seq)("(", CDSSelect, ")");
|
|
17
18
|
const unionBranch = (0, combi_1.altPrio)(parenSelect, CDSSelect);
|
|
18
|
-
return (0, combi_1.seq)("SELECT", (0, combi_1.optPrio)(distinct), (0, combi_1.opt)((0, combi_1.altPrio)("*", fields)), "FROM", _1.CDSSource, (0, combi_1.star)(cds_join_1.CDSJoin), (0, combi_1.star)((0, combi_1.altPrio)(_1.CDSComposition, cds_association_1.CDSAssociation)), (0, combi_1.
|
|
19
|
+
return (0, combi_1.seq)("SELECT", (0, combi_1.optPrio)(distinct), (0, combi_1.opt)((0, combi_1.altPrio)("*", fields)), "FROM", _1.CDSSource, (0, combi_1.star)(cds_join_1.CDSJoin), (0, combi_1.star)((0, combi_1.altPrio)(_1.CDSComposition, cds_association_1.CDSAssociation)), (0, combi_1.starPrio)(bindAspect), (0, combi_1.opt)(elements), (0, combi_1.optPrio)(_1.CDSWhere), (0, combi_1.optPrio)(_1.CDSGroupBy), (0, combi_1.optPrio)(_1.CDSHaving), (0, combi_1.optPrio)((0, combi_1.altPrio)((0, combi_1.seq)("UNION", (0, combi_1.optPrio)("ALL"), unionBranch), (0, combi_1.seq)("EXCEPT", unionBranch), (0, combi_1.seq)("INTERSECT", unionBranch))));
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
exports.CDSSelect = CDSSelect;
|
|
@@ -6,10 +6,7 @@ const combi_1 = require("../../abap/2_statements/combi");
|
|
|
6
6
|
class CDSSource extends combi_1.Expression {
|
|
7
7
|
getRunnable() {
|
|
8
8
|
const staticFilter = (0, combi_1.seq)("[", _1.CDSCondition, "]");
|
|
9
|
-
|
|
10
|
-
const dottedName = (0, combi_1.seq)(_1.CDSName, ".", _1.CDSName);
|
|
11
|
-
const namedSource = (0, combi_1.altPrio)(dottedName, _1.CDSName);
|
|
12
|
-
const singleSource = (0, combi_1.seq)(namedSource, (0, combi_1.optPrio)(_1.CDSParametersSelect), (0, combi_1.optPrio)(staticFilter), (0, combi_1.opt)((0, combi_1.altPrio)(_1.CDSAs, _1.CDSName)));
|
|
9
|
+
const singleSource = (0, combi_1.seq)(_1.CDSPrefixedName, (0, combi_1.optPrio)(_1.CDSParametersSelect), (0, combi_1.optPrio)(staticFilter), (0, combi_1.opt)((0, combi_1.altPrio)(_1.CDSAs, _1.CDSName)));
|
|
13
10
|
const funcSingleSource = (0, combi_1.seq)(_1.CDSFunction, (0, combi_1.opt)((0, combi_1.altPrio)(_1.CDSAs, _1.CDSName)));
|
|
14
11
|
const parenSource = (0, combi_1.seq)("(", (0, combi_1.altPrio)(CDSSource, singleSource), (0, combi_1.star)(_1.CDSJoin), ")");
|
|
15
12
|
return (0, combi_1.altPrio)(parenSource, funcSingleSource, singleSource);
|
|
@@ -4,8 +4,8 @@ exports.CDSString = void 0;
|
|
|
4
4
|
const combi_1 = require("../../abap/2_statements/combi");
|
|
5
5
|
class CDSString extends combi_1.Expression {
|
|
6
6
|
getRunnable() {
|
|
7
|
-
const reg = (0, combi_1.regex)(/^'(?:[^'\\]|''|\\'|\\\\|\\(?!'))*'$/);
|
|
8
|
-
const abapTypeName = (0, combi_1.regex)(/^(?:int[1-9]|int8|sstring|char|numc|dats|datn|tims|timn|utcl|utclong|fltp|decfloat\d+|dec|string|rawstring|rstr|raw|xstring|clnt|lang|unit|cuky|curr|quan|geom_ewkb|d34n|d16n|d34d|d16d|d34s|d16s|d34r|d16r|d|t|p|n|c|x|f)$/i);
|
|
7
|
+
const reg = (0, combi_1.regex)(/^(?:'(?:[^'\\]|''|\\'|\\\\|\\(?!'))*'|"(?:[^"\\]|""|\\"|\\\\|\\(?!"))*")$/);
|
|
8
|
+
const abapTypeName = (0, combi_1.regex)(/^(?:int[1-9]|int8|sstring|sstr|char|numc|dats|datn|tims|timn|utcl|utclong|fltp|decfloat\d+|dec|string|rawstring|rstr|raw|xstring|clnt|lang|unit|cuky|curr|quan|geom_ewkb|d34n|d16n|d34d|d16d|d34s|d16s|d34r|d16r|d|t|p|n|c|x|f)$/i);
|
|
9
9
|
const abap = (0, combi_1.seq)("abap", ".", abapTypeName, (0, combi_1.optPrio)((0, combi_1.seq)("(", (0, combi_1.regex)(/^\d+$/), ")")), reg);
|
|
10
10
|
return (0, combi_1.altPrio)(abap, reg);
|
|
11
11
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CDSTableField = void 0;
|
|
4
|
+
const _1 = require(".");
|
|
5
|
+
const combi_1 = require("../../abap/2_statements/combi");
|
|
6
|
+
// A single field or association/composition inside a `define table entity { ... }`
|
|
7
|
+
// inline body. Wraps annotations + name + type together so tooling can iterate
|
|
8
|
+
// per-field with associated field-level annotations (matches the CDSElement
|
|
9
|
+
// shape used for select-list elements).
|
|
10
|
+
class CDSTableField extends combi_1.Expression {
|
|
11
|
+
getRunnable() {
|
|
12
|
+
const nullability = (0, combi_1.optPrio)((0, combi_1.alt)("NOT NULL", "NULL"));
|
|
13
|
+
const field = (0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.str)("KEY")), _1.CDSName, ":", _1.CDSType, nullability);
|
|
14
|
+
const assocOrComp = (0, combi_1.seq)(_1.CDSName, ":", (0, combi_1.alt)(_1.CDSComposition, _1.CDSAssociation));
|
|
15
|
+
return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.alt)(field, assocOrComp), ";");
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.CDSTableField = CDSTableField;
|
|
19
|
+
//# sourceMappingURL=cds_table_field.js.map
|
|
@@ -54,6 +54,7 @@ __exportStar(require("./cds_relation"), exports);
|
|
|
54
54
|
__exportStar(require("./cds_select"), exports);
|
|
55
55
|
__exportStar(require("./cds_source"), exports);
|
|
56
56
|
__exportStar(require("./cds_string"), exports);
|
|
57
|
+
__exportStar(require("./cds_table_field"), exports);
|
|
57
58
|
__exportStar(require("./cds_type"), exports);
|
|
58
59
|
__exportStar(require("./cds_where"), exports);
|
|
59
60
|
__exportStar(require("./cds_with_parameters"), exports);
|
package/build/src/registry.js
CHANGED