@abaplint/core 2.102.52 → 2.102.54
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.
|
@@ -5,7 +5,7 @@ const combi_1 = require("../combi");
|
|
|
5
5
|
const _1 = require(".");
|
|
6
6
|
class SQLFields extends combi_1.Expression {
|
|
7
7
|
getRunnable() {
|
|
8
|
-
return (0, combi_1.seq)("FIELDS", _1.SQLFieldList);
|
|
8
|
+
return (0, combi_1.seq)("FIELDS", (0, combi_1.opt)("DISTINCT"), _1.SQLFieldList);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
exports.SQLFields = SQLFields;
|
|
@@ -17,20 +17,30 @@ const source_field_symbol_1 = require("./source_field_symbol");
|
|
|
17
17
|
const source_field_1 = require("./source_field");
|
|
18
18
|
class FieldChain {
|
|
19
19
|
runSyntax(node, scope, filename, refType) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
var _a, _b, _c, _d, _e;
|
|
21
|
+
const children = node.getChildren().slice();
|
|
22
|
+
let contextName = children[0].concatTokens();
|
|
23
|
+
let context = undefined;
|
|
24
|
+
try {
|
|
25
|
+
context = this.findTop(children.shift(), scope, filename, refType);
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
const concat = node.concatTokens();
|
|
29
|
+
if (concat.includes("-") && ((_a = node.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.SourceField) {
|
|
30
|
+
// workaround for names with dashes, eg. "sy-repid"
|
|
31
|
+
const offset = ((_b = node.findDirectExpression(Expressions.FieldOffset)) === null || _b === void 0 ? void 0 : _b.concatTokens()) || "";
|
|
32
|
+
const length = ((_c = node.findDirectExpression(Expressions.FieldLength)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "";
|
|
33
|
+
const found = scope.findVariable(concat.replace(offset, "").replace(length, ""));
|
|
34
|
+
if (found) {
|
|
35
|
+
if (refType) {
|
|
36
|
+
scope.addReference(node.getFirstToken(), found, refType, filename);
|
|
37
|
+
}
|
|
38
|
+
// this is not completely correct, but will work, dashes in names is a mess anyhow
|
|
39
|
+
return found.getType();
|
|
27
40
|
}
|
|
28
|
-
return found.getType();
|
|
29
41
|
}
|
|
42
|
+
throw error;
|
|
30
43
|
}
|
|
31
|
-
const children = node.getChildren().slice();
|
|
32
|
-
let contextName = children[0].concatTokens();
|
|
33
|
-
let context = this.findTop(children.shift(), scope, filename, refType);
|
|
34
44
|
while (children.length > 0) {
|
|
35
45
|
contextName += children[0].concatTokens();
|
|
36
46
|
const current = children.shift();
|
|
@@ -78,7 +88,30 @@ class FieldChain {
|
|
|
78
88
|
if (context instanceof basic_1.TableType && context.isWithHeader()) {
|
|
79
89
|
context = context.getRowType();
|
|
80
90
|
}
|
|
81
|
-
|
|
91
|
+
try {
|
|
92
|
+
context = new component_name_1.ComponentName().runSyntax(context, current);
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
const concat = node.concatTokens();
|
|
96
|
+
if (concat.includes("-")) {
|
|
97
|
+
// workaround for names with dashes, eg. "sy-repid"
|
|
98
|
+
const offset = ((_d = node.findDirectExpression(Expressions.FieldOffset)) === null || _d === void 0 ? void 0 : _d.concatTokens()) || "";
|
|
99
|
+
const length = ((_e = node.findDirectExpression(Expressions.FieldLength)) === null || _e === void 0 ? void 0 : _e.concatTokens()) || "";
|
|
100
|
+
const found = scope.findVariable(concat.replace(offset, "").replace(length, ""));
|
|
101
|
+
if (found) {
|
|
102
|
+
if (refType) {
|
|
103
|
+
scope.addReference(node.getFirstToken(), found, refType, filename);
|
|
104
|
+
}
|
|
105
|
+
context = found.getType();
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
throw error;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
throw error;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
82
115
|
}
|
|
83
116
|
else if (current instanceof nodes_1.ExpressionNode
|
|
84
117
|
&& current.get() instanceof Expressions.TableExpression) {
|
package/build/src/registry.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.102.
|
|
3
|
+
"version": "2.102.54",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@microsoft/api-extractor": "^7.38.0",
|
|
54
54
|
"@types/chai": "^4.3.6",
|
|
55
55
|
"@types/mocha": "^10.0.2",
|
|
56
|
-
"@types/node": "^20.8.
|
|
56
|
+
"@types/node": "^20.8.2",
|
|
57
57
|
"chai": "^4.3.10",
|
|
58
58
|
"eslint": "^8.50.0",
|
|
59
59
|
"mocha": "^10.2.0",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"typescript": "^5.2.2"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"fast-xml-parser": "^4.3.
|
|
66
|
+
"fast-xml-parser": "^4.3.2",
|
|
67
67
|
"json5": "^2.2.3",
|
|
68
68
|
"vscode-languageserver-types": "^3.17.5"
|
|
69
69
|
}
|