@abaplint/transpiler-cli 2.12.11 → 2.12.12
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/bundle.js +61 -40
- package/package.json +3 -3
package/build/bundle.js
CHANGED
|
@@ -7266,11 +7266,14 @@ class SQLField extends combi_1.Expression {
|
|
|
7266
7266
|
getRunnable() {
|
|
7267
7267
|
const abap = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), _1.SimpleFieldChain2), version_1.Version.OpenABAP);
|
|
7268
7268
|
const as = (0, combi_1.seq)("AS", _1.SQLAsName);
|
|
7269
|
-
const
|
|
7270
|
-
const field = (0, combi_1.altPrio)(_1.SQLAggregation, _1.SQLCase, _1.SQLCast, sql_function_1.SQLFunction, sql_path_1.SQLPath, _1.SQLFieldName, abap, _1.Constant,
|
|
7271
|
-
const
|
|
7269
|
+
const parenFieldName = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFieldName, (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WParenRightW), (0, combi_1.tok)(tokens_1.WParenRight)));
|
|
7270
|
+
const field = (0, combi_1.altPrio)(_1.SQLAggregation, _1.SQLCase, _1.SQLCast, sql_function_1.SQLFunction, sql_path_1.SQLPath, _1.SQLFieldName, abap, _1.Constant, parenFieldName);
|
|
7271
|
+
const parenField = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), field, (0, combi_1.tok)(tokens_1.WParenRightW));
|
|
7272
|
+
const sub = (0, combi_1.plusPrio)((0, combi_1.seq)((0, combi_1.altPrio)("+", "-", "*", "/", "&&"), (0, combi_1.altPrio)(parenField, field)));
|
|
7272
7273
|
const arith = (0, combi_1.ver)(version_1.Version.v740sp05, sub);
|
|
7273
|
-
|
|
7274
|
+
const arithSequence = (0, combi_1.seq)(field, (0, combi_1.optPrio)(arith));
|
|
7275
|
+
const parenArithSequence = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), arithSequence, (0, combi_1.tok)(tokens_1.WParenRightW));
|
|
7276
|
+
return (0, combi_1.seq)((0, combi_1.altPrio)(parenArithSequence, arithSequence), (0, combi_1.optPrio)(as));
|
|
7274
7277
|
}
|
|
7275
7278
|
}
|
|
7276
7279
|
exports.SQLField = SQLField;
|
|
@@ -10728,17 +10731,18 @@ class Convert {
|
|
|
10728
10731
|
const intoTime = (0, combi_1.seq)("TIME", expressions_1.Target);
|
|
10729
10732
|
const intoDate = (0, combi_1.seq)("DATE", expressions_1.Target);
|
|
10730
10733
|
const into = (0, combi_1.seq)("INTO", (0, combi_1.per)(intoTime, intoDate));
|
|
10731
|
-
const
|
|
10734
|
+
const daylightSource = (0, combi_1.seq)("DAYLIGHT SAVING TIME", expressions_1.Source);
|
|
10735
|
+
const daylightTarget = (0, combi_1.seq)("DAYLIGHT SAVING TIME", expressions_1.Target);
|
|
10732
10736
|
const zone = (0, combi_1.seq)("TIME ZONE", expressions_1.Source);
|
|
10733
|
-
const time = (0, combi_1.seq)("TIME STAMP", expressions_1.Source, (0, combi_1.per)(zone, into,
|
|
10737
|
+
const time = (0, combi_1.seq)("TIME STAMP", expressions_1.Source, (0, combi_1.per)(zone, into, daylightTarget));
|
|
10734
10738
|
const dat = (0, combi_1.seq)("DATE", expressions_1.Source);
|
|
10735
10739
|
const tim = (0, combi_1.seq)("TIME", expressions_1.Source);
|
|
10736
10740
|
const stamp = (0, combi_1.seq)("INTO TIME STAMP", expressions_1.Target);
|
|
10737
10741
|
const intoutc = (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("INTO UTCLONG", expressions_1.Target));
|
|
10738
10742
|
const invert = (0, combi_1.seq)("INTO INVERTED-DATE", expressions_1.Target);
|
|
10739
|
-
const date = (0, combi_1.seq)((0, combi_1.per)(dat, tim), (0, combi_1.per)(
|
|
10743
|
+
const date = (0, combi_1.seq)((0, combi_1.per)(dat, tim), (0, combi_1.per)(daylightSource, stamp, zone, invert, intoutc));
|
|
10740
10744
|
const inv = (0, combi_1.seq)("INVERTED-DATE", expressions_1.Source, "INTO DATE", expressions_1.Target);
|
|
10741
|
-
const utclong = (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("UTCLONG", expressions_1.Source, (0, combi_1.per)(zone, into,
|
|
10745
|
+
const utclong = (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("UTCLONG", expressions_1.Source, (0, combi_1.per)(zone, into, daylightSource)));
|
|
10742
10746
|
return (0, combi_1.seq)("CONVERT", (0, combi_1.alt)(time, date, inv, utclong));
|
|
10743
10747
|
}
|
|
10744
10748
|
}
|
|
@@ -23101,7 +23105,6 @@ class BasicTypes {
|
|
|
23101
23105
|
return undefined;
|
|
23102
23106
|
}
|
|
23103
23107
|
resolveLikeName(node, headerLogic = true) {
|
|
23104
|
-
var _a;
|
|
23105
23108
|
if (node === undefined) {
|
|
23106
23109
|
return undefined;
|
|
23107
23110
|
}
|
|
@@ -23147,7 +23150,12 @@ class BasicTypes {
|
|
|
23147
23150
|
this.input.scope.addReference(chain === null || chain === void 0 ? void 0 : chain.getFirstToken(), found, _reference_1.ReferenceType.TypeReference, this.input.filename);
|
|
23148
23151
|
}
|
|
23149
23152
|
if (type === undefined) {
|
|
23150
|
-
|
|
23153
|
+
const found = this.input.scope.getDDIC().lookupNoVoid(name);
|
|
23154
|
+
if (found !== undefined) {
|
|
23155
|
+
const using = { filename: this.input.filename, token: chain.getFirstToken(), object: found.object };
|
|
23156
|
+
this.input.scope.getDDICReferences().addUsing(this.input.scope.getParentObj(), using);
|
|
23157
|
+
}
|
|
23158
|
+
type = found === null || found === void 0 ? void 0 : found.type;
|
|
23151
23159
|
}
|
|
23152
23160
|
if (type === undefined && this.input.scope.isAnyOO() === false && this.input.scope.getDDIC().inErrorNamespace(name) === false) {
|
|
23153
23161
|
this.input.scope.addReference(chain.getChildren()[0].getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.input.filename);
|
|
@@ -24524,7 +24532,9 @@ class ComponentName {
|
|
|
24524
24532
|
return ret;
|
|
24525
24533
|
}
|
|
24526
24534
|
}
|
|
24527
|
-
|
|
24535
|
+
if (!(context instanceof Basic.UnknownType)) {
|
|
24536
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, nameToken, "Not a structure, ComponentName, \"" + name + "\", (" + (context === null || context === void 0 ? void 0 : context.constructor.name) + ")"));
|
|
24537
|
+
}
|
|
24528
24538
|
return Basic.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
24529
24539
|
}
|
|
24530
24540
|
}
|
|
@@ -27843,7 +27853,7 @@ class SQLForAllEntries {
|
|
|
27843
27853
|
}
|
|
27844
27854
|
if (s) {
|
|
27845
27855
|
const type = source_1.Source.runSyntax(s, input);
|
|
27846
|
-
if (type instanceof basic_1.VoidType) {
|
|
27856
|
+
if (type instanceof basic_1.VoidType || type instanceof basic_1.UnknownType) {
|
|
27847
27857
|
return;
|
|
27848
27858
|
}
|
|
27849
27859
|
if (!(type instanceof basic_1.TableType)) {
|
|
@@ -28198,8 +28208,9 @@ class Target {
|
|
|
28198
28208
|
currentIndex++;
|
|
28199
28209
|
if (current.get() instanceof tokens_1.Dash) {
|
|
28200
28210
|
if (context instanceof unknown_type_1.UnknownType) {
|
|
28201
|
-
|
|
28202
|
-
|
|
28211
|
+
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
28212
|
+
}
|
|
28213
|
+
else if (context instanceof basic_1.TableType && context.isWithHeader() && context.getRowType() instanceof unknown_type_1.UnknownType) {
|
|
28203
28214
|
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
28204
28215
|
}
|
|
28205
28216
|
else if (!(context instanceof basic_1.StructureType)
|
|
@@ -30194,14 +30205,21 @@ class Convert {
|
|
|
30194
30205
|
for (const s of node.findDirectExpressions(Expressions.Source)) {
|
|
30195
30206
|
source_1.Source.runSyntax(s, input);
|
|
30196
30207
|
}
|
|
30197
|
-
const
|
|
30198
|
-
|
|
30199
|
-
const
|
|
30200
|
-
if (
|
|
30201
|
-
|
|
30202
|
-
|
|
30203
|
-
|
|
30204
|
-
|
|
30208
|
+
const timeTargets = node.findExpressionsAfterToken("TIME");
|
|
30209
|
+
for (const timeTarget of timeTargets) {
|
|
30210
|
+
const concat = node.concatTokens().toUpperCase();
|
|
30211
|
+
if ((timeTarget === null || timeTarget === void 0 ? void 0 : timeTarget.get()) instanceof Expressions.Target) {
|
|
30212
|
+
const inline = timeTarget === null || timeTarget === void 0 ? void 0 : timeTarget.findDirectExpression(Expressions.InlineData);
|
|
30213
|
+
if (inline) {
|
|
30214
|
+
let targetType = new basic_1.TimeType();
|
|
30215
|
+
if (concat.includes("DAYLIGHT SAVING TIME " + inline.concatTokens().toUpperCase())) {
|
|
30216
|
+
targetType = new basic_1.CharacterType(1);
|
|
30217
|
+
}
|
|
30218
|
+
inline_data_1.InlineData.runSyntax(inline, input, targetType);
|
|
30219
|
+
}
|
|
30220
|
+
else {
|
|
30221
|
+
target_1.Target.runSyntax(timeTarget, input);
|
|
30222
|
+
}
|
|
30205
30223
|
}
|
|
30206
30224
|
}
|
|
30207
30225
|
const dateTarget = node.findExpressionAfterToken("DATE");
|
|
@@ -31519,27 +31537,27 @@ const basic_types_1 = __webpack_require__(/*! ../basic_types */ "./node_modules/
|
|
|
31519
31537
|
const _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifier */ "./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js");
|
|
31520
31538
|
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
|
|
31521
31539
|
const assert_error_1 = __webpack_require__(/*! ../assert_error */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/assert_error.js");
|
|
31540
|
+
const _reference_1 = __webpack_require__(/*! ../_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
|
|
31522
31541
|
class IncludeType {
|
|
31523
31542
|
runSyntax(node, input) {
|
|
31524
|
-
var _a, _b
|
|
31543
|
+
var _a, _b;
|
|
31525
31544
|
const components = [];
|
|
31526
31545
|
const iname = node.findFirstExpression(Expressions.TypeName);
|
|
31527
31546
|
if (iname === undefined) {
|
|
31528
31547
|
throw new assert_error_1.AssertError("IncludeType, unexpected node structure");
|
|
31529
31548
|
}
|
|
31530
|
-
const
|
|
31549
|
+
const firstToken = iname.getFirstToken();
|
|
31550
|
+
const name = firstToken.getStr();
|
|
31531
31551
|
const isStructure = node.findDirectTokenByText("STRUCTURE") !== undefined;
|
|
31532
31552
|
let ityp = new basic_types_1.BasicTypes(input).parseType(iname);
|
|
31533
|
-
if (ityp instanceof basic_1.VoidType && isStructure) {
|
|
31534
|
-
const found =
|
|
31553
|
+
if ((ityp instanceof basic_1.VoidType && isStructure) || ityp instanceof basic_1.UnknownType) {
|
|
31554
|
+
const found = input.scope.findVariable(name);
|
|
31535
31555
|
if (found) {
|
|
31536
|
-
|
|
31556
|
+
input.scope.addReference(firstToken, found, _reference_1.ReferenceType.DataReadReference, input.filename);
|
|
31557
|
+
ityp = found.getType();
|
|
31537
31558
|
}
|
|
31538
31559
|
}
|
|
31539
|
-
|
|
31540
|
-
ityp = (_c = (_b = input.scope.findVariable(name)) === null || _b === void 0 ? void 0 : _b.getType()) !== null && _c !== void 0 ? _c : ityp;
|
|
31541
|
-
}
|
|
31542
|
-
const as = (_d = node.findExpressionAfterToken("AS")) === null || _d === void 0 ? void 0 : _d.concatTokens();
|
|
31560
|
+
const as = (_a = node.findExpressionAfterToken("AS")) === null || _a === void 0 ? void 0 : _a.concatTokens();
|
|
31543
31561
|
if (as && ityp instanceof basic_1.StructureType) {
|
|
31544
31562
|
ityp = new basic_1.StructureType(ityp.getComponents().concat([{
|
|
31545
31563
|
name: as,
|
|
@@ -31561,7 +31579,7 @@ class IncludeType {
|
|
|
31561
31579
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, iname.getFirstToken(), message));
|
|
31562
31580
|
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
31563
31581
|
}
|
|
31564
|
-
const suffix = (
|
|
31582
|
+
const suffix = (_b = node.findExpressionAfterToken("SUFFIX")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
31565
31583
|
if (suffix && ityp instanceof basic_1.StructureType) {
|
|
31566
31584
|
const components = [];
|
|
31567
31585
|
for (const c of ityp.getComponents()) {
|
|
@@ -32960,6 +32978,9 @@ class ReadTable {
|
|
|
32960
32978
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
32961
32979
|
return;
|
|
32962
32980
|
}
|
|
32981
|
+
else if (sourceType instanceof basic_1.UnknownType) {
|
|
32982
|
+
// do nothing, ok
|
|
32983
|
+
}
|
|
32963
32984
|
else if (!(sourceType instanceof basic_1.TableType) && !(sourceType instanceof basic_1.VoidType)) {
|
|
32964
32985
|
const message = "Read table, not a table type";
|
|
32965
32986
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
@@ -53783,7 +53804,7 @@ class Registry {
|
|
|
53783
53804
|
}
|
|
53784
53805
|
static abaplintVersion() {
|
|
53785
53806
|
// magic, see build script "version.sh"
|
|
53786
|
-
return "2.113.
|
|
53807
|
+
return "2.113.246";
|
|
53787
53808
|
}
|
|
53788
53809
|
getDDICReferences() {
|
|
53789
53810
|
return this.ddicReferences;
|
|
@@ -78784,13 +78805,13 @@ class CompareTranspiler {
|
|
|
78784
78805
|
const field = concat.replace(" IS NOT REQUESTED", "").toLowerCase();
|
|
78785
78806
|
return new chunk_1.Chunk().appendString(pre + "INPUT && INPUT." + field + " === undefined && INPUT.importing?." + field + " === undefined");
|
|
78786
78807
|
}
|
|
78787
|
-
if (concat.
|
|
78788
|
-
const
|
|
78789
|
-
|
|
78790
|
-
|
|
78791
|
-
|
|
78792
|
-
const
|
|
78793
|
-
return new chunk_1.Chunk().appendString("abap.compare.instance_of(").appendChunk(s0).appendString(`, ${
|
|
78808
|
+
if (concat.includes(" IS INSTANCE OF ")) {
|
|
78809
|
+
const notted = concat.startsWith("NOT ") || concat.includes(" IS NOT INSTANCE OF ");
|
|
78810
|
+
const falsed = notted ? " === false" : "";
|
|
78811
|
+
const expr = node.findDirectExpression(core_1.Expressions.ClassName);
|
|
78812
|
+
const cname = expr?.concatTokens();
|
|
78813
|
+
const lookup = traversal.lookupClassOrInterface(cname, expr?.getFirstToken());
|
|
78814
|
+
return new chunk_1.Chunk().appendString("abap.compare.instance_of(").appendChunk(s0).appendString(`, ${lookup})` + falsed);
|
|
78794
78815
|
}
|
|
78795
78816
|
}
|
|
78796
78817
|
else if (sources.length === 2 && node.findDirectTokenByText("IN")) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.12.
|
|
3
|
+
"version": "2.12.12",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"author": "abaplint",
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@abaplint/core": "^2.113.
|
|
31
|
-
"@abaplint/transpiler": "^2.12.
|
|
30
|
+
"@abaplint/core": "^2.113.246",
|
|
31
|
+
"@abaplint/transpiler": "^2.12.12",
|
|
32
32
|
"@types/glob": "^8.1.0",
|
|
33
33
|
"@types/node": "^24.10.1",
|
|
34
34
|
"@types/progress": "^2.0.7",
|