@abaplint/core 2.101.6 → 2.101.8
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/expressions/index.js +1 -0
- package/build/src/abap/2_statements/expressions/sql_arithmetic_operator.js +13 -0
- package/build/src/abap/2_statements/expressions/sql_arithmetics.js +2 -3
- package/build/src/abap/2_statements/expressions/sql_field_and_value.js +4 -1
- package/build/src/objects/data_definition.js +8 -1
- package/build/src/registry.js +1 -1
- package/build/src/rules/downport.js +6 -1
- package/package.json +2 -2
package/build/abaplint.d.ts
CHANGED
|
@@ -2131,6 +2131,7 @@ declare namespace Expressions {
|
|
|
2131
2131
|
SQLAggregation,
|
|
2132
2132
|
SQLAliasField,
|
|
2133
2133
|
SQLArithmetics,
|
|
2134
|
+
SQLArithmeticOperator,
|
|
2134
2135
|
SQLAsName,
|
|
2135
2136
|
SQLCase,
|
|
2136
2137
|
SQLCDSParameters,
|
|
@@ -5308,6 +5309,10 @@ declare class SQLAliasField extends Expression {
|
|
|
5308
5309
|
getRunnable(): IStatementRunnable;
|
|
5309
5310
|
}
|
|
5310
5311
|
|
|
5312
|
+
declare class SQLArithmeticOperator extends Expression {
|
|
5313
|
+
getRunnable(): IStatementRunnable;
|
|
5314
|
+
}
|
|
5315
|
+
|
|
5311
5316
|
declare class SQLArithmetics extends Expression {
|
|
5312
5317
|
getRunnable(): IStatementRunnable;
|
|
5313
5318
|
}
|
|
@@ -169,6 +169,7 @@ __exportStar(require("./source"), exports);
|
|
|
169
169
|
__exportStar(require("./sql_aggregation"), exports);
|
|
170
170
|
__exportStar(require("./sql_alias_field"), exports);
|
|
171
171
|
__exportStar(require("./sql_arithmetics"), exports);
|
|
172
|
+
__exportStar(require("./sql_arithmetic_operator"), exports);
|
|
172
173
|
__exportStar(require("./sql_as_name"), exports);
|
|
173
174
|
__exportStar(require("./sql_case"), exports);
|
|
174
175
|
__exportStar(require("./sql_cds_parameters"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SQLArithmeticOperator = void 0;
|
|
4
|
+
const combi_1 = require("../combi");
|
|
5
|
+
const tokens_1 = require("../../1_lexer/tokens");
|
|
6
|
+
class SQLArithmeticOperator extends combi_1.Expression {
|
|
7
|
+
getRunnable() {
|
|
8
|
+
const operator = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WPlusW), (0, combi_1.tok)(tokens_1.WDashW), "*", "/");
|
|
9
|
+
return operator;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.SQLArithmeticOperator = SQLArithmeticOperator;
|
|
13
|
+
//# sourceMappingURL=sql_arithmetic_operator.js.map
|
|
@@ -3,12 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SQLArithmetics = void 0;
|
|
4
4
|
const combi_1 = require("../combi");
|
|
5
5
|
const _1 = require(".");
|
|
6
|
-
const
|
|
6
|
+
const sql_arithmetic_operator_1 = require("./sql_arithmetic_operator");
|
|
7
7
|
class SQLArithmetics extends combi_1.Expression {
|
|
8
8
|
getRunnable() {
|
|
9
|
-
const operator = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WPlusW), (0, combi_1.tok)(tokens_1.WDashW), "*", "/");
|
|
10
9
|
const field = (0, combi_1.alt)(_1.SQLFieldName, _1.SQLFunction);
|
|
11
|
-
return (0, combi_1.seq)(field, (0, combi_1.starPrio)((0, combi_1.seq)(
|
|
10
|
+
return (0, combi_1.seq)(field, (0, combi_1.starPrio)((0, combi_1.seq)(sql_arithmetic_operator_1.SQLArithmeticOperator, field)));
|
|
12
11
|
}
|
|
13
12
|
}
|
|
14
13
|
exports.SQLArithmetics = SQLArithmetics;
|
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SQLFieldAndValue = void 0;
|
|
4
4
|
const combi_1 = require("../combi");
|
|
5
|
+
const integer_1 = require("./integer");
|
|
6
|
+
const sql_arithmetic_operator_1 = require("./sql_arithmetic_operator");
|
|
5
7
|
const sql_field_name_1 = require("./sql_field_name");
|
|
6
8
|
const sql_source_1 = require("./sql_source");
|
|
7
9
|
class SQLFieldAndValue extends combi_1.Expression {
|
|
8
10
|
getRunnable() {
|
|
9
|
-
const
|
|
11
|
+
const opt1 = (0, combi_1.seq)((0, combi_1.altPrio)(integer_1.Integer, sql_field_name_1.SQLFieldName), sql_arithmetic_operator_1.SQLArithmeticOperator, sql_source_1.SQLSource);
|
|
12
|
+
const param = (0, combi_1.seq)(sql_field_name_1.SQLFieldName, "=", (0, combi_1.altPrio)(opt1, sql_source_1.SQLSource));
|
|
10
13
|
return param;
|
|
11
14
|
}
|
|
12
15
|
}
|
|
@@ -108,7 +108,14 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
|
|
|
108
108
|
}
|
|
109
109
|
findFieldNames(tree) {
|
|
110
110
|
var _a, _b;
|
|
111
|
-
|
|
111
|
+
let expr = tree.findFirstExpression(expressions_1.CDSSelect);
|
|
112
|
+
if (expr === undefined) {
|
|
113
|
+
expr = tree.findFirstExpression(expressions_1.CDSAnnotate);
|
|
114
|
+
}
|
|
115
|
+
if (expr === undefined) {
|
|
116
|
+
expr = tree.findFirstExpression(expressions_1.CDSDefineProjection);
|
|
117
|
+
}
|
|
118
|
+
for (const e of (expr === null || expr === void 0 ? void 0 : expr.findDirectExpressions(expressions_1.CDSElement)) || []) {
|
|
112
119
|
let found = (_a = e.findDirectExpression(expressions_1.CDSAs)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(expressions_1.CDSName);
|
|
113
120
|
if (found === undefined) {
|
|
114
121
|
const list = e.findDirectExpressions(expressions_1.CDSName);
|
package/build/src/registry.js
CHANGED
|
@@ -154,7 +154,9 @@ Current rules:
|
|
|
154
154
|
* ENUMs, but does not nessesarily give the correct type and value
|
|
155
155
|
* MESSAGE with non simple source
|
|
156
156
|
|
|
157
|
-
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport
|
|
157
|
+
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
158
|
+
|
|
159
|
+
Make sure to test the downported code, it might not always be completely correct.`,
|
|
158
160
|
tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
|
|
159
161
|
};
|
|
160
162
|
}
|
|
@@ -870,6 +872,9 @@ ${indentation}ENDIF.
|
|
|
870
872
|
${indentation}`);
|
|
871
873
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
|
|
872
874
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
875
|
+
if (high.get() instanceof Statements.ElseIf) {
|
|
876
|
+
throw "downport, unable to downport table expression in ELSEIF";
|
|
877
|
+
}
|
|
873
878
|
return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Outline table expression", this.getMetadata().key, this.conf.severity, fix);
|
|
874
879
|
}
|
|
875
880
|
return undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.101.
|
|
3
|
+
"version": "2.101.8",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@microsoft/api-extractor": "^7.35.0",
|
|
52
52
|
"@types/chai": "^4.3.5",
|
|
53
53
|
"@types/mocha": "^10.0.1",
|
|
54
|
-
"@types/node": "^20.2.
|
|
54
|
+
"@types/node": "^20.2.5",
|
|
55
55
|
"chai": "^4.3.7",
|
|
56
56
|
"eslint": "^8.41.0",
|
|
57
57
|
"mocha": "^10.2.0",
|