@abaplint/core 2.113.51 → 2.113.53
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/inline_loop_definition.js +2 -1
- package/build/src/abap/2_statements/expressions/select.js +1 -4
- package/build/src/abap/2_statements/expressions/sql_field_list.js +3 -1
- package/build/src/abap/2_statements/expressions/string_template_formatting.js +1 -1
- package/build/src/abap/2_statements/expressions/target_field_symbol.js +1 -1
- package/build/src/abap/2_statements/statements/method_def.js +1 -1
- package/build/src/abap/2_statements/statements/selectionscreen.js +1 -1
- package/build/src/abap/5_syntax/_object_oriented.js +12 -5
- package/build/src/abap/5_syntax/_type_utils.js +3 -0
- package/build/src/abap/5_syntax/expressions/source.js +1 -1
- package/build/src/abap/5_syntax/statements/selection_screen.js +15 -10
- package/build/src/cds/cds_determine_types.js +3 -3
- package/build/src/objects/data_definition.js +1 -1
- package/build/src/registry.js +1 -1
- package/build/src/rules/selection_screen_naming.js +5 -1
- package/package.json +1 -1
|
@@ -6,7 +6,8 @@ const _1 = require(".");
|
|
|
6
6
|
class InlineLoopDefinition extends combi_1.Expression {
|
|
7
7
|
getRunnable() {
|
|
8
8
|
const index = (0, combi_1.seq)("INDEX INTO", _1.TargetField);
|
|
9
|
-
|
|
9
|
+
const key = (0, combi_1.seq)("USING KEY", _1.SimpleName);
|
|
10
|
+
return (0, combi_1.seq)((0, combi_1.altPrio)(_1.TargetFieldSymbol, _1.TargetField), "IN", (0, combi_1.opt)("GROUP"), _1.Source, (0, combi_1.optPrio)(key), (0, combi_1.optPrio)(index));
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
exports.InlineLoopDefinition = InlineLoopDefinition;
|
|
@@ -6,8 +6,6 @@ const _1 = require(".");
|
|
|
6
6
|
const version_1 = require("../../../version");
|
|
7
7
|
const sql_group_by_1 = require("./sql_group_by");
|
|
8
8
|
const sql_into_structure_1 = require("./sql_into_structure");
|
|
9
|
-
const tokens_1 = require("../../1_lexer/tokens");
|
|
10
|
-
const sql_field_name_1 = require("./sql_field_name");
|
|
11
9
|
const sql_up_to_1 = require("./sql_up_to");
|
|
12
10
|
class Select extends combi_1.Expression {
|
|
13
11
|
getRunnable() {
|
|
@@ -19,8 +17,7 @@ class Select extends combi_1.Expression {
|
|
|
19
17
|
// todo, HINTS cannot be anywhere, need an expression dedicated for strict sql
|
|
20
18
|
const perm = (0, combi_1.per)(_1.SQLFrom, into, _1.SQLForAllEntries, where, _1.SQLOrderBy, sql_up_to_1.SQLUpTo, offset, _1.SQLClient, _1.SQLHaving, bypass, sql_group_by_1.SQLGroupBy, fields, _1.DatabaseConnection, _1.SQLHints);
|
|
21
19
|
const permSingle = (0, combi_1.per)(_1.SQLFrom, (0, combi_1.altPrio)(sql_into_structure_1.SQLIntoStructure, _1.SQLIntoList), where, _1.SQLClient, bypass, sql_group_by_1.SQLGroupBy, fields, _1.DatabaseConnection, _1.SQLHints);
|
|
22
|
-
const
|
|
23
|
-
const fieldList = (0, combi_1.optPrio)((0, combi_1.altPrio)(_1.SQLFieldList, paren));
|
|
20
|
+
const fieldList = (0, combi_1.optPrio)(_1.SQLFieldList);
|
|
24
21
|
const single = (0, combi_1.seq)("SINGLE", (0, combi_1.optPrio)("FOR UPDATE"), fieldList, permSingle);
|
|
25
22
|
const other = (0, combi_1.seq)((0, combi_1.optPrio)("DISTINCT"), fieldList, perm);
|
|
26
23
|
const ret = (0, combi_1.seq)("SELECT", (0, combi_1.altPrio)(single, other));
|
|
@@ -4,11 +4,13 @@ exports.SQLFieldList = void 0;
|
|
|
4
4
|
const combi_1 = require("../combi");
|
|
5
5
|
const _1 = require(".");
|
|
6
6
|
const version_1 = require("../../../version");
|
|
7
|
+
const tokens_1 = require("../../1_lexer/tokens");
|
|
7
8
|
class SQLFieldList extends combi_1.Expression {
|
|
8
9
|
getRunnable() {
|
|
10
|
+
const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFieldName, (0, combi_1.tok)(tokens_1.WParenRightW));
|
|
9
11
|
const nev = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.starPrio)((0, combi_1.seq)(",", _1.SQLField)));
|
|
10
12
|
const old = (0, combi_1.starPrio)(_1.SQLField);
|
|
11
|
-
return (0, combi_1.altPrio)("*", _1.Dynamic, (0, combi_1.seq)(_1.SQLField, (0, combi_1.alt)(nev, old)));
|
|
13
|
+
return (0, combi_1.altPrio)("*", _1.Dynamic, (0, combi_1.seq)(_1.SQLField, (0, combi_1.alt)(nev, old)), paren);
|
|
12
14
|
}
|
|
13
15
|
}
|
|
14
16
|
exports.SQLFieldList = SQLFieldList;
|
|
@@ -12,7 +12,7 @@ class StringTemplateFormatting extends combi_1.Expression {
|
|
|
12
12
|
const alignOptions = (0, combi_1.altPrio)("LEFT", "RIGHT", "CENTER", _1.Source);
|
|
13
13
|
const dateTimeOptions = (0, combi_1.altPrio)("RAW", "ISO", "USER", "ENVIRONMENT", _1.Source, dynamic_1.Dynamic);
|
|
14
14
|
const timeStampOptions = (0, combi_1.altPrio)("SPACE", "ISO", "USER", "ENVIRONMENT", _1.Source);
|
|
15
|
-
const numberOptions = (0, combi_1.altPrio)("RAW", "USER", "ENVIRONMENT", _1.Source);
|
|
15
|
+
const numberOptions = (0, combi_1.altPrio)("RAW", "USER", "ENVIRONMENT", _1.Source, dynamic_1.Dynamic);
|
|
16
16
|
const signOptions = (0, combi_1.altPrio)("LEFT", "LEFTPLUS", "LEFTSPACE", "RIGHT", "RIGHTPLUS", "RIGHTSPACE", _1.Source);
|
|
17
17
|
const caseOptions = (0, combi_1.altPrio)("RAW", "UPPER", "LOWER", _1.Source, dynamic_1.Dynamic);
|
|
18
18
|
const zeroXSDOptions = (0, combi_1.altPrio)("YES", "NO", _1.Source);
|
|
@@ -5,7 +5,7 @@ const combi_1 = require("../combi");
|
|
|
5
5
|
const _1 = require(".");
|
|
6
6
|
class TargetFieldSymbol extends combi_1.Expression {
|
|
7
7
|
getRunnable() {
|
|
8
|
-
return
|
|
8
|
+
return (0, combi_1.seq)(_1.FieldSymbol, (0, combi_1.optPrio)(_1.TableBody));
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
exports.TargetFieldSymbol = TargetFieldSymbol;
|
|
@@ -22,7 +22,7 @@ class MethodDef {
|
|
|
22
22
|
const behavior = (0, combi_1.altPrio)((0, combi_1.seq)("VALIDATE ON SAVE IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("MODIFY IMPORTING", expressions_1.MethodParamName, modify), (0, combi_1.seq)("READ IMPORTING", expressions_1.MethodParamName, (0, combi_1.altPrio)(forRead, forfunction)), (0, combi_1.seq)("FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.NamespaceSimpleName, "FOR", expressions_1.NamespaceSimpleName, result), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR CREATE", expressions_1.TypeName, expressions_1.MethodParamName, "FOR UPDATE", expressions_1.TypeName, expressions_1.MethodParamName, "FOR DELETE", expressions_1.TypeName), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR READ", expressions_1.TypeName, result), (0, combi_1.seq)((0, combi_1.alt)("BEHAVIOR", "LOCK"), "IMPORTING", expressions_1.MethodParamName, "FOR LOCK", expressions_1.TypeName), (0, combi_1.seq)("DETERMINE", (0, combi_1.alt)("ON MODIFY", "ON SAVE"), "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("GLOBAL AUTHORIZATION IMPORTING REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)("INSTANCE AUTHORIZATION IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)("INSTANCE FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result));
|
|
23
23
|
// todo, this is only from version something
|
|
24
24
|
const amdp = (0, combi_1.seq)("AMDP OPTIONS CDS SESSION CLIENT CURRENT", (0, combi_1.optPrio)(expressions_1.MethodDefImporting), (0, combi_1.optPrio)(expressions_1.MethodDefExporting), (0, combi_1.optPrio)(expressions_1.MethodDefRaising));
|
|
25
|
-
const ret = (0, combi_1.seq)((0, combi_1.altPrio)("CLASS-METHODS", "METHODS"), expressions_1.MethodName, (0, combi_1.alt)((0, combi_1.seq)((0, combi_1.optPrio)(expressions_1.Abstract), expressions_1.EventHandler), parameters, testing, (0, combi_1.seq)("FOR", (0, combi_1.alt)(tableFunction, ddl, behavior)), amdp, "NOT AT END OF MODE", (0, combi_1.optPrio)(expressions_1.Redefinition)));
|
|
25
|
+
const ret = (0, combi_1.seq)((0, combi_1.altPrio)("CLASS-METHODS", "METHODS"), expressions_1.MethodName, (0, combi_1.alt)((0, combi_1.seq)((0, combi_1.optPrio)(expressions_1.Abstract), (0, combi_1.optPrio)(def), expressions_1.EventHandler), parameters, testing, (0, combi_1.seq)("FOR", (0, combi_1.alt)(tableFunction, ddl, behavior)), amdp, "NOT AT END OF MODE", (0, combi_1.optPrio)(expressions_1.Redefinition)));
|
|
26
26
|
return ret;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -32,7 +32,7 @@ class SelectionScreen {
|
|
|
32
32
|
const posIntegers = (0, combi_1.regex)(/^(0?[1-9]|[1234567][0-9]|8[0-3])$/);
|
|
33
33
|
const pos = (0, combi_1.seq)("POSITION", (0, combi_1.altPrio)(posIntegers, posSymbols));
|
|
34
34
|
const incl = (0, combi_1.seq)("INCLUDE BLOCKS", expressions_1.BlockName);
|
|
35
|
-
const tabbed = (0, combi_1.seq)("BEGIN OF TABBED BLOCK", expressions_1.
|
|
35
|
+
const tabbed = (0, combi_1.seq)("BEGIN OF TABBED BLOCK", expressions_1.BlockName, "FOR", expressions_1.Integer, "LINES", (0, combi_1.optPrio)("NO INTERVALS"));
|
|
36
36
|
const uline = (0, combi_1.seq)("ULINE", (0, combi_1.opt)(position));
|
|
37
37
|
const param = (0, combi_1.seq)("INCLUDE PARAMETERS", expressions_1.Field);
|
|
38
38
|
const iso = (0, combi_1.seq)("INCLUDE SELECT-OPTIONS", expressions_1.Field);
|
|
@@ -67,7 +67,7 @@ class ObjectOriented {
|
|
|
67
67
|
return undefined;
|
|
68
68
|
}
|
|
69
69
|
findMethodViaAlias(methodName, def) {
|
|
70
|
-
for (const a of def.getAliases()) {
|
|
70
|
+
for (const a of def.getAliases() || []) {
|
|
71
71
|
if (a.getName().toUpperCase() === methodName.toUpperCase()) {
|
|
72
72
|
const comp = a.getComponent();
|
|
73
73
|
const res = this.findMethodInInterface(comp.split("~")[0], comp.split("~")[1]);
|
|
@@ -150,9 +150,12 @@ class ObjectOriented {
|
|
|
150
150
|
return undefined;
|
|
151
151
|
}
|
|
152
152
|
const upper = name.toUpperCase();
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
const attr = def.getAttributes();
|
|
154
|
+
if (attr) {
|
|
155
|
+
for (const a of attr.getAll()) {
|
|
156
|
+
if (a.getName().toUpperCase() === upper) {
|
|
157
|
+
return a;
|
|
158
|
+
}
|
|
156
159
|
}
|
|
157
160
|
}
|
|
158
161
|
for (const a of def.getAliases() || []) {
|
|
@@ -266,7 +269,11 @@ class ObjectOriented {
|
|
|
266
269
|
return { method: undefined, def: undefined };
|
|
267
270
|
}
|
|
268
271
|
findMethod(def, methodName) {
|
|
269
|
-
|
|
272
|
+
const defs = def.getMethodDefinitions();
|
|
273
|
+
if (defs === undefined) {
|
|
274
|
+
return undefined;
|
|
275
|
+
}
|
|
276
|
+
for (const method of defs.getAll()) {
|
|
270
277
|
if (method.getName().toUpperCase() === methodName.toUpperCase()) {
|
|
271
278
|
if (method.isRedefinition()) {
|
|
272
279
|
return this.findMethodInSuper(def, methodName);
|
|
@@ -112,7 +112,7 @@ class Source {
|
|
|
112
112
|
const foundType = this.determineType(node, input, targetType);
|
|
113
113
|
const bodyType = new conv_body_1.ConvBody().runSyntax(node.findDirectExpression(Expressions.ConvBody), input);
|
|
114
114
|
if (new _type_utils_1.TypeUtils(input.scope).isAssignable(foundType, bodyType) === false) {
|
|
115
|
-
const message =
|
|
115
|
+
const message = `CONV: Types not compatible, ${foundType === null || foundType === void 0 ? void 0 : foundType.constructor.name}, ${bodyType === null || bodyType === void 0 ? void 0 : bodyType.constructor.name}`;
|
|
116
116
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
117
117
|
return new basic_1.VoidType(_syntax_input_1.CheckSyntaxKey);
|
|
118
118
|
}
|
|
@@ -7,30 +7,35 @@ const basic_1 = require("../../types/basic");
|
|
|
7
7
|
const _syntax_input_1 = require("../_syntax_input");
|
|
8
8
|
class SelectionScreen {
|
|
9
9
|
runSyntax(node, input) {
|
|
10
|
-
const
|
|
11
|
-
|
|
10
|
+
const blockNode = node.findFirstExpression(Expressions.BlockName);
|
|
11
|
+
const blockToken = blockNode === null || blockNode === void 0 ? void 0 : blockNode.getFirstToken();
|
|
12
|
+
const blockName = blockNode === null || blockNode === void 0 ? void 0 : blockNode.concatTokens();
|
|
13
|
+
if (blockName !== undefined && blockName.length > 16) {
|
|
14
|
+
const message = "SELECTION-SCREEN block name too long, " + blockName;
|
|
15
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
12
16
|
return;
|
|
13
17
|
}
|
|
14
|
-
|
|
18
|
+
const field = node.findFirstExpression(Expressions.InlineField);
|
|
19
|
+
if (field !== undefined && field.getFirstToken().getStr().length > 8) {
|
|
15
20
|
const message = "SELECTION-SCREEN name too long, " + field.getFirstToken().getStr();
|
|
16
21
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, field.getFirstToken(), message));
|
|
17
22
|
return;
|
|
18
23
|
}
|
|
19
|
-
const
|
|
24
|
+
const fieldName = field === null || field === void 0 ? void 0 : field.getFirstToken();
|
|
20
25
|
const concat = node.concatTokens().toUpperCase();
|
|
21
|
-
if (concat.includes("BEGIN OF TABBED BLOCK")) {
|
|
26
|
+
if (concat.includes("BEGIN OF TABBED BLOCK") && blockToken) {
|
|
22
27
|
const type = new basic_1.StructureType([
|
|
23
28
|
{ name: "PROG", type: new basic_1.CharacterType(40) },
|
|
24
29
|
{ name: "DYNNR", type: new basic_1.CharacterType(4) },
|
|
25
30
|
{ name: "ACTIVETAB", type: new basic_1.CharacterType(132) },
|
|
26
31
|
]);
|
|
27
|
-
input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(
|
|
32
|
+
input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(blockToken, input.filename, type, ["selection_screen_tab" /* IdentifierMeta.SelectionScreenTab */]));
|
|
28
33
|
}
|
|
29
|
-
else if (concat.startsWith("SELECTION-SCREEN TAB")) {
|
|
30
|
-
input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(
|
|
34
|
+
else if (concat.startsWith("SELECTION-SCREEN TAB") && fieldName) {
|
|
35
|
+
input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(fieldName, input.filename, new basic_1.CharacterType(83), ["selection_screen_tab" /* IdentifierMeta.SelectionScreenTab */]));
|
|
31
36
|
}
|
|
32
|
-
else {
|
|
33
|
-
input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(
|
|
37
|
+
else if (fieldName) {
|
|
38
|
+
input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(fieldName, input.filename, new basic_1.CharacterType(83)));
|
|
34
39
|
}
|
|
35
40
|
}
|
|
36
41
|
}
|
|
@@ -4,7 +4,7 @@ exports.CDSDetermineTypes = void 0;
|
|
|
4
4
|
const basic_1 = require("../abap/types/basic");
|
|
5
5
|
const ddic_1 = require("../ddic");
|
|
6
6
|
class CDSDetermineTypes {
|
|
7
|
-
parseType(reg, parsedData) {
|
|
7
|
+
parseType(reg, parsedData, ddlsName) {
|
|
8
8
|
const ddic = new ddic_1.DDIC(reg);
|
|
9
9
|
if ((parsedData === null || parsedData === void 0 ? void 0 : parsedData.fields.length) === 0) {
|
|
10
10
|
return new basic_1.VoidType("DDLS:todo");
|
|
@@ -30,7 +30,7 @@ class CDSDetermineTypes {
|
|
|
30
30
|
if ((source === null || source === void 0 ? void 0 : source.name) === undefined) {
|
|
31
31
|
components.push({
|
|
32
32
|
name: f.name,
|
|
33
|
-
type: new basic_1.UnknownType("CDS parser error, unknown source"),
|
|
33
|
+
type: new basic_1.UnknownType("CDS parser error, unknown source, " + ddlsName),
|
|
34
34
|
});
|
|
35
35
|
continue;
|
|
36
36
|
}
|
|
@@ -75,7 +75,7 @@ class CDSDetermineTypes {
|
|
|
75
75
|
else {
|
|
76
76
|
components.push({
|
|
77
77
|
name: f.name,
|
|
78
|
-
type: new basic_1.VoidType("DDLS:fieldname"),
|
|
78
|
+
type: new basic_1.VoidType("DDLS:fieldname:" + ddlsName),
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -38,7 +38,7 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
|
|
|
38
38
|
}
|
|
39
39
|
parseType(reg) {
|
|
40
40
|
this.parse();
|
|
41
|
-
return new cds_determine_types_1.CDSDetermineTypes().parseType(reg, this.parsedData);
|
|
41
|
+
return new cds_determine_types_1.CDSDetermineTypes().parseType(reg, this.parsedData, this.getName());
|
|
42
42
|
}
|
|
43
43
|
getParsedData() {
|
|
44
44
|
return this.parsedData;
|
package/build/src/registry.js
CHANGED
|
@@ -95,7 +95,11 @@ class SelectionScreenNaming extends _abap_rule_1.ABAPRule {
|
|
|
95
95
|
return statNode.findFirstExpression(expressions_1.FieldSub);
|
|
96
96
|
}
|
|
97
97
|
else if (statNode.get() instanceof statements_1.SelectionScreen) {
|
|
98
|
-
|
|
98
|
+
let ret = statNode.findFirstExpression(expressions_1.InlineField);
|
|
99
|
+
if (ret === undefined && statNode.concatTokens().toUpperCase().includes(" BEGIN OF TABBED BLOCK")) {
|
|
100
|
+
ret = statNode.findFirstExpression(expressions_1.BlockName);
|
|
101
|
+
}
|
|
102
|
+
return ret;
|
|
99
103
|
}
|
|
100
104
|
else {
|
|
101
105
|
return undefined;
|