@abaplint/core 2.113.141 → 2.113.143
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/abap/2_statements/expressions/sql_path.js +4 -1
- package/build/src/abap/2_statements/statements/read_entities.js +1 -1
- package/build/src/abap/5_syntax/expressions/field_chain.js +9 -2
- package/build/src/abap/5_syntax/expressions/source.js +3 -2
- package/build/src/abap/5_syntax/expressions/target.js +1 -1
- package/build/src/abap/5_syntax/statements/assign.js +1 -1
- package/build/src/abap/5_syntax/statements/insert_internal.js +6 -1
- package/build/src/cds/expressions/cds_define_projection.js +1 -1
- package/build/src/registry.js +1 -1
- package/package.json +3 -3
|
@@ -3,10 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SQLPath = void 0;
|
|
4
4
|
const combi_1 = require("../combi");
|
|
5
5
|
const tokens_1 = require("../../1_lexer/tokens");
|
|
6
|
+
const association_name_1 = require("./association_name");
|
|
7
|
+
const sql_cond_1 = require("./sql_cond");
|
|
6
8
|
class SQLPath extends combi_1.Expression {
|
|
7
9
|
getRunnable() {
|
|
8
10
|
// todo, only from version?
|
|
9
|
-
const
|
|
11
|
+
const condition = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.BracketLeftW), "ONE TO ONE WHERE", sql_cond_1.SQLCond, (0, combi_1.tok)(tokens_1.WBracketRight));
|
|
12
|
+
const ret = (0, combi_1.seq)(association_name_1.AssociationName, (0, combi_1.optPrio)(condition), (0, combi_1.tok)(tokens_1.Dash), (0, combi_1.regex)(/\w+/));
|
|
10
13
|
return ret;
|
|
11
14
|
}
|
|
12
15
|
}
|
|
@@ -10,7 +10,7 @@ class ReadEntities {
|
|
|
10
10
|
const from = (0, combi_1.seq)("FROM", expressions_1.Source);
|
|
11
11
|
const fields = (0, combi_1.seq)("FIELDS", (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.plus)(expressions_1.SimpleName), (0, combi_1.tok)(tokens_1.WParenRightW), "WITH", expressions_1.Source);
|
|
12
12
|
const all = (0, combi_1.seq)("ALL FIELDS WITH", expressions_1.Source);
|
|
13
|
-
const entity = (0, combi_1.seq)("ENTITY", expressions_1.
|
|
13
|
+
const entity = (0, combi_1.seq)("ENTITY", expressions_1.NamespaceSimpleName, (0, combi_1.opt)((0, combi_1.seq)("BY", expressions_1.AssociationName)), (0, combi_1.alt)(fields, from, all), (0, combi_1.optPrio)((0, combi_1.seq)("RESULT", expressions_1.Target)));
|
|
14
14
|
const s = (0, combi_1.seq)("READ ENTITIES OF", expressions_1.NamespaceSimpleName, (0, combi_1.opt)("IN LOCAL MODE"), (0, combi_1.plus)(entity), (0, combi_1.optPrio)((0, combi_1.seq)("LINK", expressions_1.Target)), (0, combi_1.optPrio)((0, combi_1.seq)("FAILED", expressions_1.Target)), (0, combi_1.optPrio)((0, combi_1.seq)("REPORTED", expressions_1.Target)));
|
|
15
15
|
return (0, combi_1.ver)(version_1.Version.v754, s);
|
|
16
16
|
}
|
|
@@ -16,8 +16,9 @@ const dereference_1 = require("./dereference");
|
|
|
16
16
|
const source_field_symbol_1 = require("./source_field_symbol");
|
|
17
17
|
const source_field_1 = require("./source_field");
|
|
18
18
|
const _syntax_input_1 = require("../_syntax_input");
|
|
19
|
+
const version_1 = require("../../../version");
|
|
19
20
|
class FieldChain {
|
|
20
|
-
static runSyntax(node, input, refType) {
|
|
21
|
+
static runSyntax(node, input, refType, allowGenericDeference = false) {
|
|
21
22
|
var _a, _b, _c;
|
|
22
23
|
if (((_a = node.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.SourceField
|
|
23
24
|
&& node.findDirectExpression(Expressions.ComponentName)) {
|
|
@@ -75,7 +76,7 @@ class FieldChain {
|
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
78
|
else {
|
|
78
|
-
const message = "Not a structure, FieldChain";
|
|
79
|
+
const message = "Not a structure, FieldChain, " + (context === null || context === void 0 ? void 0 : context.constructor.name) + ", " + current.concatTokens();
|
|
79
80
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, current.getFirstToken(), message));
|
|
80
81
|
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
81
82
|
}
|
|
@@ -92,6 +93,12 @@ class FieldChain {
|
|
|
92
93
|
}
|
|
93
94
|
else if (current.get() instanceof expressions_1.Dereference) {
|
|
94
95
|
context = dereference_1.Dereference.runSyntax(current, context, input);
|
|
96
|
+
if (allowGenericDeference === false
|
|
97
|
+
&& (context === null || context === void 0 ? void 0 : context.isGeneric()) === true
|
|
98
|
+
&& input.scope.getVersion() < version_1.Version.v756
|
|
99
|
+
&& input.scope.getVersion() !== version_1.Version.Cloud) {
|
|
100
|
+
throw new Error("A generic reference cannot be dereferenced");
|
|
101
|
+
}
|
|
95
102
|
}
|
|
96
103
|
else if (current.get() instanceof Expressions.ComponentName) {
|
|
97
104
|
if (context instanceof basic_1.TableType && context.isWithHeader()) {
|
|
@@ -36,8 +36,9 @@ const assert_error_1 = require("../assert_error");
|
|
|
36
36
|
* VALUE #( ... ). syntax error
|
|
37
37
|
* DATA(bar) = VALUE #( ... ). give error, no type can be derived
|
|
38
38
|
*/
|
|
39
|
+
// TODO: refactor all these method parameters to objects, this is getting messy
|
|
39
40
|
class Source {
|
|
40
|
-
static runSyntax(node, input, targetType, writeReference = false) {
|
|
41
|
+
static runSyntax(node, input, targetType, writeReference = false, allowGenericDeference = false) {
|
|
41
42
|
if (node === undefined) {
|
|
42
43
|
return undefined;
|
|
43
44
|
}
|
|
@@ -200,7 +201,7 @@ class Source {
|
|
|
200
201
|
}
|
|
201
202
|
}
|
|
202
203
|
else if (get instanceof Expressions.FieldChain) {
|
|
203
|
-
context = field_chain_1.FieldChain.runSyntax(first, input, type);
|
|
204
|
+
context = field_chain_1.FieldChain.runSyntax(first, input, type, allowGenericDeference);
|
|
204
205
|
}
|
|
205
206
|
else if (get instanceof Expressions.StringTemplate) {
|
|
206
207
|
context = string_template_1.StringTemplate.runSyntax(first, input);
|
|
@@ -54,7 +54,7 @@ class Target {
|
|
|
54
54
|
&& !(context instanceof basic_1.TableType && context.isWithHeader() && context.getRowType() instanceof basic_1.StructureType)
|
|
55
55
|
&& !(context instanceof basic_1.TableType && context.isWithHeader() && context.getRowType() instanceof basic_1.VoidType)
|
|
56
56
|
&& !(context instanceof basic_1.VoidType)) {
|
|
57
|
-
const message = "Not a structure, target";
|
|
57
|
+
const message = "Not a structure, target, " + (context === null || context === void 0 ? void 0 : context.constructor.name) + ", " + current.concatTokens();
|
|
58
58
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
59
59
|
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
60
60
|
}
|
|
@@ -29,7 +29,7 @@ class Assign {
|
|
|
29
29
|
sourceType = basic_1.VoidType.get("Dynamic");
|
|
30
30
|
}
|
|
31
31
|
else {
|
|
32
|
-
sourceType = source_1.Source.runSyntax(theSource, input);
|
|
32
|
+
sourceType = source_1.Source.runSyntax(theSource, input, undefined, false, true);
|
|
33
33
|
}
|
|
34
34
|
if ((assignSource === null || assignSource === void 0 ? void 0 : assignSource.getChildren().length) === 5
|
|
35
35
|
&& ((_a = assignSource === null || assignSource === void 0 ? void 0 : assignSource.getFirstChild()) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase()) === "COMPONENT") {
|
|
@@ -74,7 +74,12 @@ class InsertInternal {
|
|
|
74
74
|
inline_data_1.InlineData.runSyntax(afterInto, input, new basic_1.DataReference(sourceType));
|
|
75
75
|
}
|
|
76
76
|
else {
|
|
77
|
-
target_1.Target.runSyntax(afterInto, input);
|
|
77
|
+
const type = target_1.Target.runSyntax(afterInto, input);
|
|
78
|
+
if (type instanceof basic_1.TableType && type.getAccessType() === basic_1.TableAccessType.hashed) {
|
|
79
|
+
const message = "Implicit or explicit index operation on hashed table is not possible";
|
|
80
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
78
83
|
}
|
|
79
84
|
}
|
|
80
85
|
for (const s of node.findDirectExpressions(Expressions.Source)) {
|
|
@@ -6,7 +6,7 @@ const __1 = require("../..");
|
|
|
6
6
|
const combi_1 = require("../../abap/2_statements/combi");
|
|
7
7
|
class CDSDefineProjection extends combi_1.Expression {
|
|
8
8
|
getRunnable() {
|
|
9
|
-
return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), "DEFINE", (0, combi_1.opt)("ROOT"), "VIEW", (0, combi_1.ver)(__1.Version.v755, (0, combi_1.opt)("ENTITY")), _1.CDSName, (0, combi_1.opt)(_1.CDSProviderContract), "AS PROJECTION ON", _1.CDSName, (0, combi_1.opt)(_1.CDSAs), (0, combi_1.str)("{"), (0, combi_1.plus)(_1.CDSElement), (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.str)("}"), (0, combi_1.opt)(";"));
|
|
9
|
+
return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), "DEFINE", (0, combi_1.opt)("ROOT"), "VIEW", (0, combi_1.ver)(__1.Version.v755, (0, combi_1.opt)("ENTITY")), _1.CDSName, (0, combi_1.opt)(_1.CDSProviderContract), "AS PROJECTION ON", _1.CDSName, (0, combi_1.opt)(_1.CDSAs), (0, combi_1.str)("{"), (0, combi_1.plus)(_1.CDSElement), (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.str)("}"), (0, combi_1.opt)(_1.CDSWhere), (0, combi_1.opt)(";"));
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
exports.CDSDefineProjection = CDSDefineProjection;
|
package/build/src/registry.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.113.
|
|
3
|
+
"version": "2.113.143",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"@microsoft/api-extractor": "^7.52.8",
|
|
54
54
|
"@types/chai": "^4.3.20",
|
|
55
55
|
"@types/mocha": "^10.0.10",
|
|
56
|
-
"@types/node": "^24.0.
|
|
56
|
+
"@types/node": "^24.0.14",
|
|
57
57
|
"chai": "^4.5.0",
|
|
58
|
-
"eslint": "^9.
|
|
58
|
+
"eslint": "^9.31.0",
|
|
59
59
|
"mocha": "^11.7.1",
|
|
60
60
|
"c8": "^10.1.3",
|
|
61
61
|
"source-map-support": "^0.5.21",
|