@abaplint/transpiler-cli 2.6.25 → 2.6.27
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 +99 -57
- package/package.json +5 -5
package/build/bundle.js
CHANGED
|
@@ -19568,21 +19568,28 @@ class CurrentScope {
|
|
|
19568
19568
|
if (name === undefined) {
|
|
19569
19569
|
return { found: false };
|
|
19570
19570
|
}
|
|
19571
|
+
let RTTIPrefix = "";
|
|
19572
|
+
if (this.parentObj.getType() === "PROG") {
|
|
19573
|
+
RTTIPrefix = "\\PROGRAM=" + this.parentObj.getName();
|
|
19574
|
+
}
|
|
19575
|
+
else if (this.parentObj.getType() === "CLAS") {
|
|
19576
|
+
RTTIPrefix = "\\CLASS-POOL=" + this.parentObj.getName();
|
|
19577
|
+
}
|
|
19571
19578
|
const findLocalClass = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findClassDefinition(name);
|
|
19572
19579
|
if (findLocalClass) {
|
|
19573
|
-
return { found: true, id: findLocalClass, type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: "CLAS" };
|
|
19580
|
+
return { found: true, id: findLocalClass, type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: "CLAS", RTTIName: RTTIPrefix + "\\CLASS=" + findLocalClass.getName() };
|
|
19574
19581
|
}
|
|
19575
19582
|
const globalClas = this.reg.getObject("CLAS", name);
|
|
19576
19583
|
if (globalClas) {
|
|
19577
|
-
return { found: true, id: globalClas.getIdentifier(), type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: "CLAS" };
|
|
19584
|
+
return { found: true, id: globalClas.getIdentifier(), type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: "CLAS", RTTIName: "\\CLASS=" + globalClas.getName() };
|
|
19578
19585
|
}
|
|
19579
19586
|
const findLocalInterface = (_b = this.current) === null || _b === void 0 ? void 0 : _b.findInterfaceDefinition(name);
|
|
19580
19587
|
if (findLocalInterface) {
|
|
19581
|
-
return { found: true, id: findLocalInterface, type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: "INTF" };
|
|
19588
|
+
return { found: true, id: findLocalInterface, type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: "INTF", RTTIName: RTTIPrefix + "\\INTERFACE=" + findLocalInterface.getName() };
|
|
19582
19589
|
}
|
|
19583
19590
|
const globalIntf = this.reg.getObject("INTF", name);
|
|
19584
19591
|
if (globalIntf) {
|
|
19585
|
-
return { found: true, id: globalIntf.getIdentifier(), type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: "INTF" };
|
|
19592
|
+
return { found: true, id: globalIntf.getIdentifier(), type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: "INTF", RTTIName: "\\INTERFACE=" + globalIntf.getName() };
|
|
19586
19593
|
}
|
|
19587
19594
|
const def = (_c = this.current) === null || _c === void 0 ? void 0 : _c.findDeferred(name);
|
|
19588
19595
|
if (def !== undefined) {
|
|
@@ -20436,6 +20443,7 @@ class TypeUtils {
|
|
|
20436
20443
|
else if (type instanceof basic_1.XStringType
|
|
20437
20444
|
|| type instanceof basic_1.HexType
|
|
20438
20445
|
|| type instanceof basic_1.VoidType
|
|
20446
|
+
|| type instanceof basic_1.XSequenceType
|
|
20439
20447
|
|| type instanceof basic_1.AnyType
|
|
20440
20448
|
|| type instanceof basic_1.UnknownType) {
|
|
20441
20449
|
return true;
|
|
@@ -21530,7 +21538,7 @@ class BasicTypes {
|
|
|
21530
21538
|
const search = this.scope.existsObject(name);
|
|
21531
21539
|
if (search.found === true && search.id) {
|
|
21532
21540
|
this.scope.addReference(chain.getFirstToken(), search.id, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: search.ooType, ooName: name });
|
|
21533
|
-
return new Types.ObjectReferenceType(search.id, name);
|
|
21541
|
+
return new Types.ObjectReferenceType(search.id, { qualifiedName: name, RTTIName: search.RTTIName });
|
|
21534
21542
|
}
|
|
21535
21543
|
}
|
|
21536
21544
|
const found = this.resolveTypeName(chain);
|
|
@@ -21793,7 +21801,7 @@ class Cast {
|
|
|
21793
21801
|
if (tt === undefined || tt instanceof basic_1.VoidType || tt instanceof basic_1.UnknownType) {
|
|
21794
21802
|
const found = scope.findObjectDefinition(typeName);
|
|
21795
21803
|
if (found) {
|
|
21796
|
-
tt = new basic_1.ObjectReferenceType(found, typeName);
|
|
21804
|
+
tt = new basic_1.ObjectReferenceType(found, { qualifiedName: typeName });
|
|
21797
21805
|
}
|
|
21798
21806
|
}
|
|
21799
21807
|
else {
|
|
@@ -24678,10 +24686,23 @@ exports.StringTemplate = void 0;
|
|
|
24678
24686
|
const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
|
|
24679
24687
|
const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
24680
24688
|
const source_1 = __webpack_require__(/*! ./source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js");
|
|
24689
|
+
const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js");
|
|
24681
24690
|
class StringTemplate {
|
|
24682
24691
|
runSyntax(node, scope, filename) {
|
|
24683
|
-
|
|
24684
|
-
|
|
24692
|
+
var _a;
|
|
24693
|
+
const typeUtils = new _type_utils_1.TypeUtils(scope);
|
|
24694
|
+
for (const templateSource of node.findAllExpressions(Expressions.StringTemplateSource)) {
|
|
24695
|
+
const s = templateSource.findDirectExpression(Expressions.Source);
|
|
24696
|
+
const type = new source_1.Source().runSyntax(s, scope, filename, new basic_1.StringType({ qualifiedName: "STRING" }));
|
|
24697
|
+
if (type === undefined) {
|
|
24698
|
+
throw new Error("No target type determined");
|
|
24699
|
+
}
|
|
24700
|
+
else if (typeUtils.isCharLike(type) === false && typeUtils.isHexLike(type) === false) {
|
|
24701
|
+
throw new Error("Not character like, " + type.constructor.name);
|
|
24702
|
+
}
|
|
24703
|
+
for (const formatSource of ((_a = templateSource.findDirectExpression(Expressions.StringTemplateFormatting)) === null || _a === void 0 ? void 0 : _a.findAllExpressions(Expressions.Source)) || []) {
|
|
24704
|
+
new source_1.Source().runSyntax(formatSource, scope, filename);
|
|
24705
|
+
}
|
|
24685
24706
|
}
|
|
24686
24707
|
return new basic_1.StringType({ qualifiedName: "STRING" });
|
|
24687
24708
|
}
|
|
@@ -32771,6 +32792,10 @@ class AbstractType {
|
|
|
32771
32792
|
var _a;
|
|
32772
32793
|
return (_a = this.data) === null || _a === void 0 ? void 0 : _a.qualifiedName;
|
|
32773
32794
|
}
|
|
32795
|
+
getRTTIName() {
|
|
32796
|
+
var _a;
|
|
32797
|
+
return (_a = this.data) === null || _a === void 0 ? void 0 : _a.RTTIName;
|
|
32798
|
+
}
|
|
32774
32799
|
getConversionExit() {
|
|
32775
32800
|
var _a;
|
|
32776
32801
|
return (_a = this.data) === null || _a === void 0 ? void 0 : _a.conversionExit;
|
|
@@ -33517,8 +33542,8 @@ exports.ObjectReferenceType = void 0;
|
|
|
33517
33542
|
const _abstract_type_1 = __webpack_require__(/*! ./_abstract_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/_abstract_type.js");
|
|
33518
33543
|
// use GenericObjectReferenceType for REF TO OBJECT
|
|
33519
33544
|
class ObjectReferenceType extends _abstract_type_1.AbstractType {
|
|
33520
|
-
constructor(id,
|
|
33521
|
-
super(
|
|
33545
|
+
constructor(id, extra) {
|
|
33546
|
+
super(extra);
|
|
33522
33547
|
this.identifier = id;
|
|
33523
33548
|
}
|
|
33524
33549
|
getIdentifierName() {
|
|
@@ -36901,12 +36926,18 @@ class DDIC {
|
|
|
36901
36926
|
const clas = this.reg.getObject("CLAS", name);
|
|
36902
36927
|
const globalClas = clas === null || clas === void 0 ? void 0 : clas.getIdentifier();
|
|
36903
36928
|
if (globalClas) {
|
|
36904
|
-
return {
|
|
36929
|
+
return {
|
|
36930
|
+
type: new basic_1.ObjectReferenceType(globalClas, { qualifiedName: name, RTTIName: "\\CLASS=" + name }),
|
|
36931
|
+
object: clas,
|
|
36932
|
+
};
|
|
36905
36933
|
}
|
|
36906
36934
|
const intf = this.reg.getObject("INTF", name);
|
|
36907
36935
|
const globalIntf = intf === null || intf === void 0 ? void 0 : intf.getIdentifier();
|
|
36908
36936
|
if (globalIntf) {
|
|
36909
|
-
return {
|
|
36937
|
+
return {
|
|
36938
|
+
type: new basic_1.ObjectReferenceType(globalIntf, { qualifiedName: name, RTTIName: "\\INTERFACE=" + name }),
|
|
36939
|
+
object: intf,
|
|
36940
|
+
};
|
|
36910
36941
|
}
|
|
36911
36942
|
if (this.inErrorNamespace(name) === true) {
|
|
36912
36943
|
return { type: new basic_1.UnknownType(name) };
|
|
@@ -38360,6 +38391,9 @@ class LSPLookup {
|
|
|
38360
38391
|
if (variable.getType().getQualifiedName()) {
|
|
38361
38392
|
value += "\n\nQualified Type Name: ```" + variable.getType().getQualifiedName() + "```";
|
|
38362
38393
|
}
|
|
38394
|
+
if (variable.getType().getRTTIName()) {
|
|
38395
|
+
value += "\n\nRTTI Name: ```" + variable.getType().getRTTIName() + "```";
|
|
38396
|
+
}
|
|
38363
38397
|
if (variable.getType().isGeneric() === true) {
|
|
38364
38398
|
value += "\n\nIs Generic Type";
|
|
38365
38399
|
}
|
|
@@ -46483,7 +46517,7 @@ class Registry {
|
|
|
46483
46517
|
}
|
|
46484
46518
|
static abaplintVersion() {
|
|
46485
46519
|
// magic, see build script "version.sh"
|
|
46486
|
-
return "2.97.
|
|
46520
|
+
return "2.97.16";
|
|
46487
46521
|
}
|
|
46488
46522
|
getDDICReferences() {
|
|
46489
46523
|
return this.references;
|
|
@@ -71968,6 +72002,7 @@ class ClassImplementationTranspiler {
|
|
|
71968
72002
|
const scope = traversal.findCurrentScopeByToken(token);
|
|
71969
72003
|
return new chunk_1.Chunk().append(ret + ` {
|
|
71970
72004
|
static INTERNAL_TYPE = 'CLAS';
|
|
72005
|
+
static INTERNAL_NAME = '${traversal.buildInternalName(token.getStr(), def)}';
|
|
71971
72006
|
static IMPLEMENTED_INTERFACES = [${this.findImplementedClass(traversal, def, scope).map(e => `"` + e.toUpperCase() + `"`).join(",")}];
|
|
71972
72007
|
static ATTRIBUTES = {${traversal.buildAttributes(def)}};`, node, traversal);
|
|
71973
72008
|
}
|
|
@@ -76623,6 +76658,8 @@ class ClassDefinitionTranspiler {
|
|
|
76623
76658
|
return new chunk_1.Chunk(`
|
|
76624
76659
|
class ${className === null || className === void 0 ? void 0 : className.toLowerCase()} {
|
|
76625
76660
|
static INTERNAL_TYPE = 'CLAS';
|
|
76661
|
+
static IMPLEMENTED_INTERFACES = [];
|
|
76662
|
+
static INTERNAL_NAME = 'ABSTRACT_CLASS_INTERNAL_NAME';
|
|
76626
76663
|
static ATTRIBUTES = {};
|
|
76627
76664
|
async constructor_() {
|
|
76628
76665
|
this.me = new abap.types.ABAPObject();
|
|
@@ -77496,15 +77533,14 @@ class TranspileTypes {
|
|
|
77496
77533
|
return pre + t.getName().toLowerCase() + " = " + code + ";\n";
|
|
77497
77534
|
}
|
|
77498
77535
|
toType(type) {
|
|
77499
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
77536
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
77500
77537
|
let resolved = "";
|
|
77501
77538
|
let extra = "";
|
|
77502
77539
|
if (type instanceof abaplint.BasicTypes.ObjectReferenceType
|
|
77503
77540
|
|| type instanceof abaplint.BasicTypes.GenericObjectReferenceType) {
|
|
77504
77541
|
resolved = "ABAPObject";
|
|
77505
|
-
|
|
77506
|
-
|
|
77507
|
-
}
|
|
77542
|
+
extra = "{qualifiedName: " + JSON.stringify((_a = type.getQualifiedName()) === null || _a === void 0 ? void 0 : _a.toUpperCase()) +
|
|
77543
|
+
", RTTIName: " + JSON.stringify((_b = type.getRTTIName()) === null || _b === void 0 ? void 0 : _b.toUpperCase()) + "}";
|
|
77508
77544
|
}
|
|
77509
77545
|
else if (type instanceof abaplint.BasicTypes.TableType) {
|
|
77510
77546
|
resolved = "Table";
|
|
@@ -77518,31 +77554,31 @@ class TranspileTypes {
|
|
|
77518
77554
|
else if (type instanceof abaplint.BasicTypes.IntegerType) {
|
|
77519
77555
|
resolved = "Integer";
|
|
77520
77556
|
if (type.getQualifiedName() !== undefined) {
|
|
77521
|
-
extra = "{qualifiedName: \"" + ((
|
|
77557
|
+
extra = "{qualifiedName: \"" + ((_c = type.getQualifiedName()) === null || _c === void 0 ? void 0 : _c.toUpperCase()) + "\"}";
|
|
77522
77558
|
}
|
|
77523
77559
|
}
|
|
77524
77560
|
else if (type instanceof abaplint.BasicTypes.StringType) {
|
|
77525
77561
|
resolved = "String";
|
|
77526
77562
|
if (type.getQualifiedName() !== undefined) {
|
|
77527
|
-
extra = "{qualifiedName: \"" + ((
|
|
77563
|
+
extra = "{qualifiedName: \"" + ((_d = type.getQualifiedName()) === null || _d === void 0 ? void 0 : _d.toUpperCase()) + "\"}";
|
|
77528
77564
|
}
|
|
77529
77565
|
}
|
|
77530
77566
|
else if (type instanceof abaplint.BasicTypes.UTCLongType) {
|
|
77531
77567
|
resolved = "UTCLong";
|
|
77532
77568
|
if (type.getQualifiedName() !== undefined) {
|
|
77533
|
-
extra = "{qualifiedName: \"" + ((
|
|
77569
|
+
extra = "{qualifiedName: \"" + ((_e = type.getQualifiedName()) === null || _e === void 0 ? void 0 : _e.toUpperCase()) + "\"}";
|
|
77534
77570
|
}
|
|
77535
77571
|
}
|
|
77536
77572
|
else if (type instanceof abaplint.BasicTypes.DateType) {
|
|
77537
77573
|
resolved = "Date";
|
|
77538
77574
|
if (type.getQualifiedName() !== undefined) {
|
|
77539
|
-
extra = "{qualifiedName: \"" + ((
|
|
77575
|
+
extra = "{qualifiedName: \"" + ((_f = type.getQualifiedName()) === null || _f === void 0 ? void 0 : _f.toUpperCase()) + "\"}";
|
|
77540
77576
|
}
|
|
77541
77577
|
}
|
|
77542
77578
|
else if (type instanceof abaplint.BasicTypes.TimeType) {
|
|
77543
77579
|
resolved = "Time";
|
|
77544
77580
|
if (type.getQualifiedName() !== undefined) {
|
|
77545
|
-
extra = "{qualifiedName: \"" + ((
|
|
77581
|
+
extra = "{qualifiedName: \"" + ((_g = type.getQualifiedName()) === null || _g === void 0 ? void 0 : _g.toUpperCase()) + "\"}";
|
|
77546
77582
|
}
|
|
77547
77583
|
}
|
|
77548
77584
|
else if (type instanceof abaplint.BasicTypes.DataReference) {
|
|
@@ -77613,7 +77649,7 @@ class TranspileTypes {
|
|
|
77613
77649
|
else if (type instanceof abaplint.BasicTypes.XStringType) {
|
|
77614
77650
|
resolved = "XString";
|
|
77615
77651
|
if (type.getQualifiedName() !== undefined) {
|
|
77616
|
-
extra = "{qualifiedName: \"" + ((
|
|
77652
|
+
extra = "{qualifiedName: \"" + ((_h = type.getQualifiedName()) === null || _h === void 0 ? void 0 : _h.toUpperCase()) + "\"}";
|
|
77617
77653
|
}
|
|
77618
77654
|
}
|
|
77619
77655
|
else if (type instanceof abaplint.BasicTypes.XSequenceType) {
|
|
@@ -77629,13 +77665,13 @@ class TranspileTypes {
|
|
|
77629
77665
|
else if (type instanceof abaplint.BasicTypes.FloatType) {
|
|
77630
77666
|
resolved = "Float";
|
|
77631
77667
|
if (type.getQualifiedName() !== undefined) {
|
|
77632
|
-
extra = "{qualifiedName: \"" + ((
|
|
77668
|
+
extra = "{qualifiedName: \"" + ((_j = type.getQualifiedName()) === null || _j === void 0 ? void 0 : _j.toUpperCase()) + "\"}";
|
|
77633
77669
|
}
|
|
77634
77670
|
}
|
|
77635
77671
|
else if (type instanceof abaplint.BasicTypes.FloatingPointType) {
|
|
77636
77672
|
resolved = "Float";
|
|
77637
77673
|
if (type.getQualifiedName() !== undefined) {
|
|
77638
|
-
extra = "{qualifiedName: \"" + ((
|
|
77674
|
+
extra = "{qualifiedName: \"" + ((_k = type.getQualifiedName()) === null || _k === void 0 ? void 0 : _k.toUpperCase()) + "\"}";
|
|
77639
77675
|
}
|
|
77640
77676
|
}
|
|
77641
77677
|
else if (type instanceof abaplint.BasicTypes.DecFloat34Type) {
|
|
@@ -78146,14 +78182,8 @@ class Traversal {
|
|
|
78146
78182
|
if (def === undefined) {
|
|
78147
78183
|
return "";
|
|
78148
78184
|
}
|
|
78149
|
-
const name = def.getName();
|
|
78150
|
-
|
|
78151
|
-
const prefix = this.buildPrefix();
|
|
78152
|
-
return `abap.Classes['${prefix}-${name.toUpperCase()}'] = ${Traversal.escapeNamespace(name.toLowerCase())};`;
|
|
78153
|
-
}
|
|
78154
|
-
else {
|
|
78155
|
-
return `abap.Classes['${name.toUpperCase()}'] = ${Traversal.escapeNamespace(name.toLowerCase())};`;
|
|
78156
|
-
}
|
|
78185
|
+
const name = this.buildInternalName(def.getName(), def);
|
|
78186
|
+
return `abap.Classes['${name}'] = ${Traversal.escapeNamespace(def.getName().toLowerCase())};`;
|
|
78157
78187
|
}
|
|
78158
78188
|
setValues(identifier, name) {
|
|
78159
78189
|
return Traversal.setValues(identifier, name);
|
|
@@ -78178,8 +78208,21 @@ class Traversal {
|
|
|
78178
78208
|
}
|
|
78179
78209
|
return ret;
|
|
78180
78210
|
}
|
|
78181
|
-
|
|
78211
|
+
buildInternalName(name, def) {
|
|
78182
78212
|
var _a, _b;
|
|
78213
|
+
if (def) {
|
|
78214
|
+
if (def.isGlobal() === false) {
|
|
78215
|
+
const prefix = this.buildPrefix();
|
|
78216
|
+
return `${prefix}-${(_a = def === null || def === void 0 ? void 0 : def.getName()) === null || _a === void 0 ? void 0 : _a.toUpperCase()}`;
|
|
78217
|
+
}
|
|
78218
|
+
else {
|
|
78219
|
+
return (_b = def === null || def === void 0 ? void 0 : def.getName()) === null || _b === void 0 ? void 0 : _b.toUpperCase();
|
|
78220
|
+
}
|
|
78221
|
+
}
|
|
78222
|
+
// assume global
|
|
78223
|
+
return name.toUpperCase();
|
|
78224
|
+
}
|
|
78225
|
+
lookupClassOrInterface(name, token, directGlobal = false) {
|
|
78183
78226
|
if (name === undefined || token === undefined) {
|
|
78184
78227
|
return "abap.Classes['undefined']";
|
|
78185
78228
|
}
|
|
@@ -78187,24 +78230,12 @@ class Traversal {
|
|
|
78187
78230
|
return "abap.Classes[" + name + ".trimEnd()]";
|
|
78188
78231
|
}
|
|
78189
78232
|
const scope = this.findCurrentScopeByToken(token);
|
|
78190
|
-
// todo, add explicit type,
|
|
78191
78233
|
let def = scope === null || scope === void 0 ? void 0 : scope.findClassDefinition(name);
|
|
78192
78234
|
if (def === undefined) {
|
|
78193
78235
|
def = scope === null || scope === void 0 ? void 0 : scope.findInterfaceDefinition(name);
|
|
78194
78236
|
}
|
|
78195
|
-
|
|
78196
|
-
|
|
78197
|
-
const prefix = this.buildPrefix();
|
|
78198
|
-
return `abap.Classes['${prefix}-${(_a = def === null || def === void 0 ? void 0 : def.getName()) === null || _a === void 0 ? void 0 : _a.toUpperCase()}']`;
|
|
78199
|
-
}
|
|
78200
|
-
else {
|
|
78201
|
-
return `abap.Classes['${(_b = def === null || def === void 0 ? void 0 : def.getName()) === null || _b === void 0 ? void 0 : _b.toUpperCase()}']`;
|
|
78202
|
-
}
|
|
78203
|
-
}
|
|
78204
|
-
else {
|
|
78205
|
-
// assume global
|
|
78206
|
-
return "abap.Classes['" + name.toUpperCase() + "']";
|
|
78207
|
-
}
|
|
78237
|
+
const internalName = this.buildInternalName(name, def);
|
|
78238
|
+
return "abap.Classes['" + internalName + "']";
|
|
78208
78239
|
}
|
|
78209
78240
|
buildPrefix() {
|
|
78210
78241
|
return this.obj.getType() + "-" + this.obj.getName();
|
|
@@ -80365,8 +80396,20 @@ const parseXml = function(xmlData) {
|
|
|
80365
80396
|
textData = this.saveTextToParentTag(textData, currentNode, jPath);
|
|
80366
80397
|
}
|
|
80367
80398
|
|
|
80368
|
-
|
|
80369
|
-
|
|
80399
|
+
//check if last tag of nested tag was unpaired tag
|
|
80400
|
+
const lastTagName = jPath.substring(jPath.lastIndexOf(".")+1);
|
|
80401
|
+
if(tagName && this.options.unpairedTags.indexOf(tagName) !== -1 ){
|
|
80402
|
+
throw new Error(`Unpaired tag can not be used as closing tag: </${tagName}>`);
|
|
80403
|
+
}
|
|
80404
|
+
let propIndex = 0
|
|
80405
|
+
if(lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1 ){
|
|
80406
|
+
propIndex = jPath.lastIndexOf('.', jPath.lastIndexOf('.')-1)
|
|
80407
|
+
this.tagsNodeStack.pop();
|
|
80408
|
+
}else{
|
|
80409
|
+
propIndex = jPath.lastIndexOf(".");
|
|
80410
|
+
}
|
|
80411
|
+
jPath = jPath.substring(0, propIndex);
|
|
80412
|
+
|
|
80370
80413
|
currentNode = this.tagsNodeStack.pop();//avoid recursion, set the parent tag scope
|
|
80371
80414
|
textData = "";
|
|
80372
80415
|
i = closeIndex;
|
|
@@ -80443,23 +80486,22 @@ const parseXml = function(xmlData) {
|
|
|
80443
80486
|
}
|
|
80444
80487
|
}
|
|
80445
80488
|
|
|
80446
|
-
if(tagName !== xmlObj.tagname){
|
|
80447
|
-
jPath += jPath ? "." + tagName : tagName;
|
|
80448
|
-
}
|
|
80449
|
-
|
|
80450
80489
|
//check if last tag was unpaired tag
|
|
80451
80490
|
const lastTag = currentNode;
|
|
80452
80491
|
if(lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1 ){
|
|
80453
80492
|
currentNode = this.tagsNodeStack.pop();
|
|
80493
|
+
jPath = jPath.substring(0, jPath.lastIndexOf("."));
|
|
80494
|
+
}
|
|
80495
|
+
if(tagName !== xmlObj.tagname){
|
|
80496
|
+
jPath += jPath ? "." + tagName : tagName;
|
|
80454
80497
|
}
|
|
80455
|
-
|
|
80456
80498
|
if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) { //TODO: namespace
|
|
80457
80499
|
let tagContent = "";
|
|
80458
80500
|
//self-closing tag
|
|
80459
80501
|
if(tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1){
|
|
80460
80502
|
i = result.closeIndex;
|
|
80461
80503
|
}
|
|
80462
|
-
//
|
|
80504
|
+
//unpaired tag
|
|
80463
80505
|
else if(this.options.unpairedTags.indexOf(tagName) !== -1){
|
|
80464
80506
|
i = result.closeIndex;
|
|
80465
80507
|
}
|
|
@@ -80502,8 +80544,8 @@ const parseXml = function(xmlData) {
|
|
|
80502
80544
|
if(tagName !== tagExp && attrExpPresent){
|
|
80503
80545
|
childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName);
|
|
80504
80546
|
}
|
|
80505
|
-
jPath = jPath.substr(0, jPath.lastIndexOf("."));
|
|
80506
80547
|
this.addChild(currentNode, childNode, jPath)
|
|
80548
|
+
jPath = jPath.substr(0, jPath.lastIndexOf("."));
|
|
80507
80549
|
}
|
|
80508
80550
|
//opening tag
|
|
80509
80551
|
else{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.27",
|
|
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.6.
|
|
28
|
+
"@abaplint/transpiler": "^2.6.27",
|
|
29
29
|
"@types/glob": "^7.2.0",
|
|
30
30
|
"glob": "=7.2.0",
|
|
31
31
|
"@types/progress": "^2.0.5",
|
|
32
|
-
"@types/node": "^18.15.
|
|
33
|
-
"@abaplint/core": "^2.97.
|
|
32
|
+
"@types/node": "^18.15.13",
|
|
33
|
+
"@abaplint/core": "^2.97.16",
|
|
34
34
|
"progress": "^2.0.3",
|
|
35
35
|
"webpack": "^5.80.0",
|
|
36
|
-
"webpack-cli": "^5.0.
|
|
36
|
+
"webpack-cli": "^5.0.2",
|
|
37
37
|
"typescript": "^5.0.4"
|
|
38
38
|
}
|
|
39
39
|
}
|