@abaplint/cli 2.102.9 → 2.102.11

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.
Files changed (2) hide show
  1. package/build/cli.js +22 -11
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -21858,6 +21858,7 @@ class TypeUtils {
21858
21858
  return false;
21859
21859
  }
21860
21860
  else if (target instanceof basic_1.IntegerType
21861
+ || target instanceof basic_1.CharacterType
21861
21862
  || target instanceof basic_1.StringType) {
21862
21863
  if (source instanceof basic_1.TableType && source.isWithHeader() === false) {
21863
21864
  return false;
@@ -48556,7 +48557,7 @@ class Registry {
48556
48557
  }
48557
48558
  static abaplintVersion() {
48558
48559
  // magic, see build script "version.sh"
48559
- return "2.102.9";
48560
+ return "2.102.11";
48560
48561
  }
48561
48562
  getDDICReferences() {
48562
48563
  return this.ddicReferences;
@@ -53959,7 +53960,7 @@ ${indentation}`);
53959
53960
  if (tt === undefined) {
53960
53961
  return undefined;
53961
53962
  }
53962
- const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
53963
+ const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax, "ty_");
53963
53964
  const code = `TYPES ${uniqueName} ${tt.concatTokens()}.\n`;
53964
53965
  const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), code);
53965
53966
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, tt.getFirstToken().getStart(), tt.getLastToken().getEnd(), "TYPE " + uniqueName);
@@ -55704,15 +55705,15 @@ ${indentation} output = ${uniqueName}.\n`;
55704
55705
  }
55705
55706
  return undefined;
55706
55707
  }
55707
- uniqueName(position, filename, highSyntax) {
55708
+ uniqueName(position, filename, highSyntax, prefix = "") {
55708
55709
  const spag = highSyntax.spaghetti.lookupPosition(position, filename);
55709
55710
  if (spag === undefined) {
55710
- const name = "temprr" + this.counter;
55711
+ const name = prefix + "temprr" + this.counter;
55711
55712
  this.counter++;
55712
55713
  return name;
55713
55714
  }
55714
55715
  while (true) {
55715
- const name = "temp" + this.counter;
55716
+ const name = prefix + "temp" + this.counter;
55716
55717
  const exists = this.existsRecursive(spag, name);
55717
55718
  this.counter++;
55718
55719
  if (exists === false) {
@@ -55739,7 +55740,7 @@ ${indentation} output = ${uniqueName}.\n`;
55739
55740
  && r.position.getName().toUpperCase() === "XSDBOOL") {
55740
55741
  const token = r.position.getToken();
55741
55742
  let source = undefined;
55742
- for (const s of node.findAllExpressions(Expressions.Source)) {
55743
+ for (const s of node.findAllExpressionsRecursive(Expressions.Source)) {
55743
55744
  if (s.getFirstToken().getStart().equals(token.getStart())) {
55744
55745
  source = s;
55745
55746
  break;
@@ -70994,10 +70995,19 @@ Builder.prototype.j2x = function(jObj, level) {
70994
70995
  let val = '';
70995
70996
  for (let key in jObj) {
70996
70997
  if (typeof jObj[key] === 'undefined') {
70997
- // supress undefined node
70998
+ // supress undefined node only if it is not an attribute
70999
+ if (this.isAttribute(key)) {
71000
+ val += '';
71001
+ }
70998
71002
  } else if (jObj[key] === null) {
70999
- if(key[0] === "?") val += this.indentate(level) + '<' + key + '?' + this.tagEndChar;
71000
- else val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;
71003
+ // null attribute should be ignored by the attribute list, but should not cause the tag closing
71004
+ if (this.isAttribute(key)) {
71005
+ val += '';
71006
+ } else if (key[0] === '?') {
71007
+ val += this.indentate(level) + '<' + key + '?' + this.tagEndChar;
71008
+ } else {
71009
+ val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;
71010
+ }
71001
71011
  // val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;
71002
71012
  } else if (jObj[key] instanceof Date) {
71003
71013
  val += this.buildTextValNode(jObj[key], key, '', level);
@@ -71090,7 +71100,8 @@ Builder.prototype.buildObjectNode = function(val, key, attrStr, level) {
71090
71100
  tagEndExp = "";
71091
71101
  }
71092
71102
 
71093
- if (attrStr && val.indexOf('<') === -1) {
71103
+ // attrStr is an empty string in case the attribute came as undefined or null
71104
+ if ((attrStr || attrStr === '') && val.indexOf('<') === -1) {
71094
71105
  return ( this.indentate(level) + '<' + key + attrStr + piClosingChar + '>' + val + tagEndExp );
71095
71106
  } else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) {
71096
71107
  return this.indentate(level) + `<!--${val}-->` + this.newLine;
@@ -71163,7 +71174,7 @@ function indentate(level) {
71163
71174
  }
71164
71175
 
71165
71176
  function isAttribute(name /*, options*/) {
71166
- if (name.startsWith(this.options.attributeNamePrefix)) {
71177
+ if (name.startsWith(this.options.attributeNamePrefix) && name !== this.options.textNodeName) {
71167
71178
  return name.substr(this.attrPrefixLen);
71168
71179
  } else {
71169
71180
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.102.9",
3
+ "version": "2.102.11",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "homepage": "https://abaplint.org",
40
40
  "devDependencies": {
41
- "@abaplint/core": "^2.102.9",
41
+ "@abaplint/core": "^2.102.11",
42
42
  "@types/chai": "^4.3.5",
43
43
  "@types/glob": "^7.2.0",
44
44
  "@types/minimist": "^1.2.2",