@abaplint/core 2.83.3 → 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.
- package/build/src/cds/cds_parser.js +4 -1
- package/build/src/cds/expressions/cds_annotation.js +4 -3
- package/build/src/cds/expressions/cds_association.js +2 -2
- package/build/src/cds/expressions/cds_define_abstract.js +14 -0
- package/build/src/cds/expressions/cds_element.js +1 -1
- package/build/src/cds/expressions/cds_string.js +11 -0
- package/build/src/cds/expressions/cds_where.js +1 -2
- package/build/src/cds/expressions/index.js +2 -0
- package/build/src/registry.js +1 -1
- package/package.json +1 -1
|
@@ -14,7 +14,10 @@ class CDSParser {
|
|
|
14
14
|
}
|
|
15
15
|
const tokens = cds_lexer_1.CDSLexer.run(file);
|
|
16
16
|
// console.dir(tokens);
|
|
17
|
-
|
|
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
|
+
}
|
|
18
21
|
if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {
|
|
19
22
|
return undefined;
|
|
20
23
|
}
|
|
@@ -6,9 +6,10 @@ const combi_1 = require("../../abap/2_statements/combi");
|
|
|
6
6
|
class CDSAnnotation extends combi_1.Expression {
|
|
7
7
|
getRunnable() {
|
|
8
8
|
// todo: add all the known annotations
|
|
9
|
-
const value = (0, combi_1.alt)(
|
|
10
|
-
const
|
|
11
|
-
const valueNested = (0, combi_1.seq)("{",
|
|
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))), "]");
|
|
12
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)));
|
|
13
14
|
}
|
|
14
15
|
}
|
|
@@ -5,10 +5,10 @@ const _1 = require(".");
|
|
|
5
5
|
const combi_1 = require("../../abap/2_statements/combi");
|
|
6
6
|
class CDSAssociation extends combi_1.Expression {
|
|
7
7
|
getRunnable() {
|
|
8
|
-
const cardinality = (0, combi_1.seq)("[", (0, combi_1.alt)("0", "1"), ".", ".", (0, combi_1.alt)("0", "1", "*"), "]");
|
|
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
9
|
const as = (0, combi_1.seq)("AS", _1.CDSName);
|
|
10
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, "=", name);
|
|
11
|
+
const cond = (0, combi_1.seq)(name, "=", (0, combi_1.alt)(name, _1.CDSString));
|
|
12
12
|
const and = (0, combi_1.seq)("AND", cond);
|
|
13
13
|
return (0, combi_1.seq)("ASSOCIATION", cardinality, "TO", _1.CDSName, (0, combi_1.opt)(as), "ON", cond, (0, combi_1.star)(and));
|
|
14
14
|
}
|
|
@@ -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
|
|
@@ -7,7 +7,7 @@ const cds_as_1 = require("./cds_as");
|
|
|
7
7
|
const cds_cast_1 = require("./cds_cast");
|
|
8
8
|
class CDSElement extends combi_1.Expression {
|
|
9
9
|
getRunnable() {
|
|
10
|
-
return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.optPrio)("KEY"), (0, combi_1.alt)(_1.CDSName, cds_cast_1.CDSCast), (0, combi_1.optPrio)(cds_as_1.CDSAs));
|
|
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
11
|
}
|
|
12
12
|
}
|
|
13
13
|
exports.CDSElement = CDSElement;
|
|
@@ -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
|
|
@@ -5,9 +5,8 @@ const _1 = require(".");
|
|
|
5
5
|
const combi_1 = require("../../abap/2_statements/combi");
|
|
6
6
|
class CDSWhere extends combi_1.Expression {
|
|
7
7
|
getRunnable() {
|
|
8
|
-
const constant = (0, combi_1.regex)(/^'[\w ]+'$/);
|
|
9
8
|
const field = (0, combi_1.seq)(_1.CDSName, (0, combi_1.star)((0, combi_1.seq)(".", _1.CDSName)));
|
|
10
|
-
const condition = (0, combi_1.seq)(field, "=", (0, combi_1.alt)(
|
|
9
|
+
const condition = (0, combi_1.seq)(field, "=", (0, combi_1.alt)(_1.CDSString, field));
|
|
11
10
|
return (0, combi_1.seq)("WHERE", condition, (0, combi_1.star)((0, combi_1.seq)("AND", condition)));
|
|
12
11
|
}
|
|
13
12
|
}
|
|
@@ -15,6 +15,7 @@ __exportStar(require("./cds_as"), exports);
|
|
|
15
15
|
__exportStar(require("./cds_association"), exports);
|
|
16
16
|
__exportStar(require("./cds_cast"), exports);
|
|
17
17
|
__exportStar(require("./cds_define_view"), exports);
|
|
18
|
+
__exportStar(require("./cds_define_abstract"), exports);
|
|
18
19
|
__exportStar(require("./cds_element"), exports);
|
|
19
20
|
__exportStar(require("./cds_function"), exports);
|
|
20
21
|
__exportStar(require("./cds_join"), exports);
|
|
@@ -22,4 +23,5 @@ __exportStar(require("./cds_name"), exports);
|
|
|
22
23
|
__exportStar(require("./cds_select"), exports);
|
|
23
24
|
__exportStar(require("./cds_source"), exports);
|
|
24
25
|
__exportStar(require("./cds_where"), exports);
|
|
26
|
+
__exportStar(require("./cds_string"), exports);
|
|
25
27
|
//# sourceMappingURL=index.js.map
|
package/build/src/registry.js
CHANGED