@abaplint/core 2.113.234 → 2.113.236
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 +9 -6
- package/build/src/abap/2_statements/expressions/definition_name.js +1 -1
- package/build/src/abap/2_statements/expressions/sql_from.js +12 -2
- package/build/src/abap/2_statements/expressions/sql_in.js +2 -2
- package/build/src/abap/2_statements/statements/field.js +2 -2
- package/build/src/abap/2_statements/statements/perform.js +3 -1
- package/build/src/abap/5_syntax/basic_types.js +25 -0
- package/build/src/abap/5_syntax/statements/fieldsymbol.js +11 -4
- package/build/src/registry.js +8 -1
- package/package.json +2 -2
package/build/abaplint.d.ts
CHANGED
|
@@ -3908,6 +3908,7 @@ declare interface IReferenceExtras {
|
|
|
3908
3908
|
export declare interface IRegistry {
|
|
3909
3909
|
parse(): IRegistry;
|
|
3910
3910
|
parseAsync(input?: IRunInput): Promise<IRegistry>;
|
|
3911
|
+
clear(): void;
|
|
3911
3912
|
addDependencies(files: readonly IFile[]): IRegistry;
|
|
3912
3913
|
addDependency(file: IFile): IRegistry;
|
|
3913
3914
|
removeDependency(obj: IObject): void;
|
|
@@ -5615,15 +5616,17 @@ declare class RefreshControl implements IStatement {
|
|
|
5615
5616
|
}
|
|
5616
5617
|
|
|
5617
5618
|
export declare class Registry implements IRegistry {
|
|
5618
|
-
private
|
|
5619
|
-
private
|
|
5620
|
-
private
|
|
5621
|
-
private
|
|
5622
|
-
private
|
|
5623
|
-
private
|
|
5619
|
+
private objects;
|
|
5620
|
+
private objectsByType;
|
|
5621
|
+
private dependencies;
|
|
5622
|
+
private ddicReferences;
|
|
5623
|
+
private msagReferences;
|
|
5624
|
+
private macroReferences;
|
|
5624
5625
|
private errorNamespace;
|
|
5625
5626
|
private conf;
|
|
5626
5627
|
constructor(conf?: IConfiguration);
|
|
5628
|
+
/** clears all objects, keeping the configuration */
|
|
5629
|
+
clear(): void;
|
|
5627
5630
|
static abaplintVersion(): string;
|
|
5628
5631
|
getDDICReferences(): IDDICReferences;
|
|
5629
5632
|
getMSAGReferences(): IMSAGReferences;
|
|
@@ -5,7 +5,7 @@ const combi_1 = require("../combi");
|
|
|
5
5
|
const tokens_1 = require("../../1_lexer/tokens");
|
|
6
6
|
class DefinitionName extends combi_1.Expression {
|
|
7
7
|
getRunnable() {
|
|
8
|
-
const r = (0, combi_1.regex)(/^&|&?((\w*\/\w+\/)|(\w*\/\w+\/)?[\w
|
|
8
|
+
const r = (0, combi_1.regex)(/^&|&?((\w*\/\w+\/)|(\w*\/\w+\/)?[\w\*$%\?#]+)$/);
|
|
9
9
|
return (0, combi_1.seq)(r, (0, combi_1.starPrio)((0, combi_1.seq)((0, combi_1.tok)(tokens_1.Dash), (0, combi_1.optPrio)(r))), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.DashW)));
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -5,9 +5,19 @@ const combi_1 = require("../combi");
|
|
|
5
5
|
const tokens_1 = require("../../1_lexer/tokens");
|
|
6
6
|
const _1 = require(".");
|
|
7
7
|
class SQLFrom extends combi_1.Expression {
|
|
8
|
+
// todo: rewrite/refactor this method
|
|
8
9
|
getRunnable() {
|
|
9
|
-
const
|
|
10
|
-
|
|
10
|
+
const joins = (0, combi_1.starPrio)((0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), _1.SQLJoin));
|
|
11
|
+
// No opening parens
|
|
12
|
+
const from0 = (0, combi_1.seq)("FROM", _1.SQLFromSource, joins);
|
|
13
|
+
// 1 to 6 opening parens, with up to that many closing parens at the end
|
|
14
|
+
const from1 = (0, combi_1.seq)("FROM", (0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFromSource, joins, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
15
|
+
const from2 = (0, combi_1.seq)("FROM", (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFromSource, joins, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
16
|
+
const from3 = (0, combi_1.seq)("FROM", (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFromSource, joins, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
17
|
+
const from4 = (0, combi_1.seq)("FROM", (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFromSource, joins, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
18
|
+
const from5 = (0, combi_1.seq)("FROM", (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFromSource, joins, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
19
|
+
const from6 = (0, combi_1.seq)("FROM", (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFromSource, joins, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
20
|
+
const source = (0, combi_1.altPrio)(from6, from5, from4, from3, from2, from1, from0);
|
|
11
21
|
return source;
|
|
12
22
|
}
|
|
13
23
|
}
|
|
@@ -12,9 +12,9 @@ class SQLIn extends combi_1.Expression {
|
|
|
12
12
|
const listOld = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeft), (0, combi_1.alt)((0, combi_1.ver)(version_1.Version.v740sp05, short, version_1.Version.OpenABAP), val), (0, combi_1.starPrio)((0, combi_1.seq)(",", val)), (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenRight), (0, combi_1.tok)(tokens_1.ParenRightW), (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
13
13
|
const listNew = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), val, (0, combi_1.starPrio)((0, combi_1.seq)(",", (0, combi_1.altPrio)(short, val))), (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WParenRight), (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
14
14
|
// version is a guess, https://github.com/abaplint/abaplint/issues/2530
|
|
15
|
-
const
|
|
15
|
+
const listNeww = (0, combi_1.ver)(version_1.Version.v740sp02, listNew, version_1.Version.OpenABAP);
|
|
16
16
|
const subSelect = (0, combi_1.seq)("(", _1.Select, ")");
|
|
17
|
-
const inn = (0, combi_1.seq)("IN", (0, combi_1.altPrio)(
|
|
17
|
+
const inn = (0, combi_1.seq)("IN", (0, combi_1.altPrio)(subSelect, listOld, listNeww, _1.SQLSource));
|
|
18
18
|
return inn;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -7,12 +7,12 @@ const version_1 = require("../../../version");
|
|
|
7
7
|
const tokens_1 = require("../../1_lexer/tokens");
|
|
8
8
|
class Field {
|
|
9
9
|
getMatcher() {
|
|
10
|
-
const module = (0, combi_1.seq)("MODULE", expressions_1.FormName, (0, combi_1.opt)((0, combi_1.alt)("ON INPUT", "ON REQUEST", "ON CHAIN-REQUEST")));
|
|
10
|
+
const module = (0, combi_1.seq)("MODULE", expressions_1.FormName, (0, combi_1.opt)((0, combi_1.alt)("ON INPUT", "ON REQUEST", "ON CHAIN-REQUEST", "AT CURSOR-SELECTION")));
|
|
11
11
|
const values = (0, combi_1.seq)("VALUES", (0, combi_1.tok)(tokens_1.WParenLeft), "BETWEEN", expressions_1.Constant, "AND", expressions_1.Constant, (0, combi_1.tok)(tokens_1.ParenRightW));
|
|
12
12
|
const wit = (0, combi_1.seq)("WITH", expressions_1.FieldChain);
|
|
13
13
|
const cond = (0, combi_1.seq)(expressions_1.FieldChain, "=", expressions_1.FieldChain);
|
|
14
14
|
const where = (0, combi_1.seq)(cond, (0, combi_1.starPrio)((0, combi_1.seq)("AND", cond)));
|
|
15
|
-
const select = (0, combi_1.seq)("SELECT * FROM", expressions_1.FieldChain, "WHERE", where, "INTO RESULT WHENEVER NOT FOUND SEND ERRORMESSAGE");
|
|
15
|
+
const select = (0, combi_1.seq)("SELECT * FROM", expressions_1.FieldChain, "WHERE", where, (0, combi_1.opt)("INTO RESULT WHENEVER NOT FOUND SEND ERRORMESSAGE"));
|
|
16
16
|
const ret = (0, combi_1.seq)("FIELD", expressions_1.FieldChain, (0, combi_1.opt)((0, combi_1.altPrio)(module, values, wit, select)));
|
|
17
17
|
return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
|
|
18
18
|
}
|
|
@@ -14,7 +14,9 @@ class Perform {
|
|
|
14
14
|
const program = (0, combi_1.seq)("IN PROGRAM", (0, combi_1.opt)((0, combi_1.alt)(Expressions.Dynamic, Expressions.IncludeName)));
|
|
15
15
|
const found = (0, combi_1.str)("IF FOUND");
|
|
16
16
|
const full = (0, combi_1.seq)((0, combi_1.alt)(Expressions.FormName, Expressions.Dynamic), (0, combi_1.opt)((0, combi_1.verNot)(version_1.Version.Cloud, program)));
|
|
17
|
-
const
|
|
17
|
+
const normal = (0, combi_1.seq)((0, combi_1.opt)(found), (0, combi_1.opt)(expressions_1.PerformTables), (0, combi_1.opt)(expressions_1.PerformUsing), (0, combi_1.opt)(expressions_1.PerformChanging), (0, combi_1.opt)(found), (0, combi_1.opt)(commit));
|
|
18
|
+
const of = (0, combi_1.seq)("OF", (0, combi_1.plus)(Expressions.FormName));
|
|
19
|
+
const ret = (0, combi_1.seq)("PERFORM", (0, combi_1.alt)(short, full), (0, combi_1.altPrio)(of, normal));
|
|
18
20
|
return ret;
|
|
19
21
|
}
|
|
20
22
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BasicTypes = void 0;
|
|
4
4
|
const _typed_identifier_1 = require("../types/_typed_identifier");
|
|
5
|
+
const nodes_1 = require("../nodes");
|
|
5
6
|
const Expressions = require("../2_statements/expressions");
|
|
6
7
|
const Statements = require("../2_statements/statements");
|
|
7
8
|
const Types = require("../types/basic");
|
|
@@ -158,6 +159,30 @@ class BasicTypes {
|
|
|
158
159
|
type = new basic_1.TableType(type.getRowType(), { withHeader: false, keyType: Types.TableKeyType.default });
|
|
159
160
|
}
|
|
160
161
|
}
|
|
162
|
+
else if (child instanceof nodes_1.ExpressionNode && child.get() instanceof Expressions.FieldLength) {
|
|
163
|
+
const len = parseInt(child.concatTokens().replace("(", "").replace(")", ""), 10);
|
|
164
|
+
if (isNaN(len)) {
|
|
165
|
+
type = new Types.UnknownType("Type error, invalid field length");
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
if (type instanceof Types.DateType) {
|
|
169
|
+
if (len > 8) {
|
|
170
|
+
type = new Types.UnknownType("Type error, offset too long");
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
type = new Types.CharacterType(len);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
else if (type instanceof Types.CharacterType) {
|
|
177
|
+
if (len <= type.getLength()) {
|
|
178
|
+
type = new Types.CharacterType(len);
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
type = new Types.UnknownType("Type error, offset too long");
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
161
186
|
else { // field name
|
|
162
187
|
if (type instanceof Types.TableType) {
|
|
163
188
|
type = type.getRowType();
|
|
@@ -5,18 +5,25 @@ const Expressions = require("../../2_statements/expressions");
|
|
|
5
5
|
const _typed_identifier_1 = require("../../types/_typed_identifier");
|
|
6
6
|
const basic_types_1 = require("../basic_types");
|
|
7
7
|
const unknown_type_1 = require("../../types/basic/unknown_type");
|
|
8
|
+
const basic_1 = require("../../types/basic");
|
|
8
9
|
class FieldSymbol {
|
|
9
10
|
runSyntax(node, input) {
|
|
10
11
|
var _a;
|
|
11
12
|
const fsname = (_a = node.findFirstExpression(Expressions.FieldSymbol)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
13
|
+
if (fsname === undefined) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (node.getChildren().length === 5) {
|
|
17
|
+
// no type specified
|
|
18
|
+
input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(fsname, input.filename, basic_1.VoidType.get("FS-SIMPLE")));
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
12
21
|
const bfound = new basic_types_1.BasicTypes(input).parseType(node);
|
|
13
|
-
if (bfound
|
|
22
|
+
if (bfound) {
|
|
14
23
|
input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(fsname, input.filename, bfound));
|
|
15
24
|
return;
|
|
16
25
|
}
|
|
17
|
-
|
|
18
|
-
input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(fsname, input.filename, new unknown_type_1.UnknownType("Fieldsymbol, fallback")));
|
|
19
|
-
}
|
|
26
|
+
input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(fsname, input.filename, new unknown_type_1.UnknownType("Fieldsymbol, fallback")));
|
|
20
27
|
}
|
|
21
28
|
}
|
|
22
29
|
exports.FieldSymbol = FieldSymbol;
|
package/build/src/registry.js
CHANGED
|
@@ -61,13 +61,20 @@ class Registry {
|
|
|
61
61
|
this.objectsByType = {};
|
|
62
62
|
this.dependencies = {};
|
|
63
63
|
this.setConfig(conf ? conf : config_1.Config.getDefault());
|
|
64
|
+
this.clear();
|
|
65
|
+
}
|
|
66
|
+
/** clears all objects, keeping the configuration */
|
|
67
|
+
clear() {
|
|
68
|
+
this.objects = {};
|
|
69
|
+
this.objectsByType = {};
|
|
70
|
+
this.dependencies = {};
|
|
64
71
|
this.ddicReferences = new ddic_references_1.DDICReferences();
|
|
65
72
|
this.msagReferences = new msag_references_1.MSAGReferences();
|
|
66
73
|
this.macroReferences = new macro_references_1.MacroReferences();
|
|
67
74
|
}
|
|
68
75
|
static abaplintVersion() {
|
|
69
76
|
// magic, see build script "version.sh"
|
|
70
|
-
return "2.113.
|
|
77
|
+
return "2.113.236";
|
|
71
78
|
}
|
|
72
79
|
getDDICReferences() {
|
|
73
80
|
return this.ddicReferences;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.113.
|
|
3
|
+
"version": "2.113.236",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
},
|
|
51
51
|
"homepage": "https://abaplint.org",
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@microsoft/api-extractor": "^7.53.
|
|
53
|
+
"@microsoft/api-extractor": "^7.53.3",
|
|
54
54
|
"@types/chai": "^4.3.20",
|
|
55
55
|
"@types/mocha": "^10.0.10",
|
|
56
56
|
"@types/node": "^24.9.1",
|