@abaplint/core 2.113.140 → 2.113.142
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/select_loop.js +1 -1
- package/build/src/abap/2_statements/expressions/sql_field.js +1 -2
- package/build/src/abap/2_statements/expressions/sql_field_list_loop.js +1 -1
- package/build/src/abap/2_statements/statements/ranges.js +1 -1
- package/build/src/abap/5_syntax/expressions/field_chain.js +8 -1
- package/build/src/abap/5_syntax/expressions/source.js +3 -2
- package/build/src/abap/5_syntax/statements/assign.js +1 -1
- package/build/src/abap/5_syntax/statements/ranges.js +1 -1
- package/build/src/registry.js +1 -1
- package/package.json +1 -1
|
@@ -20,7 +20,7 @@ class SelectLoop extends combi_1.Expression {
|
|
|
20
20
|
const tab = (0, combi_1.seq)(_1.SQLIntoTable, (0, combi_1.alt)(pack, (0, combi_1.seq)(_1.SQLFrom, pack), (0, combi_1.seq)(pack, _1.SQLFrom)));
|
|
21
21
|
const packTab = (0, combi_1.seq)(pack, _1.SQLIntoTable);
|
|
22
22
|
const into = (0, combi_1.altPrio)(sql_into_structure_1.SQLIntoStructure, _1.SQLIntoList);
|
|
23
|
-
const perm = (0, combi_1.per)(_1.SQLFrom, where, sql_up_to_1.SQLUpTo, sql_order_by_1.SQLOrderBy, sql_having_1.SQLHaving, _1.SQLClient, bypass, _1.SQLGroupBy, _1.SQLForAllEntries, (0, combi_1.alt)(tab,
|
|
23
|
+
const perm = (0, combi_1.per)(_1.SQLFrom, where, sql_up_to_1.SQLUpTo, sql_order_by_1.SQLOrderBy, sql_having_1.SQLHaving, _1.SQLClient, bypass, _1.SQLGroupBy, _1.SQLForAllEntries, (0, combi_1.alt)(tab, sql_into_structure_1.SQLIntoStructure, _1.SQLIntoList, packTab));
|
|
24
24
|
const strict = (0, combi_1.seq)(_1.SQLFrom, (0, combi_1.ver)(version_1.Version.v750, sql_fields_loop_1.SQLFieldsLoop), (0, combi_1.optPrio)(_1.SQLForAllEntries), (0, combi_1.optPrio)((0, combi_1.seq)(where, (0, combi_1.optPrio)(sql_order_by_1.SQLOrderBy), into, (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo))));
|
|
25
25
|
const aggr = (0, combi_1.seq)(_1.SQLAggregation, into, (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo), _1.SQLFrom, where, _1.SQLGroupBy);
|
|
26
26
|
const ret = (0, combi_1.seq)("SELECT", (0, combi_1.altPrio)((0, combi_1.seq)((0, combi_1.optPrio)("DISTINCT"), sql_field_list_loop_1.SQLFieldListLoop, perm), strict, aggr), (0, combi_1.optPrio)(sql_hints_1.SQLHints));
|
|
@@ -6,11 +6,10 @@ const _1 = require(".");
|
|
|
6
6
|
const version_1 = require("../../../version");
|
|
7
7
|
const tokens_1 = require("../../1_lexer/tokens");
|
|
8
8
|
const sql_function_1 = require("./sql_function");
|
|
9
|
-
const simple_field_chain_1 = require("./simple_field_chain");
|
|
10
9
|
const sql_path_1 = require("./sql_path");
|
|
11
10
|
class SQLField extends combi_1.Expression {
|
|
12
11
|
getRunnable() {
|
|
13
|
-
const abap = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt),
|
|
12
|
+
const abap = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), _1.SimpleFieldChain2));
|
|
14
13
|
const as = (0, combi_1.seq)("AS", _1.SQLAsName);
|
|
15
14
|
const field = (0, combi_1.altPrio)(_1.SQLAggregation, _1.SQLCase, sql_function_1.SQLFunction, sql_path_1.SQLPath, _1.SQLFieldName, abap, _1.Constant);
|
|
16
15
|
const sub = (0, combi_1.plusPrio)((0, combi_1.seq)((0, combi_1.altPrio)("+", "-", "*", "/", "&&"), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenLeftW)), field, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW))));
|
|
@@ -12,7 +12,7 @@ class SQLFieldListLoop extends combi_1.Expression {
|
|
|
12
12
|
const comma = (0, combi_1.opt)((0, combi_1.ver)(version_1.Version.v740sp05, ","));
|
|
13
13
|
const as = (0, combi_1.seq)("AS", _1.SQLAsName);
|
|
14
14
|
const someField = (0, combi_1.seq)(_1.SQLField, comma);
|
|
15
|
-
const abap = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), _1.
|
|
15
|
+
const abap = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), _1.SimpleFieldChain2));
|
|
16
16
|
const fieldList = (0, combi_1.seq)((0, combi_1.star)(someField), (0, combi_1.alt)(_1.SQLFieldName, abap, sql_path_1.SQLPath, _1.Constant), (0, combi_1.optPrio)(as), comma, (0, combi_1.star)(someField));
|
|
17
17
|
const fields = (0, combi_1.alt)("*", _1.Dynamic, fieldList);
|
|
18
18
|
return fields;
|
|
@@ -7,7 +7,7 @@ const version_1 = require("../../../version");
|
|
|
7
7
|
class Ranges {
|
|
8
8
|
getMatcher() {
|
|
9
9
|
const occurs = (0, combi_1.seq)("OCCURS", expressions_1.Source);
|
|
10
|
-
const ret = (0, combi_1.seq)("RANGES", expressions_1.
|
|
10
|
+
const ret = (0, combi_1.seq)("RANGES", expressions_1.DefinitionName, "FOR", expressions_1.SimpleFieldChain2, (0, combi_1.optPrio)(occurs), (0, combi_1.optPrio)(expressions_1.FieldLength));
|
|
11
11
|
return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -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)) {
|
|
@@ -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);
|
|
@@ -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") {
|
|
@@ -9,7 +9,7 @@ const assert_error_1 = require("../assert_error");
|
|
|
9
9
|
class Ranges {
|
|
10
10
|
runSyntax(node, input) {
|
|
11
11
|
var _a;
|
|
12
|
-
const nameToken = (_a = node.findFirstExpression(Expressions.
|
|
12
|
+
const nameToken = (_a = node.findFirstExpression(Expressions.DefinitionName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
13
13
|
const typeExpression = node.findFirstExpression(Expressions.SimpleFieldChain2);
|
|
14
14
|
if (typeExpression === undefined) {
|
|
15
15
|
throw new assert_error_1.AssertError("Ranges, unexpected node");
|
package/build/src/registry.js
CHANGED