@abaplint/transpiler-cli 2.5.70 → 2.5.72
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 +135 -43
- package/package.json +4 -4
package/build/bundle.js
CHANGED
|
@@ -6611,9 +6611,10 @@ class SQLFunction extends combi_1.Expression {
|
|
|
6611
6611
|
const lower = (0, combi_1.ver)(version_1.Version.v751, (0, combi_1.seq)("lower", (0, combi_1.tok)(tokens_1.ParenLeftW), param, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
6612
6612
|
const mod = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("mod", (0, combi_1.tok)(tokens_1.ParenLeftW), param, ",", param, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
6613
6613
|
const replace = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("replace", (0, combi_1.tok)(tokens_1.ParenLeftW), param, ",", param, ",", param, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
6614
|
+
const round = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("round", (0, combi_1.tok)(tokens_1.ParenLeftW), param, ",", param, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
6614
6615
|
const upper = (0, combi_1.ver)(version_1.Version.v751, (0, combi_1.seq)("upper", (0, combi_1.tok)(tokens_1.ParenLeftW), param, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
6615
6616
|
const uuid = (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("uuid", (0, combi_1.tok)(tokens_1.ParenLeftW), (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
6616
|
-
return (0, combi_1.altPrio)(uuid, abs, ceil, floor, cast, div, mod, coalesce, concat, replace, length, lower, upper);
|
|
6617
|
+
return (0, combi_1.altPrio)(uuid, abs, ceil, floor, cast, div, mod, coalesce, concat, replace, length, lower, upper, round);
|
|
6617
6618
|
}
|
|
6618
6619
|
}
|
|
6619
6620
|
exports.SQLFunction = SQLFunction;
|
|
@@ -20791,13 +20792,18 @@ class BasicTypes {
|
|
|
20791
20792
|
return undefined;
|
|
20792
20793
|
}
|
|
20793
20794
|
let type = undefined;
|
|
20794
|
-
if (text.startsWith("TYPE STANDARD TABLE ")
|
|
20795
|
+
if (text.startsWith("TYPE STANDARD TABLE ")
|
|
20796
|
+
|| text.startsWith("TYPE TABLE ")
|
|
20797
|
+
|| text.startsWith("LIKE TABLE ")
|
|
20798
|
+
|| text.startsWith("LIKE STANDARD TABLE ")) {
|
|
20795
20799
|
type = basic_1.TableAccessType.standard;
|
|
20796
20800
|
}
|
|
20797
|
-
else if (text.startsWith("TYPE SORTED TABLE ")
|
|
20801
|
+
else if (text.startsWith("TYPE SORTED TABLE ")
|
|
20802
|
+
|| text.startsWith("LIKE SORTED TABLE ")) {
|
|
20798
20803
|
type = basic_1.TableAccessType.sorted;
|
|
20799
20804
|
}
|
|
20800
|
-
else if (text.startsWith("TYPE HASHED TABLE ")
|
|
20805
|
+
else if (text.startsWith("TYPE HASHED TABLE ")
|
|
20806
|
+
|| text.startsWith("LIKE HASHED TABLE ")) {
|
|
20801
20807
|
type = basic_1.TableAccessType.hashed;
|
|
20802
20808
|
}
|
|
20803
20809
|
const typeTableKeys = node.findAllExpressions(expressions_1.TypeTableKey);
|
|
@@ -20814,6 +20820,9 @@ class BasicTypes {
|
|
|
20814
20820
|
for (const k of (firstKey === null || firstKey === void 0 ? void 0 : firstKey.findDirectExpressions(expressions_1.FieldSub)) || []) {
|
|
20815
20821
|
primaryKey.keyFields.push(k.concatTokens().toUpperCase());
|
|
20816
20822
|
}
|
|
20823
|
+
if (primaryKey.keyFields.length === 0 && text.includes(" DEFAULT KEY")) {
|
|
20824
|
+
primaryKey.keyFields.push("TABLE_LINE");
|
|
20825
|
+
}
|
|
20817
20826
|
}
|
|
20818
20827
|
else {
|
|
20819
20828
|
start = 0;
|
|
@@ -20888,6 +20897,7 @@ class BasicTypes {
|
|
|
20888
20897
|
{ name: "low", type: found },
|
|
20889
20898
|
{ name: "high", type: found },
|
|
20890
20899
|
]);
|
|
20900
|
+
options.primaryKey.type = basic_1.TableAccessType.standard;
|
|
20891
20901
|
return new Types.TableType(structure, options, name);
|
|
20892
20902
|
}
|
|
20893
20903
|
else if (text.startsWith("LIKE RANGE OF ")) {
|
|
@@ -20902,6 +20912,7 @@ class BasicTypes {
|
|
|
20902
20912
|
{ name: "low", type: found },
|
|
20903
20913
|
{ name: "high", type: found },
|
|
20904
20914
|
], name);
|
|
20915
|
+
options.primaryKey.type = basic_1.TableAccessType.standard;
|
|
20905
20916
|
return new Types.TableType(structure, options);
|
|
20906
20917
|
}
|
|
20907
20918
|
else if (typename && (text.startsWith("TYPE TABLE FOR CREATE ")
|
|
@@ -23234,8 +23245,10 @@ class MethodDefReturning {
|
|
|
23234
23245
|
if (type === undefined) {
|
|
23235
23246
|
throw new Error("method_parameter.ts, unexpected structure");
|
|
23236
23247
|
}
|
|
23237
|
-
|
|
23238
|
-
|
|
23248
|
+
let found = new basic_types_1.BasicTypes(filename, scope).parseType(type);
|
|
23249
|
+
if ((found === null || found === void 0 ? void 0 : found.isGeneric()) === true) {
|
|
23250
|
+
found = new basic_1.UnknownType("RETURNING parameter must be fully specified");
|
|
23251
|
+
}
|
|
23239
23252
|
if (found) {
|
|
23240
23253
|
return new _typed_identifier_1.TypedIdentifier(name.getFirstToken(), filename, found, meta);
|
|
23241
23254
|
}
|
|
@@ -26459,7 +26472,12 @@ class Data {
|
|
|
26459
26472
|
runSyntax(node, scope, filename) {
|
|
26460
26473
|
const dd = node.findFirstExpression(Expressions.DataDefinition);
|
|
26461
26474
|
if (dd) {
|
|
26462
|
-
|
|
26475
|
+
const id = new data_definition_1.DataDefinition().runSyntax(dd, scope, filename);
|
|
26476
|
+
if ((id === null || id === void 0 ? void 0 : id.getType().isGeneric()) === true
|
|
26477
|
+
&& (id === null || id === void 0 ? void 0 : id.getType().containsVoid()) === false) {
|
|
26478
|
+
throw new Error("DATA definition cannot be generic");
|
|
26479
|
+
}
|
|
26480
|
+
return id;
|
|
26463
26481
|
}
|
|
26464
26482
|
const name = node.findFirstExpression(Expressions.DefinitionName);
|
|
26465
26483
|
if (name) {
|
|
@@ -32696,7 +32714,8 @@ class DataReference extends _abstract_type_1.AbstractType {
|
|
|
32696
32714
|
return "REF TO " + this.type.toABAP();
|
|
32697
32715
|
}
|
|
32698
32716
|
isGeneric() {
|
|
32699
|
-
|
|
32717
|
+
// a DATA definition can be "REF TO data", so its not generic
|
|
32718
|
+
return false;
|
|
32700
32719
|
}
|
|
32701
32720
|
containsVoid() {
|
|
32702
32721
|
return this.type.containsVoid();
|
|
@@ -32970,7 +32989,8 @@ class GenericObjectReferenceType extends _abstract_type_1.AbstractType {
|
|
|
32970
32989
|
return "```REF TO object```";
|
|
32971
32990
|
}
|
|
32972
32991
|
isGeneric() {
|
|
32973
|
-
|
|
32992
|
+
// a DATA definition can be "REF TO object", so its not generic
|
|
32993
|
+
return false;
|
|
32974
32994
|
}
|
|
32975
32995
|
toABAP() {
|
|
32976
32996
|
return "REF TO object";
|
|
@@ -33476,6 +33496,11 @@ class TableType extends _abstract_type_1.AbstractType {
|
|
|
33476
33496
|
}
|
|
33477
33497
|
}
|
|
33478
33498
|
isGeneric() {
|
|
33499
|
+
var _a, _b;
|
|
33500
|
+
if (((_a = this.options.primaryKey) === null || _a === void 0 ? void 0 : _a.type) !== TableAccessType.standard
|
|
33501
|
+
&& ((_b = this.options.primaryKey) === null || _b === void 0 ? void 0 : _b.keyFields.length) === 0) {
|
|
33502
|
+
return true;
|
|
33503
|
+
}
|
|
33479
33504
|
return this.rowType.isGeneric();
|
|
33480
33505
|
}
|
|
33481
33506
|
containsVoid() {
|
|
@@ -34995,6 +35020,7 @@ class MethodParameters {
|
|
|
34995
35020
|
}
|
|
34996
35021
|
if (node.concatTokens().toUpperCase().includes(" FOR VALIDATE ")
|
|
34997
35022
|
|| node.concatTokens().toUpperCase().includes(" FOR BEHAVIOR ")
|
|
35023
|
+
|| node.concatTokens().toUpperCase().includes(" FOR FEATURES ")
|
|
34998
35024
|
|| node.concatTokens().toUpperCase().includes(" FOR MODIFY ")) {
|
|
34999
35025
|
const token = isRap.getFirstToken();
|
|
35000
35026
|
this.exporting.push(new _typed_identifier_1.TypedIdentifier(new identifier_1.Identifier(token.getStart(), "failed"), filename, new basic_1.VoidType("RapMethodParameter"), ["exporting" /* IdentifierMeta.MethodExporting */]));
|
|
@@ -35908,7 +35934,8 @@ class CDSFunction extends combi_1.Expression {
|
|
|
35908
35934
|
const tstmp_add_seconds = (0, combi_1.seq)("TSTMP_ADD_SECONDS", "(", input, ",", input, ",", input, ")");
|
|
35909
35935
|
const abap_system_timezone = (0, combi_1.seq)("ABAP_SYSTEM_TIMEZONE", "(", input, ",", input, ")");
|
|
35910
35936
|
const abap_user_timezone = (0, combi_1.seq)("ABAP_USER_TIMEZONE", "(", input, ",", input, ",", input, ")");
|
|
35911
|
-
|
|
35937
|
+
const mod = (0, combi_1.seq)("MOD", "(", input, ",", input, ")");
|
|
35938
|
+
return (0, combi_1.altPrio)(substring, coalesce, tstmp_to_dats, concat, tstmp_to_tims, concat_with_space, dats_is_valid, dats_days_between, tstmp_add_seconds, tstmp_seconds_between, tstmp_current_utctimestamp, tstmp_is_valid, abap_system_timezone, abap_user_timezone, bintohex, hextobin, dats_add_days, dats_add_months, tstmp_to_dst, dats_tims_to_tstmp, mod);
|
|
35912
35939
|
}
|
|
35913
35940
|
}
|
|
35914
35941
|
exports.CDSFunction = CDSFunction;
|
|
@@ -46210,7 +46237,7 @@ class Registry {
|
|
|
46210
46237
|
}
|
|
46211
46238
|
static abaplintVersion() {
|
|
46212
46239
|
// magic, see build script "version.sh"
|
|
46213
|
-
return "2.
|
|
46240
|
+
return "2.96.2";
|
|
46214
46241
|
}
|
|
46215
46242
|
getDDICReferences() {
|
|
46216
46243
|
return this.references;
|
|
@@ -54530,6 +54557,75 @@ exports.FullyTypeConstants = FullyTypeConstants;
|
|
|
54530
54557
|
|
|
54531
54558
|
/***/ }),
|
|
54532
54559
|
|
|
54560
|
+
/***/ "./node_modules/@abaplint/core/build/src/rules/fully_type_itabs.js":
|
|
54561
|
+
/*!*************************************************************************!*\
|
|
54562
|
+
!*** ./node_modules/@abaplint/core/build/src/rules/fully_type_itabs.js ***!
|
|
54563
|
+
\*************************************************************************/
|
|
54564
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
54565
|
+
|
|
54566
|
+
"use strict";
|
|
54567
|
+
|
|
54568
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
54569
|
+
exports.FullyTypeITabs = exports.FullyTypeITabsConf = void 0;
|
|
54570
|
+
const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
|
|
54571
|
+
const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
|
|
54572
|
+
const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
|
|
54573
|
+
const Statements = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
|
|
54574
|
+
const Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
54575
|
+
const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
|
|
54576
|
+
class FullyTypeITabsConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
54577
|
+
}
|
|
54578
|
+
exports.FullyTypeITabsConf = FullyTypeITabsConf;
|
|
54579
|
+
class FullyTypeITabs extends _abap_rule_1.ABAPRule {
|
|
54580
|
+
constructor() {
|
|
54581
|
+
super(...arguments);
|
|
54582
|
+
this.conf = new FullyTypeITabsConf();
|
|
54583
|
+
}
|
|
54584
|
+
getMetadata() {
|
|
54585
|
+
return {
|
|
54586
|
+
key: "fully_type_itabs",
|
|
54587
|
+
title: "Fully type internal tables",
|
|
54588
|
+
shortDescription: `No implict table types or table keys`,
|
|
54589
|
+
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
54590
|
+
DATA lt_bar TYPE STANDARD TABLE OF ty.`,
|
|
54591
|
+
goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
|
|
54592
|
+
tags: [_irule_1.RuleTag.SingleFile],
|
|
54593
|
+
};
|
|
54594
|
+
}
|
|
54595
|
+
getConfig() {
|
|
54596
|
+
return this.conf;
|
|
54597
|
+
}
|
|
54598
|
+
setConfig(conf) {
|
|
54599
|
+
this.conf = conf;
|
|
54600
|
+
}
|
|
54601
|
+
runParsed(file) {
|
|
54602
|
+
const issues = [];
|
|
54603
|
+
for (const statement of file.getStatements()) {
|
|
54604
|
+
if (!(statement.get() instanceof Statements.Data)) {
|
|
54605
|
+
continue;
|
|
54606
|
+
}
|
|
54607
|
+
const tt = statement.findFirstExpression(Expressions.TypeTable);
|
|
54608
|
+
if (tt === undefined) {
|
|
54609
|
+
continue;
|
|
54610
|
+
}
|
|
54611
|
+
const concat = tt.concatTokens().toUpperCase();
|
|
54612
|
+
if (concat.includes("TYPE TABLE OF")) {
|
|
54613
|
+
const message = "Specify table type";
|
|
54614
|
+
issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));
|
|
54615
|
+
}
|
|
54616
|
+
else if (concat.includes(" WITH ") === false) {
|
|
54617
|
+
const message = "Specify table key";
|
|
54618
|
+
issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));
|
|
54619
|
+
}
|
|
54620
|
+
}
|
|
54621
|
+
return issues;
|
|
54622
|
+
}
|
|
54623
|
+
}
|
|
54624
|
+
exports.FullyTypeITabs = FullyTypeITabs;
|
|
54625
|
+
//# sourceMappingURL=fully_type_itabs.js.map
|
|
54626
|
+
|
|
54627
|
+
/***/ }),
|
|
54628
|
+
|
|
54533
54629
|
/***/ "./node_modules/@abaplint/core/build/src/rules/function_module_recommendations.js":
|
|
54534
54630
|
/*!****************************************************************************************!*\
|
|
54535
54631
|
!*** ./node_modules/@abaplint/core/build/src/rules/function_module_recommendations.js ***!
|
|
@@ -56028,6 +56124,7 @@ __exportStar(__webpack_require__(/*! ./forbidden_pseudo_and_pragma */ "./node_mo
|
|
|
56028
56124
|
__exportStar(__webpack_require__(/*! ./forbidden_void_type */ "./node_modules/@abaplint/core/build/src/rules/forbidden_void_type.js"), exports);
|
|
56029
56125
|
__exportStar(__webpack_require__(/*! ./form_tables_obsolete */ "./node_modules/@abaplint/core/build/src/rules/form_tables_obsolete.js"), exports);
|
|
56030
56126
|
__exportStar(__webpack_require__(/*! ./fully_type_constants */ "./node_modules/@abaplint/core/build/src/rules/fully_type_constants.js"), exports);
|
|
56127
|
+
__exportStar(__webpack_require__(/*! ./fully_type_itabs */ "./node_modules/@abaplint/core/build/src/rules/fully_type_itabs.js"), exports);
|
|
56031
56128
|
__exportStar(__webpack_require__(/*! ./function_module_recommendations */ "./node_modules/@abaplint/core/build/src/rules/function_module_recommendations.js"), exports);
|
|
56032
56129
|
__exportStar(__webpack_require__(/*! ./functional_writing */ "./node_modules/@abaplint/core/build/src/rules/functional_writing.js"), exports);
|
|
56033
56130
|
__exportStar(__webpack_require__(/*! ./global_class */ "./node_modules/@abaplint/core/build/src/rules/global_class.js"), exports);
|
|
@@ -62100,7 +62197,8 @@ If the target is a sorted/hashed table, no issue is reported`,
|
|
|
62100
62197
|
type = found;
|
|
62101
62198
|
}
|
|
62102
62199
|
if (type instanceof basic_1.TableType
|
|
62103
|
-
&& ((type === null || type === void 0 ? void 0 : type.getAccessType()) === basic_1.TableAccessType.sorted
|
|
62200
|
+
&& ((type === null || type === void 0 ? void 0 : type.getAccessType()) === basic_1.TableAccessType.sorted
|
|
62201
|
+
|| (type === null || type === void 0 ? void 0 : type.getAccessType()) === basic_1.TableAccessType.hashed)) {
|
|
62104
62202
|
return true;
|
|
62105
62203
|
}
|
|
62106
62204
|
}
|
|
@@ -62928,6 +63026,7 @@ const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@ab
|
|
|
62928
63026
|
const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
|
|
62929
63027
|
const version_1 = __webpack_require__(/*! ../version */ "./node_modules/@abaplint/core/build/src/version.js");
|
|
62930
63028
|
const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
|
|
63029
|
+
const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
|
|
62931
63030
|
class SQLEscapeHostVariablesConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
62932
63031
|
}
|
|
62933
63032
|
exports.SQLEscapeHostVariablesConf = SQLEscapeHostVariablesConf;
|
|
@@ -62942,7 +63041,7 @@ class SQLEscapeHostVariables extends _abap_rule_1.ABAPRule {
|
|
|
62942
63041
|
title: "Escape SQL host variables",
|
|
62943
63042
|
shortDescription: `Escape SQL host variables, from 740sp05`,
|
|
62944
63043
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements`,
|
|
62945
|
-
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide],
|
|
63044
|
+
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
62946
63045
|
badExample: `SELECT * FROM tab INTO TABLE res WHERE field = val.`,
|
|
62947
63046
|
goodExample: `SELECT * FROM tab INTO TABLE @res WHERE field = @val.`,
|
|
62948
63047
|
};
|
|
@@ -62955,52 +63054,45 @@ class SQLEscapeHostVariables extends _abap_rule_1.ABAPRule {
|
|
|
62955
63054
|
}
|
|
62956
63055
|
runParsed(file, obj) {
|
|
62957
63056
|
const issues = [];
|
|
62958
|
-
|
|
63057
|
+
const type = obj.getType();
|
|
63058
|
+
if (type === "INTF" || type === "TYPE") {
|
|
62959
63059
|
return [];
|
|
62960
63060
|
}
|
|
62961
|
-
if (this.reg.getConfig().getVersion() < version_1.Version.v740sp02
|
|
63061
|
+
if (this.reg.getConfig().getVersion() < version_1.Version.v740sp02
|
|
63062
|
+
&& this.reg.getConfig().getVersion() !== version_1.Version.Cloud) {
|
|
62962
63063
|
return [];
|
|
62963
63064
|
}
|
|
62964
63065
|
for (const s of file.getStatements()) {
|
|
62965
|
-
|
|
62966
|
-
if (s.get() instanceof Statements.Select
|
|
62967
|
-
|| s.get() instanceof Statements.SelectLoop) {
|
|
62968
|
-
// this is not completely correct and does not catch all, but okay for now
|
|
62969
|
-
// todo: replace with logic from "else if" branch below, when/if it proves to work
|
|
62970
|
-
if (str.includes(" INTO ( @")
|
|
62971
|
-
|| str.includes(" INTO (@")
|
|
62972
|
-
|| str.includes(" INTO @")
|
|
62973
|
-
|| str.includes(" INTO TABLE @")
|
|
62974
|
-
|| str.includes(" INTO CORRESPONDING FIELDS OF @")
|
|
62975
|
-
|| str.includes(" INTO CORRESPONDING FIELDS OF TABLE @")
|
|
62976
|
-
|| str.includes(" APPENDING TABLE @")
|
|
62977
|
-
|| (str.includes(" APPENDING ") === false && str.includes(" INTO ") === false)
|
|
62978
|
-
|| str.includes(" APPENDING CORRESPONDING FIELDS OF TABLE @")) {
|
|
62979
|
-
continue;
|
|
62980
|
-
}
|
|
62981
|
-
else {
|
|
62982
|
-
const message = "Escape SQL host variables";
|
|
62983
|
-
const issue = issue_1.Issue.atToken(file, s.getFirstToken(), message, this.getMetadata().key, this.conf.severity);
|
|
62984
|
-
issues.push(issue);
|
|
62985
|
-
}
|
|
62986
|
-
}
|
|
62987
|
-
else if (s.get() instanceof Statements.UpdateDatabase
|
|
63066
|
+
if (s.get() instanceof Statements.UpdateDatabase
|
|
62988
63067
|
|| s.get() instanceof Statements.ModifyDatabase
|
|
63068
|
+
|| s.get() instanceof Statements.Select
|
|
63069
|
+
|| s.get() instanceof Statements.SelectLoop
|
|
62989
63070
|
|| s.get() instanceof Statements.InsertDatabase
|
|
62990
63071
|
|| s.get() instanceof Statements.DeleteDatabase) {
|
|
62991
|
-
if (str.startsWith("MODIFY SCREEN FROM ")) {
|
|
62992
|
-
continue;
|
|
62993
|
-
}
|
|
62994
63072
|
for (const o of s.findAllExpressions(Expressions.SQLSource)) {
|
|
62995
63073
|
const first = o.getFirstChild();
|
|
62996
63074
|
if (((first === null || first === void 0 ? void 0 : first.get()) instanceof Expressions.Source && first.getChildren()[0].get() instanceof Expressions.FieldChain)
|
|
62997
63075
|
|| ((first === null || first === void 0 ? void 0 : first.get()) instanceof Expressions.SimpleSource3 && first.getChildren()[0].get() instanceof Expressions.FieldChain)) {
|
|
62998
63076
|
const message = "Escape SQL host variables";
|
|
62999
|
-
const
|
|
63077
|
+
const firstToken = o.getFirstChild().getFirstToken();
|
|
63078
|
+
const fix = edit_helper_1.EditHelper.replaceToken(file, firstToken, "@" + (firstToken === null || firstToken === void 0 ? void 0 : firstToken.getStr()));
|
|
63079
|
+
const issue = issue_1.Issue.atToken(file, first.getFirstToken(), message, this.getMetadata().key, this.conf.severity, fix);
|
|
63000
63080
|
issues.push(issue);
|
|
63001
63081
|
break;
|
|
63002
63082
|
}
|
|
63003
63083
|
}
|
|
63084
|
+
for (const o of s.findAllExpressions(Expressions.SQLTarget)) {
|
|
63085
|
+
const escaped = o.findDirectTokenByText("@");
|
|
63086
|
+
if (escaped !== undefined) {
|
|
63087
|
+
continue;
|
|
63088
|
+
}
|
|
63089
|
+
const message = "Escape SQL host variables";
|
|
63090
|
+
const firstToken = o.getFirstChild().getFirstToken();
|
|
63091
|
+
const fix = edit_helper_1.EditHelper.replaceToken(file, firstToken, "@" + (firstToken === null || firstToken === void 0 ? void 0 : firstToken.getStr()));
|
|
63092
|
+
const issue = issue_1.Issue.atToken(file, o.getFirstToken(), message, this.getMetadata().key, this.conf.severity, fix);
|
|
63093
|
+
issues.push(issue);
|
|
63094
|
+
break;
|
|
63095
|
+
}
|
|
63004
63096
|
}
|
|
63005
63097
|
}
|
|
63006
63098
|
return issues;
|
|
@@ -76270,7 +76362,7 @@ class ClassImplementationTranspiler {
|
|
|
76270
76362
|
if (isStatic === false) {
|
|
76271
76363
|
continue;
|
|
76272
76364
|
}
|
|
76273
|
-
ret += clasName + "." + alias.getName().toLowerCase() + " = " + clasName + "." + alias.getComponent().replace("~", "$") + ";\n";
|
|
76365
|
+
ret += traversal_1.Traversal.escapeNamespace(clasName) + "." + alias.getName().toLowerCase() + " = " + traversal_1.Traversal.escapeNamespace(clasName) + "." + traversal_1.Traversal.escapeNamespace(alias.getComponent().replace("~", "$")) + ";\n";
|
|
76274
76366
|
}
|
|
76275
76367
|
// this is not correct, ABAP does not invocate the class constructor at require time,
|
|
76276
76368
|
// but this will probably work
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.72",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"bin": {
|
|
6
6
|
"abap_transpile": "./abap_transpile"
|
|
@@ -25,15 +25,15 @@
|
|
|
25
25
|
"author": "abaplint",
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@abaplint/transpiler": "^2.5.
|
|
28
|
+
"@abaplint/transpiler": "^2.5.72",
|
|
29
29
|
"@types/glob": "^7.2.0",
|
|
30
30
|
"glob": "=7.2.0",
|
|
31
31
|
"@types/progress": "^2.0.5",
|
|
32
32
|
"@types/node": "^18.15.11",
|
|
33
|
-
"@abaplint/core": "^2.
|
|
33
|
+
"@abaplint/core": "^2.96.2",
|
|
34
34
|
"progress": "^2.0.3",
|
|
35
35
|
"webpack": "^5.77.0",
|
|
36
36
|
"webpack-cli": "^5.0.1",
|
|
37
|
-
"typescript": "^5.0.
|
|
37
|
+
"typescript": "^5.0.3"
|
|
38
38
|
}
|
|
39
39
|
}
|