@abaplint/cli 2.113.156 → 2.113.158

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 +45 -13
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -99,6 +99,14 @@ class FileOperations {
99
99
  }
100
100
  fs.rmSync(dir, { recursive: true });
101
101
  }
102
+ static toUnixPath(path) {
103
+ if (os.platform() === "win32") {
104
+ return path.replace(/[\\/]+/g, "/").replace(/^([a-zA-Z]+:|\.\/)/, "");
105
+ }
106
+ else {
107
+ return path;
108
+ }
109
+ }
102
110
  static loadFileNames(arg, error = true) {
103
111
  const files = glob.sync(arg, { nodir: true, absolute: true, posix: true });
104
112
  if (files.length === 0 && error) {
@@ -966,14 +974,10 @@ async function loadDependencies(config, compress, bar, base) {
966
974
  continue;
967
975
  }
968
976
  }
969
- const toUnixPath = (path) => path.replace(/[\\/]+/g, "/").replace(/^([a-zA-Z]+:|\.\/)/, "");
970
977
  if (d.url) {
971
978
  process.stderr.write("Clone: " + d.url + "\n");
972
979
  let dir = fs.mkdtempSync(path.join(os.tmpdir(), "abaplint-"));
973
- if (os.platform() === "win32") {
974
- // must be converted to posix for glob patterns like "/{foo,src}/**/*.*" to work
975
- dir = toUnixPath(dir);
976
- }
980
+ dir = file_operations_1.FileOperations.toUnixPath(dir);
977
981
  let branch = "";
978
982
  if (d.branch) {
979
983
  branch = "-b " + d.branch + " ";
@@ -1163,16 +1167,18 @@ class Rename {
1163
1167
  }
1164
1168
  ////////////////////////
1165
1169
  write(rconfig, base, fs) {
1166
- const outputFolder = base + path.sep + rconfig.output;
1170
+ const outputFolder = base + path.posix.sep + rconfig.output;
1167
1171
  console.log("Base: " + base);
1168
1172
  console.log("Output folder: " + outputFolder);
1169
1173
  file_operations_1.FileOperations.deleteFolderRecursive(outputFolder);
1174
+ const myBase = file_operations_1.FileOperations.toUnixPath(path.resolve(base));
1170
1175
  for (const o of this.reg.getObjects()) {
1171
1176
  if (this.reg.isDependency(o) === true) {
1172
1177
  continue;
1173
1178
  }
1174
1179
  for (const f of o.getFiles()) {
1175
- const n = outputFolder + f.getFilename().replace(base, "");
1180
+ // yea, ffs
1181
+ const n = outputFolder + f.getFilename().replace(myBase, "").replace("//?/C:", "");
1176
1182
  console.log("Write " + n);
1177
1183
  fs.mkdirSync(path.dirname(n), { recursive: true });
1178
1184
  fs.writeFileSync(n, f.getRaw());
@@ -28109,6 +28115,10 @@ class Source {
28109
28115
  {
28110
28116
  const foundType = this.determineType(node, input, targetType);
28111
28117
  const bodyType = cond_body_1.CondBody.runSyntax(node.findDirectExpression(Expressions.CondBody), input, foundType);
28118
+ /*
28119
+ console.log("COND BODY type;:");
28120
+ console.dir(bodyType);
28121
+ */
28112
28122
  if (foundType === undefined || foundType.isGeneric()) {
28113
28123
  this.addIfInferred(node, input, bodyType);
28114
28124
  }
@@ -28136,15 +28146,28 @@ class Source {
28136
28146
  }
28137
28147
  case "REF":
28138
28148
  {
28139
- const foundType = this.determineType(node, input, targetType);
28149
+ let foundType = this.determineType(node, input, targetType);
28140
28150
  const s = Source.runSyntax(node.findDirectExpression(Expressions.Source), input);
28151
+ /*
28152
+ console.dir(node.concatTokens());
28153
+ console.dir(targetType);
28154
+ console.dir(foundType);
28155
+ console.dir(s);
28156
+ */
28141
28157
  if (foundType === undefined && s) {
28142
- return new basic_1.DataReference(s);
28158
+ foundType = new basic_1.DataReference(s);
28159
+ }
28160
+ else if (foundType && targetType === undefined) {
28161
+ foundType = new basic_1.DataReference(foundType);
28143
28162
  }
28144
- else if (foundType) {
28145
- return new basic_1.DataReference(foundType);
28163
+ /*
28164
+ if (targetType && !(targetType instanceof DataReference)) {
28165
+ const message = `REF: Types not compatible, ` + targetType.constructor.name;
28166
+ input.issues.push(syntaxIssue(input, node.getFirstToken(), message));
28146
28167
  }
28147
- return undefined;
28168
+ */
28169
+ this.addIfInferred(node, input, foundType);
28170
+ return foundType;
28148
28171
  }
28149
28172
  case "FILTER":
28150
28173
  {
@@ -28294,11 +28317,20 @@ class Source {
28294
28317
  const typeExpression = node.findDirectExpression(Expressions.TypeNameOrInfer);
28295
28318
  const typeToken = typeExpression === null || typeExpression === void 0 ? void 0 : typeExpression.getFirstToken();
28296
28319
  const typeName = typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr();
28320
+ /*
28321
+ console.dir(inferredType);
28322
+ console.dir(typeToken);
28323
+ */
28324
+ // hmm, need to align all this
28297
28325
  if (typeName === "#" && inferredType && typeToken) {
28298
28326
  const found = basic.lookupQualifiedName(inferredType.getQualifiedName());
28299
28327
  if (found) {
28300
28328
  input.scope.addReference(typeToken, found, _reference_1.ReferenceType.InferredType, input.filename);
28301
28329
  }
28330
+ else if (inferredType instanceof basic_1.DataReference) {
28331
+ const tid = new _typed_identifier_1.TypedIdentifier(typeToken, input.filename, inferredType);
28332
+ input.scope.addReference(typeToken, tid, _reference_1.ReferenceType.InferredType, input.filename);
28333
+ }
28302
28334
  else if (inferredType instanceof basic_1.ObjectReferenceType) {
28303
28335
  const def = input.scope.findObjectDefinition(inferredType.getQualifiedName());
28304
28336
  if (def) {
@@ -54759,7 +54791,7 @@ class Registry {
54759
54791
  }
54760
54792
  static abaplintVersion() {
54761
54793
  // magic, see build script "version.sh"
54762
- return "2.113.155";
54794
+ return "2.113.158";
54763
54795
  }
54764
54796
  getDDICReferences() {
54765
54797
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.113.156",
3
+ "version": "2.113.158",
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.113.155",
41
+ "@abaplint/core": "^2.113.158",
42
42
  "@types/chai": "^4.3.20",
43
43
  "@types/minimist": "^1.2.5",
44
44
  "@types/mocha": "^10.0.10",