@abaplint/transpiler-cli 2.4.8 → 2.4.10
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 +110 -93
- package/package.json +3 -3
package/build/bundle.js
CHANGED
|
@@ -7322,7 +7322,7 @@ const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules
|
|
|
7322
7322
|
class Throw extends combi_1.Expression {
|
|
7323
7323
|
getRunnable() {
|
|
7324
7324
|
// todo, MESSAGE
|
|
7325
|
-
return (0, combi_1.seq)("THROW", (0, combi_1.opt)("RESUMABLE"), _1.ClassName, (0, combi_1.tok)(tokens_1.ParenLeftW), (0, combi_1.opt)((0, combi_1.alt)(_1.Source, _1.ParameterListS)), (0, combi_1.tok)(tokens_1.WParenRightW));
|
|
7325
|
+
return (0, combi_1.seq)("THROW", (0, combi_1.opt)("RESUMABLE"), _1.ClassName, (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenLeftW), (0, combi_1.tok)(tokens_1.ParenLeft)), (0, combi_1.opt)((0, combi_1.alt)(_1.Source, _1.ParameterListS)), (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WParenRightW), (0, combi_1.tok)(tokens_1.ParenRightW)));
|
|
7326
7326
|
}
|
|
7327
7327
|
}
|
|
7328
7328
|
exports.Throw = Throw;
|
|
@@ -7631,13 +7631,13 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
7631
7631
|
exports.WriteOffsetLength = void 0;
|
|
7632
7632
|
const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
7633
7633
|
const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
|
|
7634
|
-
const
|
|
7634
|
+
const simple_field_chain2_1 = __webpack_require__(/*! ./simple_field_chain2 */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/simple_field_chain2.js");
|
|
7635
7635
|
class WriteOffsetLength extends combi_1.Expression {
|
|
7636
7636
|
getRunnable() {
|
|
7637
|
-
const post = (0, combi_1.seq)((0, combi_1.alt)(
|
|
7637
|
+
const post = (0, combi_1.seq)((0, combi_1.alt)(simple_field_chain2_1.SimpleFieldChain2, (0, combi_1.regex)(/^[\d]+$/), (0, combi_1.regex)(/^\*$/)), (0, combi_1.alt)((0, combi_1.tok)(tokens_1.ParenRightW), (0, combi_1.tok)(tokens_1.ParenRight)));
|
|
7638
7638
|
const wlength = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeft), post);
|
|
7639
7639
|
const length = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeft), post);
|
|
7640
|
-
const complex = (0, combi_1.alt)(wlength, (0, combi_1.seq)((0, combi_1.alt)(
|
|
7640
|
+
const complex = (0, combi_1.alt)(wlength, (0, combi_1.seq)((0, combi_1.alt)(simple_field_chain2_1.SimpleFieldChain2, (0, combi_1.regex)(/^\/?[\w\d]+$/), "/"), (0, combi_1.opt)(length)));
|
|
7641
7641
|
const at = (0, combi_1.seq)((0, combi_1.opt)("AT"), complex);
|
|
7642
7642
|
return at;
|
|
7643
7643
|
}
|
|
@@ -21431,16 +21431,17 @@ const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@ab
|
|
|
21431
21431
|
const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
21432
21432
|
const source_1 = __webpack_require__(/*! ./source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js");
|
|
21433
21433
|
const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js");
|
|
21434
|
+
const basic_types_1 = __webpack_require__(/*! ../basic_types */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/basic_types.js");
|
|
21434
21435
|
class Cast {
|
|
21435
21436
|
runSyntax(node, scope, targetType, filename) {
|
|
21436
|
-
var _a;
|
|
21437
21437
|
const sourceNode = node.findDirectExpression(Expressions.Source);
|
|
21438
21438
|
if (sourceNode === undefined) {
|
|
21439
21439
|
throw new Error("Cast, source node not found");
|
|
21440
21440
|
}
|
|
21441
21441
|
const sourceType = new source_1.Source().runSyntax(sourceNode, scope, filename);
|
|
21442
21442
|
let tt = undefined;
|
|
21443
|
-
const
|
|
21443
|
+
const typeExpression = node.findDirectExpression(Expressions.TypeNameOrInfer);
|
|
21444
|
+
const typeName = typeExpression === null || typeExpression === void 0 ? void 0 : typeExpression.concatTokens();
|
|
21444
21445
|
if (typeName === undefined) {
|
|
21445
21446
|
throw new Error("Cast, child TypeNameOrInfer not found");
|
|
21446
21447
|
}
|
|
@@ -21450,18 +21451,28 @@ class Cast {
|
|
|
21450
21451
|
else if (typeName === "#") {
|
|
21451
21452
|
throw new Error("Cast, todo, infer type");
|
|
21452
21453
|
}
|
|
21453
|
-
if (tt === undefined) {
|
|
21454
|
-
const
|
|
21455
|
-
|
|
21454
|
+
if (tt === undefined && typeExpression) {
|
|
21455
|
+
const basic = new basic_types_1.BasicTypes(filename, scope);
|
|
21456
|
+
tt = basic.parseType(typeExpression);
|
|
21457
|
+
if (tt === undefined || tt instanceof basic_1.VoidType || tt instanceof basic_1.UnknownType) {
|
|
21458
|
+
const found = scope.findObjectDefinition(typeName);
|
|
21459
|
+
if (found) {
|
|
21460
|
+
tt = new basic_1.ObjectReferenceType(found, typeName);
|
|
21461
|
+
}
|
|
21462
|
+
}
|
|
21463
|
+
else {
|
|
21464
|
+
tt = new basic_1.DataReference(tt, typeName);
|
|
21465
|
+
}
|
|
21466
|
+
if (tt === undefined && scope.getDDIC().inErrorNamespace(typeName) === false) {
|
|
21456
21467
|
tt = new basic_1.VoidType(typeName);
|
|
21457
21468
|
}
|
|
21458
|
-
else if (
|
|
21469
|
+
else if (typeName.toUpperCase() === "OBJECT") {
|
|
21470
|
+
return new basic_1.GenericObjectReferenceType();
|
|
21471
|
+
}
|
|
21472
|
+
else if (tt === undefined) {
|
|
21459
21473
|
// todo, this should be an UnknownType instead?
|
|
21460
21474
|
throw new Error("Type \"" + typeName + "\" not found in scope, Cast");
|
|
21461
21475
|
}
|
|
21462
|
-
else {
|
|
21463
|
-
tt = new basic_1.ObjectReferenceType(found, typeName);
|
|
21464
|
-
}
|
|
21465
21476
|
}
|
|
21466
21477
|
new source_1.Source().addIfInferred(node, scope, filename, tt);
|
|
21467
21478
|
if (new _type_utils_1.TypeUtils(scope).isCastable(sourceType, tt) === false) {
|
|
@@ -24583,6 +24594,11 @@ class ValueBody {
|
|
|
24583
24594
|
if (node === undefined) {
|
|
24584
24595
|
return targetType;
|
|
24585
24596
|
}
|
|
24597
|
+
let letScoped = false;
|
|
24598
|
+
const letNode = node.findDirectExpression(Expressions.Let);
|
|
24599
|
+
if (letNode) {
|
|
24600
|
+
letScoped = new let_1.Let().runSyntax(letNode, scope, filename);
|
|
24601
|
+
}
|
|
24586
24602
|
let forScopes = 0;
|
|
24587
24603
|
for (const forNode of node.findDirectExpressions(Expressions.For) || []) {
|
|
24588
24604
|
const scoped = new for_1.For().runSyntax(forNode, scope, filename);
|
|
@@ -24590,11 +24606,6 @@ class ValueBody {
|
|
|
24590
24606
|
forScopes++;
|
|
24591
24607
|
}
|
|
24592
24608
|
}
|
|
24593
|
-
let letScoped = false;
|
|
24594
|
-
const letNode = node.findDirectExpression(Expressions.Let);
|
|
24595
|
-
if (letNode) {
|
|
24596
|
-
letScoped = new let_1.Let().runSyntax(letNode, scope, filename);
|
|
24597
|
-
}
|
|
24598
24609
|
for (const s of node.findDirectExpressions(Expressions.FieldAssignment)) {
|
|
24599
24610
|
new field_assignment_1.FieldAssignment().runSyntax(s, scope, filename, targetType);
|
|
24600
24611
|
}
|
|
@@ -27992,6 +28003,9 @@ class Parameter {
|
|
|
27992
28003
|
runSyntax(node, scope, filename) {
|
|
27993
28004
|
var _a;
|
|
27994
28005
|
const nameToken = (_a = node.findFirstExpression(Expressions.FieldSub)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
28006
|
+
if (nameToken && nameToken.getStr().length > 8) {
|
|
28007
|
+
throw new Error("Parameter name too long, " + nameToken.getStr());
|
|
28008
|
+
}
|
|
27995
28009
|
const bfound = new basic_types_1.BasicTypes(filename, scope).parseType(node);
|
|
27996
28010
|
if (nameToken && bfound) {
|
|
27997
28011
|
scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, filename, bfound));
|
|
@@ -28641,6 +28655,9 @@ class SelectOption {
|
|
|
28641
28655
|
runSyntax(node, scope, filename) {
|
|
28642
28656
|
var _a;
|
|
28643
28657
|
const nameToken = (_a = node.findFirstExpression(Expressions.FieldSub)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
28658
|
+
if (nameToken && nameToken.getStr().length > 8) {
|
|
28659
|
+
throw new Error("Select-option name too long, " + nameToken.getStr());
|
|
28660
|
+
}
|
|
28644
28661
|
for (const d of node.findDirectExpressions(Expressions.Dynamic)) {
|
|
28645
28662
|
new dynamic_1.Dynamic().runSyntax(d, scope, filename);
|
|
28646
28663
|
}
|
|
@@ -29632,6 +29649,8 @@ const source_1 = __webpack_require__(/*! ../expressions/source */ "./node_module
|
|
|
29632
29649
|
const target_1 = __webpack_require__(/*! ../expressions/target */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js");
|
|
29633
29650
|
const dynamic_1 = __webpack_require__(/*! ../expressions/dynamic */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dynamic.js");
|
|
29634
29651
|
const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js");
|
|
29652
|
+
const field_chain_1 = __webpack_require__(/*! ../expressions/field_chain */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_chain.js");
|
|
29653
|
+
const _reference_1 = __webpack_require__(/*! ../_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
|
|
29635
29654
|
class Write {
|
|
29636
29655
|
runSyntax(node, scope, filename) {
|
|
29637
29656
|
// todo, more
|
|
@@ -29644,6 +29663,9 @@ class Write {
|
|
|
29644
29663
|
throw new Error("Source not character like");
|
|
29645
29664
|
}
|
|
29646
29665
|
}
|
|
29666
|
+
for (const s of node.findAllExpressions(Expressions.SimpleFieldChain2)) {
|
|
29667
|
+
new field_chain_1.FieldChain().runSyntax(s, scope, filename, _reference_1.ReferenceType.DataReadReference);
|
|
29668
|
+
}
|
|
29647
29669
|
for (const s of node.findAllExpressions(Expressions.Dynamic)) {
|
|
29648
29670
|
new dynamic_1.Dynamic().runSyntax(s, scope, filename);
|
|
29649
29671
|
}
|
|
@@ -44407,8 +44429,12 @@ class Table extends _abstract_object_1.AbstractObject {
|
|
|
44407
44429
|
return undefined;
|
|
44408
44430
|
}
|
|
44409
44431
|
getAllowedNaming() {
|
|
44432
|
+
let length = 30;
|
|
44433
|
+
if (this.getTableCategory() === TableCategory.Transparent) {
|
|
44434
|
+
length = 16;
|
|
44435
|
+
}
|
|
44410
44436
|
return {
|
|
44411
|
-
maxLength:
|
|
44437
|
+
maxLength: length,
|
|
44412
44438
|
allowNamespace: true,
|
|
44413
44439
|
};
|
|
44414
44440
|
}
|
|
@@ -44963,7 +44989,7 @@ class View extends _abstract_object_1.AbstractObject {
|
|
|
44963
44989
|
}
|
|
44964
44990
|
getAllowedNaming() {
|
|
44965
44991
|
return {
|
|
44966
|
-
maxLength:
|
|
44992
|
+
maxLength: 16,
|
|
44967
44993
|
allowNamespace: true,
|
|
44968
44994
|
};
|
|
44969
44995
|
}
|
|
@@ -45829,7 +45855,7 @@ class Registry {
|
|
|
45829
45855
|
}
|
|
45830
45856
|
static abaplintVersion() {
|
|
45831
45857
|
// magic, see build script "version.sh"
|
|
45832
|
-
return "2.95.
|
|
45858
|
+
return "2.95.14";
|
|
45833
45859
|
}
|
|
45834
45860
|
getDDICReferences() {
|
|
45835
45861
|
return this.references;
|
|
@@ -77775,20 +77801,6 @@ function Builder(options) {
|
|
|
77775
77801
|
this.tagEndChar = '>';
|
|
77776
77802
|
this.newLine = '';
|
|
77777
77803
|
}
|
|
77778
|
-
|
|
77779
|
-
if (this.options.suppressEmptyNode) {
|
|
77780
|
-
this.buildTextNode = buildEmptyTextNode;
|
|
77781
|
-
this.buildObjNode = buildEmptyObjNode;
|
|
77782
|
-
} else {
|
|
77783
|
-
this.buildTextNode = buildTextValNode;
|
|
77784
|
-
this.buildObjNode = buildObjectNode;
|
|
77785
|
-
}
|
|
77786
|
-
|
|
77787
|
-
this.buildTextValNode = buildTextValNode;
|
|
77788
|
-
this.buildObjectNode = buildObjectNode;
|
|
77789
|
-
|
|
77790
|
-
this.replaceEntitiesValue = replaceEntitiesValue;
|
|
77791
|
-
this.buildAttrPairStr = buildAttrPairStr;
|
|
77792
77804
|
}
|
|
77793
77805
|
|
|
77794
77806
|
Builder.prototype.build = function(jObj) {
|
|
@@ -77815,7 +77827,7 @@ Builder.prototype.j2x = function(jObj, level) {
|
|
|
77815
77827
|
else val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;
|
|
77816
77828
|
// val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;
|
|
77817
77829
|
} else if (jObj[key] instanceof Date) {
|
|
77818
|
-
val += this.
|
|
77830
|
+
val += this.buildTextValNode(jObj[key], key, '', level);
|
|
77819
77831
|
} else if (typeof jObj[key] !== 'object') {
|
|
77820
77832
|
//premitive type
|
|
77821
77833
|
const attr = this.isAttribute(key);
|
|
@@ -77827,7 +77839,7 @@ Builder.prototype.j2x = function(jObj, level) {
|
|
|
77827
77839
|
let newval = this.options.tagValueProcessor(key, '' + jObj[key]);
|
|
77828
77840
|
val += this.replaceEntitiesValue(newval);
|
|
77829
77841
|
} else {
|
|
77830
|
-
val += this.
|
|
77842
|
+
val += this.buildTextValNode(jObj[key], key, '', level);
|
|
77831
77843
|
}
|
|
77832
77844
|
}
|
|
77833
77845
|
} else if (Array.isArray(jObj[key])) {
|
|
@@ -77844,7 +77856,7 @@ Builder.prototype.j2x = function(jObj, level) {
|
|
|
77844
77856
|
} else if (typeof item === 'object') {
|
|
77845
77857
|
val += this.processTextOrObjNode(item, key, level)
|
|
77846
77858
|
} else {
|
|
77847
|
-
val += this.
|
|
77859
|
+
val += this.buildTextValNode(item, key, '', level);
|
|
77848
77860
|
}
|
|
77849
77861
|
}
|
|
77850
77862
|
} else {
|
|
@@ -77863,7 +77875,7 @@ Builder.prototype.j2x = function(jObj, level) {
|
|
|
77863
77875
|
return {attrStr: attrStr, val: val};
|
|
77864
77876
|
};
|
|
77865
77877
|
|
|
77866
|
-
function
|
|
77878
|
+
Builder.prototype.buildAttrPairStr = function(attrName, val){
|
|
77867
77879
|
val = this.options.attributeValueProcessor(attrName, '' + val);
|
|
77868
77880
|
val = this.replaceEntitiesValue(val);
|
|
77869
77881
|
if (this.options.suppressBooleanAttributes && val === "true") {
|
|
@@ -77874,31 +77886,51 @@ function buildAttrPairStr(attrName, val){
|
|
|
77874
77886
|
function processTextOrObjNode (object, key, level) {
|
|
77875
77887
|
const result = this.j2x(object, level + 1);
|
|
77876
77888
|
if (object[this.options.textNodeName] !== undefined && Object.keys(object).length === 1) {
|
|
77877
|
-
return this.
|
|
77889
|
+
return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level);
|
|
77878
77890
|
} else {
|
|
77879
|
-
return this.
|
|
77891
|
+
return this.buildObjectNode(result.val, key, result.attrStr, level);
|
|
77880
77892
|
}
|
|
77881
77893
|
}
|
|
77882
77894
|
|
|
77883
|
-
function
|
|
77884
|
-
|
|
77885
|
-
|
|
77895
|
+
Builder.prototype.buildObjectNode = function(val, key, attrStr, level) {
|
|
77896
|
+
if(val === ""){
|
|
77897
|
+
if(key[0] === "?") return this.indentate(level) + '<' + key + attrStr+ '?' + this.tagEndChar;
|
|
77898
|
+
else {
|
|
77899
|
+
return this.indentate(level) + '<' + key + attrStr + this.closeTag(key) + this.tagEndChar;
|
|
77900
|
+
}
|
|
77901
|
+
}else{
|
|
77902
|
+
|
|
77903
|
+
let tagEndExp = '</' + key + this.tagEndChar;
|
|
77904
|
+
let piClosingChar = "";
|
|
77905
|
+
|
|
77906
|
+
if(key[0] === "?") {
|
|
77907
|
+
piClosingChar = "?";
|
|
77908
|
+
tagEndExp = "";
|
|
77909
|
+
}
|
|
77886
77910
|
|
|
77887
|
-
|
|
77888
|
-
|
|
77889
|
-
|
|
77911
|
+
if (attrStr && val.indexOf('<') === -1) {
|
|
77912
|
+
return ( this.indentate(level) + '<' + key + attrStr + piClosingChar + '>' + val + tagEndExp );
|
|
77913
|
+
} else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) {
|
|
77914
|
+
return this.indentate(level) + `<!--${val}-->` + this.newLine;
|
|
77915
|
+
}else {
|
|
77916
|
+
return (
|
|
77917
|
+
this.indentate(level) + '<' + key + attrStr + piClosingChar + this.tagEndChar +
|
|
77918
|
+
val +
|
|
77919
|
+
this.indentate(level) + tagEndExp );
|
|
77920
|
+
}
|
|
77890
77921
|
}
|
|
77922
|
+
}
|
|
77891
77923
|
|
|
77892
|
-
|
|
77893
|
-
|
|
77894
|
-
|
|
77895
|
-
|
|
77896
|
-
}else {
|
|
77897
|
-
|
|
77898
|
-
|
|
77899
|
-
|
|
77900
|
-
this.indentate(level) + tagEndExp );
|
|
77924
|
+
Builder.prototype.closeTag = function(key){
|
|
77925
|
+
let closeTag = "";
|
|
77926
|
+
if(this.options.unpairedTags.indexOf(key) !== -1){ //unpaired
|
|
77927
|
+
if(!this.options.suppressUnpairedNode) closeTag = "/"
|
|
77928
|
+
}else if(this.options.suppressEmptyNode){ //empty
|
|
77929
|
+
closeTag = "/";
|
|
77930
|
+
}else{
|
|
77931
|
+
closeTag = `></${key}`
|
|
77901
77932
|
}
|
|
77933
|
+
return closeTag;
|
|
77902
77934
|
}
|
|
77903
77935
|
|
|
77904
77936
|
function buildEmptyObjNode(val, key, attrStr, level) {
|
|
@@ -77906,36 +77938,35 @@ function buildEmptyObjNode(val, key, attrStr, level) {
|
|
|
77906
77938
|
return this.buildObjectNode(val, key, attrStr, level);
|
|
77907
77939
|
} else {
|
|
77908
77940
|
if(key[0] === "?") return this.indentate(level) + '<' + key + attrStr+ '?' + this.tagEndChar;
|
|
77909
|
-
else
|
|
77941
|
+
else {
|
|
77942
|
+
return this.indentate(level) + '<' + key + attrStr + '/' + this.tagEndChar;
|
|
77943
|
+
// return this.buildTagStr(level,key, attrStr);
|
|
77944
|
+
}
|
|
77910
77945
|
}
|
|
77911
77946
|
}
|
|
77912
77947
|
|
|
77913
|
-
function
|
|
77948
|
+
Builder.prototype.buildTextValNode = function(val, key, attrStr, level) {
|
|
77914
77949
|
if (this.options.cdataPropName !== false && key === this.options.cdataPropName) {
|
|
77915
77950
|
return this.indentate(level) + `<![CDATA[${val}]]>` + this.newLine;
|
|
77916
77951
|
}else if (this.options.commentPropName !== false && key === this.options.commentPropName) {
|
|
77917
77952
|
return this.indentate(level) + `<!--${val}-->` + this.newLine;
|
|
77953
|
+
}else if(key[0] === "?") {//PI tag
|
|
77954
|
+
return this.indentate(level) + '<' + key + attrStr+ '?' + this.tagEndChar;
|
|
77918
77955
|
}else{
|
|
77919
77956
|
let textValue = this.options.tagValueProcessor(key, val);
|
|
77920
77957
|
textValue = this.replaceEntitiesValue(textValue);
|
|
77921
77958
|
|
|
77922
|
-
if( textValue === ''
|
|
77923
|
-
|
|
77924
|
-
|
|
77925
|
-
|
|
77926
|
-
return this.indentate(level) + '<' + key + "/" + this.tagEndChar;
|
|
77927
|
-
}
|
|
77928
|
-
} else{
|
|
77929
|
-
return (
|
|
77930
|
-
this.indentate(level) + '<' + key + attrStr + '>' +
|
|
77959
|
+
if( textValue === ''){
|
|
77960
|
+
return this.indentate(level) + '<' + key + attrStr + this.closeTag(key) + this.tagEndChar;
|
|
77961
|
+
}else{
|
|
77962
|
+
return this.indentate(level) + '<' + key + attrStr + '>' +
|
|
77931
77963
|
textValue +
|
|
77932
|
-
'</' + key + this.tagEndChar
|
|
77964
|
+
'</' + key + this.tagEndChar;
|
|
77933
77965
|
}
|
|
77934
|
-
|
|
77935
77966
|
}
|
|
77936
77967
|
}
|
|
77937
77968
|
|
|
77938
|
-
function
|
|
77969
|
+
Builder.prototype.replaceEntitiesValue = function(textValue){
|
|
77939
77970
|
if(textValue && textValue.length > 0 && this.options.processEntities){
|
|
77940
77971
|
for (let i=0; i<this.options.entities.length; i++) {
|
|
77941
77972
|
const entity = this.options.entities[i];
|
|
@@ -77945,21 +77976,6 @@ function replaceEntitiesValue(textValue){
|
|
|
77945
77976
|
return textValue;
|
|
77946
77977
|
}
|
|
77947
77978
|
|
|
77948
|
-
function buildEmptyTextNode(val, key, attrStr, level) {
|
|
77949
|
-
if( val === '' && this.options.unpairedTags.indexOf(key) !== -1){ //unpaired
|
|
77950
|
-
if(this.options.suppressUnpairedNode){
|
|
77951
|
-
return this.indentate(level) + '<' + key + this.tagEndChar;
|
|
77952
|
-
}else{
|
|
77953
|
-
return this.indentate(level) + '<' + key + "/" + this.tagEndChar;
|
|
77954
|
-
}
|
|
77955
|
-
}else if (val !== '') { //empty
|
|
77956
|
-
return this.buildTextValNode(val, key, attrStr, level);
|
|
77957
|
-
} else {
|
|
77958
|
-
if(key[0] === "?") return this.indentate(level) + '<' + key + attrStr+ '?' + this.tagEndChar; //PI tag
|
|
77959
|
-
else return this.indentate(level) + '<' + key + attrStr + '/' + this.tagEndChar; //normal
|
|
77960
|
-
}
|
|
77961
|
-
}
|
|
77962
|
-
|
|
77963
77979
|
function indentate(level) {
|
|
77964
77980
|
return this.options.indentBy.repeat(level);
|
|
77965
77981
|
}
|
|
@@ -78140,7 +78156,7 @@ function readDocType(xmlData, i){
|
|
|
78140
78156
|
let hasBody = false, entity = false, comment = false;
|
|
78141
78157
|
let exp = "";
|
|
78142
78158
|
for(;i<xmlData.length;i++){
|
|
78143
|
-
if (xmlData[i] === '<') {
|
|
78159
|
+
if (xmlData[i] === '<' && !comment) {
|
|
78144
78160
|
if( hasBody &&
|
|
78145
78161
|
xmlData[i+1] === '!' &&
|
|
78146
78162
|
xmlData[i+2] === 'E' &&
|
|
@@ -78204,14 +78220,15 @@ function readDocType(xmlData, i){
|
|
|
78204
78220
|
if(comment){
|
|
78205
78221
|
if( xmlData[i - 1] === "-" && xmlData[i - 2] === "-"){
|
|
78206
78222
|
comment = false;
|
|
78207
|
-
|
|
78208
|
-
|
|
78223
|
+
angleBracketsCount--;
|
|
78224
|
+
}
|
|
78225
|
+
}else{
|
|
78226
|
+
if(entity) {
|
|
78227
|
+
parseEntityExp(exp, entities);
|
|
78228
|
+
entity = false;
|
|
78209
78229
|
}
|
|
78210
|
-
|
|
78211
|
-
parseEntityExp(exp, entities);
|
|
78212
|
-
entity = false;
|
|
78230
|
+
angleBracketsCount--;
|
|
78213
78231
|
}
|
|
78214
|
-
angleBracketsCount--;
|
|
78215
78232
|
if (angleBracketsCount === 0) {
|
|
78216
78233
|
break;
|
|
78217
78234
|
}
|
|
@@ -78267,7 +78284,7 @@ const defaultOptions = {
|
|
|
78267
78284
|
numberParseOptions: {
|
|
78268
78285
|
hex: true,
|
|
78269
78286
|
leadingZeros: true,
|
|
78270
|
-
eNotation:
|
|
78287
|
+
eNotation: true
|
|
78271
78288
|
},
|
|
78272
78289
|
tagValueProcessor: function(tagName, val) {
|
|
78273
78290
|
return val;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.10",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"bin": {
|
|
6
6
|
"abap_transpile": "./abap_transpile"
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"author": "abaplint",
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@abaplint/transpiler": "^2.4.
|
|
28
|
+
"@abaplint/transpiler": "^2.4.10",
|
|
29
29
|
"@types/glob": "^7.2.0",
|
|
30
30
|
"glob": "=7.2.0",
|
|
31
31
|
"@types/progress": "^2.0.5",
|
|
32
|
-
"@abaplint/core": "^2.95.
|
|
32
|
+
"@abaplint/core": "^2.95.14",
|
|
33
33
|
"progress": "^2.0.3",
|
|
34
34
|
"webpack": "^5.75.0",
|
|
35
35
|
"webpack-cli": "^5.0.1",
|