@abaplint/transpiler-cli 2.6.15 → 2.6.16
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 +145 -32
- package/package.json +4 -4
package/build/bundle.js
CHANGED
|
@@ -12686,7 +12686,8 @@ class Message {
|
|
|
12686
12686
|
const mwith = (0, combi_1.seq)("WITH", s, (0, combi_1.opt)(sourc));
|
|
12687
12687
|
const foo = (0, combi_1.seq)(expressions_1.MessageSource, (0, combi_1.opt)(options), (0, combi_1.opt)(mwith));
|
|
12688
12688
|
const text = (0, combi_1.seq)(s, type, (0, combi_1.optPrio)(like), (0, combi_1.optPrio)(raising));
|
|
12689
|
-
const
|
|
12689
|
+
const cloud = (0, combi_1.seq)(expressions_1.MessageSource, (0, combi_1.opt)((0, combi_1.seq)("WITH", expressions_1.Source, (0, combi_1.opt)(expressions_1.Source), (0, combi_1.opt)(expressions_1.Source), (0, combi_1.opt)(expressions_1.Source))), into);
|
|
12690
|
+
const ret = (0, combi_1.seq)("MESSAGE", (0, combi_1.altPrio)((0, combi_1.verNot)(version_1.Version.Cloud, foo), (0, combi_1.verNot)(version_1.Version.Cloud, text), (0, combi_1.ver)(version_1.Version.Cloud, cloud)));
|
|
12690
12691
|
return ret;
|
|
12691
12692
|
}
|
|
12692
12693
|
}
|
|
@@ -18342,7 +18343,7 @@ class BuiltIn {
|
|
|
18342
18343
|
ret.push(this.buildConstant("col_normal", new basic_1.IntegerType(), "2"));
|
|
18343
18344
|
ret.push(this.buildConstant("col_positive", new basic_1.IntegerType(), "5"));
|
|
18344
18345
|
ret.push(this.buildConstant("col_total", new basic_1.IntegerType(), "3"));
|
|
18345
|
-
ret.push(this.buildConstant("space", new basic_1.CharacterType(1), "' '"));
|
|
18346
|
+
ret.push(this.buildConstant("space", new basic_1.CharacterType(1, { derivedFromConstant: true }), "' '"));
|
|
18346
18347
|
for (const e of extras) {
|
|
18347
18348
|
const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), e);
|
|
18348
18349
|
ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.VoidType(e), ["read_only" /* IdentifierMeta.ReadOnly */, "built-in" /* IdentifierMeta.BuiltIn */], "'?'"));
|
|
@@ -19547,6 +19548,9 @@ class CurrentScope {
|
|
|
19547
19548
|
/** Lookup interface in local and global scope */
|
|
19548
19549
|
findInterfaceDefinition(name) {
|
|
19549
19550
|
var _a;
|
|
19551
|
+
if (name === undefined) {
|
|
19552
|
+
return undefined;
|
|
19553
|
+
}
|
|
19550
19554
|
const ilocal = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findInterfaceDefinition(name);
|
|
19551
19555
|
if (ilocal) {
|
|
19552
19556
|
return ilocal;
|
|
@@ -20254,6 +20258,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
20254
20258
|
exports.TypeUtils = void 0;
|
|
20255
20259
|
const types_1 = __webpack_require__(/*! ../types */ "./node_modules/@abaplint/core/build/src/abap/types/index.js");
|
|
20256
20260
|
const basic_1 = __webpack_require__(/*! ../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
|
|
20261
|
+
const cgeneric_type_1 = __webpack_require__(/*! ../types/basic/cgeneric_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/cgeneric_type.js");
|
|
20257
20262
|
class TypeUtils {
|
|
20258
20263
|
constructor(scope) {
|
|
20259
20264
|
this.scope = scope;
|
|
@@ -20274,6 +20279,7 @@ class TypeUtils {
|
|
|
20274
20279
|
|| type instanceof basic_1.AnyType
|
|
20275
20280
|
|| type instanceof basic_1.CharacterType
|
|
20276
20281
|
|| type instanceof basic_1.SimpleType
|
|
20282
|
+
|| type instanceof cgeneric_type_1.CGenericType
|
|
20277
20283
|
|| type instanceof basic_1.CLikeType
|
|
20278
20284
|
|| type instanceof basic_1.DateType
|
|
20279
20285
|
|| type instanceof basic_1.CSequenceType
|
|
@@ -20302,6 +20308,7 @@ class TypeUtils {
|
|
|
20302
20308
|
return true;
|
|
20303
20309
|
}
|
|
20304
20310
|
else if (type instanceof basic_1.StringType
|
|
20311
|
+
|| type instanceof basic_1.CharacterType
|
|
20305
20312
|
|| type instanceof basic_1.VoidType
|
|
20306
20313
|
|| type instanceof basic_1.AnyType
|
|
20307
20314
|
|| type instanceof basic_1.UnknownType
|
|
@@ -20315,11 +20322,11 @@ class TypeUtils {
|
|
|
20315
20322
|
|| type instanceof basic_1.DecFloat34Type
|
|
20316
20323
|
|| type instanceof basic_1.NumericGenericType
|
|
20317
20324
|
|| type instanceof basic_1.CSequenceType
|
|
20325
|
+
|| type instanceof cgeneric_type_1.CGenericType
|
|
20318
20326
|
|| type instanceof basic_1.DateType
|
|
20319
20327
|
|| type instanceof basic_1.CLikeType
|
|
20320
20328
|
|| type instanceof basic_1.PackedType
|
|
20321
|
-
|| type instanceof basic_1.TimeType
|
|
20322
|
-
|| type instanceof basic_1.CharacterType) {
|
|
20329
|
+
|| type instanceof basic_1.TimeType) {
|
|
20323
20330
|
return true;
|
|
20324
20331
|
}
|
|
20325
20332
|
return false;
|
|
@@ -20438,6 +20445,34 @@ class TypeUtils {
|
|
|
20438
20445
|
// todo
|
|
20439
20446
|
return true;
|
|
20440
20447
|
}
|
|
20448
|
+
structureContainsString(structure) {
|
|
20449
|
+
for (const c of structure.getComponents()) {
|
|
20450
|
+
if (c.type instanceof basic_1.StringType) {
|
|
20451
|
+
return true;
|
|
20452
|
+
}
|
|
20453
|
+
}
|
|
20454
|
+
return false;
|
|
20455
|
+
}
|
|
20456
|
+
isAssignableStrict(source, target) {
|
|
20457
|
+
var _a;
|
|
20458
|
+
/*
|
|
20459
|
+
console.dir(source);
|
|
20460
|
+
console.dir(target);
|
|
20461
|
+
*/
|
|
20462
|
+
if (source instanceof basic_1.CharacterType && target instanceof basic_1.CharacterType) {
|
|
20463
|
+
if (((_a = source.getAbstractTypeData()) === null || _a === void 0 ? void 0 : _a.derivedFromConstant) === true) {
|
|
20464
|
+
return source.getLength() <= target.getLength();
|
|
20465
|
+
}
|
|
20466
|
+
return source.getLength() === target.getLength();
|
|
20467
|
+
}
|
|
20468
|
+
else if (source instanceof basic_1.StringType && target instanceof basic_1.StructureType) {
|
|
20469
|
+
if (this.structureContainsString(target)) {
|
|
20470
|
+
return false;
|
|
20471
|
+
}
|
|
20472
|
+
return true;
|
|
20473
|
+
}
|
|
20474
|
+
return this.isAssignable(source, target);
|
|
20475
|
+
}
|
|
20441
20476
|
isAssignable(source, target) {
|
|
20442
20477
|
/*
|
|
20443
20478
|
console.dir(source);
|
|
@@ -20447,12 +20482,14 @@ class TypeUtils {
|
|
|
20447
20482
|
if (target.isWithHeader()) {
|
|
20448
20483
|
return this.isAssignable(source, target.getRowType());
|
|
20449
20484
|
}
|
|
20450
|
-
if (source instanceof basic_1.
|
|
20451
|
-
|| source instanceof basic_1.VoidType
|
|
20485
|
+
if (source instanceof basic_1.VoidType
|
|
20452
20486
|
|| source instanceof basic_1.AnyType
|
|
20453
20487
|
|| source instanceof basic_1.UnknownType) {
|
|
20454
20488
|
return true;
|
|
20455
20489
|
}
|
|
20490
|
+
else if (source instanceof basic_1.TableType) {
|
|
20491
|
+
return this.isAssignableStrict(source.getRowType(), target.getRowType());
|
|
20492
|
+
}
|
|
20456
20493
|
return false;
|
|
20457
20494
|
}
|
|
20458
20495
|
else if (target instanceof basic_1.ObjectReferenceType && source instanceof basic_1.ObjectReferenceType) {
|
|
@@ -20482,12 +20519,17 @@ class TypeUtils {
|
|
|
20482
20519
|
if (source instanceof basic_1.TableType && source.isWithHeader()) {
|
|
20483
20520
|
return this.isAssignable(source.getRowType(), target);
|
|
20484
20521
|
}
|
|
20485
|
-
else if (source instanceof basic_1.
|
|
20486
|
-
|| source instanceof basic_1.VoidType
|
|
20522
|
+
else if (source instanceof basic_1.VoidType
|
|
20487
20523
|
|| source instanceof basic_1.AnyType
|
|
20488
20524
|
|| source instanceof basic_1.UnknownType) {
|
|
20489
20525
|
return true;
|
|
20490
20526
|
}
|
|
20527
|
+
else if (source instanceof basic_1.StructureType) {
|
|
20528
|
+
if (this.structureContainsString(target) && !this.structureContainsString(source)) {
|
|
20529
|
+
return false;
|
|
20530
|
+
}
|
|
20531
|
+
return true;
|
|
20532
|
+
}
|
|
20491
20533
|
else if (target.containsVoid() === true) {
|
|
20492
20534
|
return true;
|
|
20493
20535
|
}
|
|
@@ -21997,7 +22039,7 @@ class Constant {
|
|
|
21997
22039
|
if (len <= 0) {
|
|
21998
22040
|
len = 1;
|
|
21999
22041
|
}
|
|
22000
|
-
return new basic_1.CharacterType(len);
|
|
22042
|
+
return new basic_1.CharacterType(len, { derivedFromConstant: true });
|
|
22001
22043
|
}
|
|
22002
22044
|
else {
|
|
22003
22045
|
return new basic_1.StringType({ qualifiedName: "STRING" });
|
|
@@ -23007,6 +23049,7 @@ class MethodCallBody {
|
|
|
23007
23049
|
if (param) {
|
|
23008
23050
|
new method_call_param_1.MethodCallParam().runSyntax(param, scope, method, filename);
|
|
23009
23051
|
}
|
|
23052
|
+
// for PARAMETER-TABLE and EXCEPTION-TABLE
|
|
23010
23053
|
for (const s of node.findDirectExpressions(Expressions.Source)) {
|
|
23011
23054
|
new source_1.Source().runSyntax(s, scope, filename);
|
|
23012
23055
|
}
|
|
@@ -23218,7 +23261,7 @@ class MethodCallParam {
|
|
|
23218
23261
|
if (sourceType === undefined) {
|
|
23219
23262
|
throw new Error("No source type determined, method source");
|
|
23220
23263
|
}
|
|
23221
|
-
else if (new _type_utils_1.TypeUtils(scope).
|
|
23264
|
+
else if (new _type_utils_1.TypeUtils(scope).isAssignableStrict(sourceType, targetType) === false) {
|
|
23222
23265
|
throw new Error("Method parameter type not compatible");
|
|
23223
23266
|
}
|
|
23224
23267
|
}
|
|
@@ -23295,6 +23338,7 @@ const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@ab
|
|
|
23295
23338
|
const basic_types_1 = __webpack_require__(/*! ../basic_types */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/basic_types.js");
|
|
23296
23339
|
const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
23297
23340
|
const default_1 = __webpack_require__(/*! ./default */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/default.js");
|
|
23341
|
+
const cgeneric_type_1 = __webpack_require__(/*! ../../types/basic/cgeneric_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/cgeneric_type.js");
|
|
23298
23342
|
class MethodParam {
|
|
23299
23343
|
runSyntax(node, scope, filename, meta) {
|
|
23300
23344
|
const name = node.findDirectExpression(Expressions.MethodParamName);
|
|
@@ -23314,6 +23358,10 @@ class MethodParam {
|
|
|
23314
23358
|
return new _typed_identifier_1.TypedIdentifier(name.getFirstToken(), filename, new basic_1.UnknownType(e.toString()), meta);
|
|
23315
23359
|
}
|
|
23316
23360
|
}
|
|
23361
|
+
const concat = type.concatTokens().toUpperCase();
|
|
23362
|
+
if (concat === "TYPE C" || concat.startsWith("TYPE C ")) {
|
|
23363
|
+
return new _typed_identifier_1.TypedIdentifier(name.getFirstToken(), filename, new cgeneric_type_1.CGenericType(), meta);
|
|
23364
|
+
}
|
|
23317
23365
|
const found = new basic_types_1.BasicTypes(filename, scope).parseType(type);
|
|
23318
23366
|
if (found) {
|
|
23319
23367
|
return new _typed_identifier_1.TypedIdentifier(name.getFirstToken(), filename, found, meta);
|
|
@@ -23466,7 +23514,7 @@ class MethodParameters {
|
|
|
23466
23514
|
if (parameter === undefined) {
|
|
23467
23515
|
throw new Error("Method importing parameter \"" + item.name + "\" does not exist");
|
|
23468
23516
|
}
|
|
23469
|
-
else if (new _type_utils_1.TypeUtils(scope).
|
|
23517
|
+
else if (new _type_utils_1.TypeUtils(scope).isAssignableStrict(item.sourceType, parameter.getType()) === false) {
|
|
23470
23518
|
throw new Error("Method parameter type not compatible, " + item.name);
|
|
23471
23519
|
}
|
|
23472
23520
|
this.requiredParameters.delete(item.name);
|
|
@@ -26449,6 +26497,11 @@ class CreateObject {
|
|
|
26449
26497
|
if (id instanceof types_1.InterfaceDefinition && type === undefined) {
|
|
26450
26498
|
throw new Error("Interface reference, cannot be instantiated");
|
|
26451
26499
|
}
|
|
26500
|
+
else if (found instanceof basic_1.ObjectReferenceType
|
|
26501
|
+
&& type === undefined
|
|
26502
|
+
&& scope.findInterfaceDefinition(found.getQualifiedName())) {
|
|
26503
|
+
throw new Error("Interface reference, cannot be instantiated");
|
|
26504
|
+
}
|
|
26452
26505
|
else if (id instanceof types_1.ClassDefinition && cdef === undefined) {
|
|
26453
26506
|
cdef = id;
|
|
26454
26507
|
}
|
|
@@ -32601,6 +32654,39 @@ exports.AnyType = AnyType;
|
|
|
32601
32654
|
|
|
32602
32655
|
/***/ }),
|
|
32603
32656
|
|
|
32657
|
+
/***/ "./node_modules/@abaplint/core/build/src/abap/types/basic/cgeneric_type.js":
|
|
32658
|
+
/*!*********************************************************************************!*\
|
|
32659
|
+
!*** ./node_modules/@abaplint/core/build/src/abap/types/basic/cgeneric_type.js ***!
|
|
32660
|
+
\*********************************************************************************/
|
|
32661
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
32662
|
+
|
|
32663
|
+
"use strict";
|
|
32664
|
+
|
|
32665
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
32666
|
+
exports.CGenericType = void 0;
|
|
32667
|
+
const _abstract_type_1 = __webpack_require__(/*! ./_abstract_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/_abstract_type.js");
|
|
32668
|
+
class CGenericType extends _abstract_type_1.AbstractType {
|
|
32669
|
+
toText() {
|
|
32670
|
+
return "```c```";
|
|
32671
|
+
}
|
|
32672
|
+
isGeneric() {
|
|
32673
|
+
return true;
|
|
32674
|
+
}
|
|
32675
|
+
toABAP() {
|
|
32676
|
+
throw new Error("c, generic");
|
|
32677
|
+
}
|
|
32678
|
+
containsVoid() {
|
|
32679
|
+
return false;
|
|
32680
|
+
}
|
|
32681
|
+
toCDS() {
|
|
32682
|
+
return "abap.TODO_CGENERIC";
|
|
32683
|
+
}
|
|
32684
|
+
}
|
|
32685
|
+
exports.CGenericType = CGenericType;
|
|
32686
|
+
//# sourceMappingURL=cgeneric_type.js.map
|
|
32687
|
+
|
|
32688
|
+
/***/ }),
|
|
32689
|
+
|
|
32604
32690
|
/***/ "./node_modules/@abaplint/core/build/src/abap/types/basic/character_type.js":
|
|
32605
32691
|
/*!**********************************************************************************!*\
|
|
32606
32692
|
!*** ./node_modules/@abaplint/core/build/src/abap/types/basic/character_type.js ***!
|
|
@@ -33113,6 +33199,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
33113
33199
|
};
|
|
33114
33200
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
33115
33201
|
__exportStar(__webpack_require__(/*! ./any_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/any_type.js"), exports);
|
|
33202
|
+
__exportStar(__webpack_require__(/*! ./cgeneric_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/cgeneric_type.js"), exports);
|
|
33116
33203
|
__exportStar(__webpack_require__(/*! ./character_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/character_type.js"), exports);
|
|
33117
33204
|
__exportStar(__webpack_require__(/*! ./clike_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/clike_type.js"), exports);
|
|
33118
33205
|
__exportStar(__webpack_require__(/*! ./csequence_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/csequence_type.js"), exports);
|
|
@@ -46226,7 +46313,7 @@ class Registry {
|
|
|
46226
46313
|
}
|
|
46227
46314
|
static abaplintVersion() {
|
|
46228
46315
|
// magic, see build script "version.sh"
|
|
46229
|
-
return "2.97.
|
|
46316
|
+
return "2.97.10";
|
|
46230
46317
|
}
|
|
46231
46318
|
getDDICReferences() {
|
|
46232
46319
|
return this.references;
|
|
@@ -67010,12 +67097,14 @@ class Chunk {
|
|
|
67010
67097
|
this.appendString(str);
|
|
67011
67098
|
}
|
|
67012
67099
|
}
|
|
67013
|
-
|
|
67100
|
+
/*
|
|
67101
|
+
public copy(): Chunk {
|
|
67014
67102
|
const ret = new Chunk();
|
|
67015
67103
|
ret.raw = this.raw;
|
|
67016
67104
|
ret.mappings = [...this.mappings];
|
|
67017
67105
|
return ret;
|
|
67018
|
-
|
|
67106
|
+
}
|
|
67107
|
+
*/
|
|
67019
67108
|
join(chunks, str = ", ") {
|
|
67020
67109
|
for (let i = 0; i < chunks.length; i++) {
|
|
67021
67110
|
this.appendChunk(chunks[i]);
|
|
@@ -77298,6 +77387,7 @@ class TranspileTypes {
|
|
|
77298
77387
|
}
|
|
77299
77388
|
}
|
|
77300
77389
|
else if (type instanceof abaplint.BasicTypes.CLikeType
|
|
77390
|
+
|| type instanceof abaplint.BasicTypes.CGenericType
|
|
77301
77391
|
|| type instanceof abaplint.BasicTypes.CSequenceType) {
|
|
77302
77392
|
// if not supplied its a Character(1)
|
|
77303
77393
|
resolved = "Character";
|
|
@@ -77654,21 +77744,28 @@ class Traversal {
|
|
|
77654
77744
|
if (ref === undefined) {
|
|
77655
77745
|
return undefined;
|
|
77656
77746
|
}
|
|
77657
|
-
// local
|
|
77747
|
+
// local
|
|
77658
77748
|
if (ref.getFilename() === this.getFilename()) {
|
|
77659
77749
|
const scope = this.findCurrentScopeByToken(ref.getToken());
|
|
77660
77750
|
if ((scope === null || scope === void 0 ? void 0 : scope.getIdentifier().stype) === abaplint.ScopeType.Interface) {
|
|
77661
77751
|
return scope === null || scope === void 0 ? void 0 : scope.getIdentifier().sname;
|
|
77662
77752
|
}
|
|
77663
77753
|
}
|
|
77664
|
-
// global
|
|
77665
|
-
const
|
|
77666
|
-
|
|
77667
|
-
const obj = this.reg.findObjectForFile(file);
|
|
77668
|
-
if ((obj === null || obj === void 0 ? void 0 : obj.getType()) === "INTF") {
|
|
77754
|
+
// global
|
|
77755
|
+
for (const obj of this.reg.getObjectsByType("INTF")) {
|
|
77756
|
+
if (obj.getFiles().some(f => f.getFilename() === ref.getFilename())) {
|
|
77669
77757
|
return obj.getName().toLowerCase();
|
|
77670
77758
|
}
|
|
77671
77759
|
}
|
|
77760
|
+
/*
|
|
77761
|
+
const file = this.reg.getFileByName(ref.getFilename());
|
|
77762
|
+
if (file) {
|
|
77763
|
+
const obj = this.reg.findObjectForFile(file);
|
|
77764
|
+
if (obj?.getType() === "INTF") {
|
|
77765
|
+
return obj.getName().toLowerCase();
|
|
77766
|
+
}
|
|
77767
|
+
}
|
|
77768
|
+
*/
|
|
77672
77769
|
return undefined;
|
|
77673
77770
|
}
|
|
77674
77771
|
findReadOrWriteReference(token) {
|
|
@@ -79842,6 +79939,10 @@ const defaultOptions = {
|
|
|
79842
79939
|
ignorePiTags: false,
|
|
79843
79940
|
transformTagName: false,
|
|
79844
79941
|
transformAttributeName: false,
|
|
79942
|
+
updateTag: function(tagName, jPath, attrs){
|
|
79943
|
+
return tagName
|
|
79944
|
+
},
|
|
79945
|
+
// skipEmptyListItem: false
|
|
79845
79946
|
};
|
|
79846
79947
|
|
|
79847
79948
|
const buildOptions = function(options) {
|
|
@@ -79912,6 +80013,7 @@ class OrderedObjParser{
|
|
|
79912
80013
|
this.replaceEntitiesValue = replaceEntitiesValue;
|
|
79913
80014
|
this.readStopNodeData = readStopNodeData;
|
|
79914
80015
|
this.saveTextToParentTag = saveTextToParentTag;
|
|
80016
|
+
this.addChild = addChild;
|
|
79915
80017
|
}
|
|
79916
80018
|
|
|
79917
80019
|
}
|
|
@@ -79983,7 +80085,7 @@ function resolveNameSpace(tagname) {
|
|
|
79983
80085
|
//const attrsRegx = new RegExp("([\\w\\-\\.\\:]+)\\s*=\\s*(['\"])((.|\n)*?)\\2","gm");
|
|
79984
80086
|
const attrsRegx = new RegExp('([^\\s=]+)\\s*(=\\s*([\'"])([\\s\\S]*?)\\3)?', 'gm');
|
|
79985
80087
|
|
|
79986
|
-
function buildAttributesMap(attrStr, jPath) {
|
|
80088
|
+
function buildAttributesMap(attrStr, jPath, tagName) {
|
|
79987
80089
|
if (!this.options.ignoreAttributes && typeof attrStr === 'string') {
|
|
79988
80090
|
// attrStr = attrStr.replace(/\r?\n/g, ' ');
|
|
79989
80091
|
//attrStr = attrStr || attrStr.trim();
|
|
@@ -80033,7 +80135,7 @@ function buildAttributesMap(attrStr, jPath) {
|
|
|
80033
80135
|
attrCollection[this.options.attributesGroupName] = attrs;
|
|
80034
80136
|
return attrCollection;
|
|
80035
80137
|
}
|
|
80036
|
-
return attrs
|
|
80138
|
+
return attrs
|
|
80037
80139
|
}
|
|
80038
80140
|
}
|
|
80039
80141
|
|
|
@@ -80069,7 +80171,7 @@ const parseXml = function(xmlData) {
|
|
|
80069
80171
|
|
|
80070
80172
|
jPath = jPath.substr(0, jPath.lastIndexOf("."));
|
|
80071
80173
|
|
|
80072
|
-
currentNode = this.tagsNodeStack.pop();//avoid
|
|
80174
|
+
currentNode = this.tagsNodeStack.pop();//avoid recursion, set the parent tag scope
|
|
80073
80175
|
textData = "";
|
|
80074
80176
|
i = closeIndex;
|
|
80075
80177
|
} else if( xmlData[i+1] === '?') {
|
|
@@ -80086,9 +80188,9 @@ const parseXml = function(xmlData) {
|
|
|
80086
80188
|
childNode.add(this.options.textNodeName, "");
|
|
80087
80189
|
|
|
80088
80190
|
if(tagData.tagName !== tagData.tagExp && tagData.attrExpPresent){
|
|
80089
|
-
childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath);
|
|
80191
|
+
childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName);
|
|
80090
80192
|
}
|
|
80091
|
-
|
|
80193
|
+
this.addChild(currentNode, childNode, jPath)
|
|
80092
80194
|
|
|
80093
80195
|
}
|
|
80094
80196
|
|
|
@@ -80176,7 +80278,7 @@ const parseXml = function(xmlData) {
|
|
|
80176
80278
|
|
|
80177
80279
|
const childNode = new xmlNode(tagName);
|
|
80178
80280
|
if(tagName !== tagExp && attrExpPresent){
|
|
80179
|
-
childNode[":@"] = this.buildAttributesMap(tagExp, jPath);
|
|
80281
|
+
childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName);
|
|
80180
80282
|
}
|
|
80181
80283
|
if(tagContent) {
|
|
80182
80284
|
tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true);
|
|
@@ -80185,7 +80287,7 @@ const parseXml = function(xmlData) {
|
|
|
80185
80287
|
jPath = jPath.substr(0, jPath.lastIndexOf("."));
|
|
80186
80288
|
childNode.add(this.options.textNodeName, tagContent);
|
|
80187
80289
|
|
|
80188
|
-
|
|
80290
|
+
this.addChild(currentNode, childNode, jPath)
|
|
80189
80291
|
}else{
|
|
80190
80292
|
//selfClosing tag
|
|
80191
80293
|
if(tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1){
|
|
@@ -80202,10 +80304,10 @@ const parseXml = function(xmlData) {
|
|
|
80202
80304
|
|
|
80203
80305
|
const childNode = new xmlNode(tagName);
|
|
80204
80306
|
if(tagName !== tagExp && attrExpPresent){
|
|
80205
|
-
childNode[":@"] = this.buildAttributesMap(tagExp, jPath);
|
|
80307
|
+
childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName);
|
|
80206
80308
|
}
|
|
80207
80309
|
jPath = jPath.substr(0, jPath.lastIndexOf("."));
|
|
80208
|
-
|
|
80310
|
+
this.addChild(currentNode, childNode, jPath)
|
|
80209
80311
|
}
|
|
80210
80312
|
//opening tag
|
|
80211
80313
|
else{
|
|
@@ -80213,9 +80315,9 @@ const parseXml = function(xmlData) {
|
|
|
80213
80315
|
this.tagsNodeStack.push(currentNode);
|
|
80214
80316
|
|
|
80215
80317
|
if(tagName !== tagExp && attrExpPresent){
|
|
80216
|
-
childNode[":@"] = this.buildAttributesMap(tagExp, jPath);
|
|
80318
|
+
childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName);
|
|
80217
80319
|
}
|
|
80218
|
-
|
|
80320
|
+
this.addChild(currentNode, childNode, jPath)
|
|
80219
80321
|
currentNode = childNode;
|
|
80220
80322
|
}
|
|
80221
80323
|
textData = "";
|
|
@@ -80229,6 +80331,17 @@ const parseXml = function(xmlData) {
|
|
|
80229
80331
|
return xmlObj.child;
|
|
80230
80332
|
}
|
|
80231
80333
|
|
|
80334
|
+
function addChild(currentNode, childNode, jPath){
|
|
80335
|
+
const result = this.options.updateTag(childNode.tagname, jPath, childNode[":@"])
|
|
80336
|
+
if(result === false){
|
|
80337
|
+
}else if(typeof result === "string"){
|
|
80338
|
+
childNode.tagname = result
|
|
80339
|
+
currentNode.addChild(childNode);
|
|
80340
|
+
}else{
|
|
80341
|
+
currentNode.addChild(childNode);
|
|
80342
|
+
}
|
|
80343
|
+
}
|
|
80344
|
+
|
|
80232
80345
|
const replaceEntitiesValue = function(val){
|
|
80233
80346
|
|
|
80234
80347
|
if(this.options.processEntities){
|
|
@@ -80285,7 +80398,7 @@ function isItStopNode(stopNodes, jPath, currentTagName){
|
|
|
80285
80398
|
}
|
|
80286
80399
|
|
|
80287
80400
|
/**
|
|
80288
|
-
* Returns the tag Expression and where it is ending handling single-
|
|
80401
|
+
* Returns the tag Expression and where it is ending handling single-double quotes situation
|
|
80289
80402
|
* @param {string} xmlData
|
|
80290
80403
|
* @param {number} i starting index
|
|
80291
80404
|
* @returns
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.16",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"bin": {
|
|
6
6
|
"abap_transpile": "./abap_transpile"
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
"author": "abaplint",
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@abaplint/transpiler": "^2.6.
|
|
28
|
+
"@abaplint/transpiler": "^2.6.16",
|
|
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.97.
|
|
33
|
+
"@abaplint/core": "^2.97.10",
|
|
34
34
|
"progress": "^2.0.3",
|
|
35
|
-
"webpack": "^5.
|
|
35
|
+
"webpack": "^5.79.0",
|
|
36
36
|
"webpack-cli": "^5.0.1",
|
|
37
37
|
"typescript": "^5.0.4"
|
|
38
38
|
}
|