@abaplint/cli 2.103.6 → 2.103.7

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 +164 -99
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -1167,95 +1167,8 @@ exports.Lexer = void 0;
1167
1167
  const position_1 = __webpack_require__(/*! ../../position */ "./node_modules/@abaplint/core/build/src/position.js");
1168
1168
  const virtual_position_1 = __webpack_require__(/*! ../../virtual_position */ "./node_modules/@abaplint/core/build/src/virtual_position.js");
1169
1169
  const tokens_1 = __webpack_require__(/*! ./tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
1170
- class Buffer {
1171
- constructor() {
1172
- this.buf = "";
1173
- }
1174
- add(s) {
1175
- this.buf = this.buf + s;
1176
- return this.buf;
1177
- }
1178
- get() {
1179
- return this.buf;
1180
- }
1181
- clear() {
1182
- this.buf = "";
1183
- }
1184
- countIsEven(char) {
1185
- let count = 0;
1186
- for (let i = 0; i < this.buf.length; i += 1) {
1187
- if (this.buf.charAt(i) === char) {
1188
- count += 1;
1189
- }
1190
- }
1191
- return count % 2 === 0;
1192
- }
1193
- }
1194
- class Stream {
1195
- constructor(raw) {
1196
- this.offset = -1;
1197
- this.raw = raw;
1198
- this.row = 0;
1199
- this.col = 0;
1200
- }
1201
- advance() {
1202
- if (this.currentChar() === "\n") {
1203
- this.col = 1;
1204
- this.row = this.row + 1;
1205
- }
1206
- if (this.offset === this.raw.length) {
1207
- return false;
1208
- }
1209
- this.col = this.col + 1;
1210
- this.offset = this.offset + 1;
1211
- return true;
1212
- }
1213
- getCol() {
1214
- return this.col;
1215
- }
1216
- getRow() {
1217
- return this.row;
1218
- }
1219
- prevChar() {
1220
- if (this.offset - 1 < 0) {
1221
- return "";
1222
- }
1223
- return this.raw.substr(this.offset - 1, 1);
1224
- }
1225
- prevPrevChar() {
1226
- if (this.offset - 2 < 0) {
1227
- return "";
1228
- }
1229
- return this.raw.substr(this.offset - 2, 2);
1230
- }
1231
- currentChar() {
1232
- if (this.offset < 0) {
1233
- return "\n"; // simulate newline at start of file to handle star(*) comments
1234
- }
1235
- else if (this.offset >= this.raw.length) {
1236
- return "";
1237
- }
1238
- return this.raw.substr(this.offset, 1);
1239
- }
1240
- nextChar() {
1241
- if (this.offset + 2 > this.raw.length) {
1242
- return "";
1243
- }
1244
- return this.raw.substr(this.offset + 1, 1);
1245
- }
1246
- nextNextChar() {
1247
- if (this.offset + 3 > this.raw.length) {
1248
- return this.nextChar();
1249
- }
1250
- return this.raw.substr(this.offset + 1, 2);
1251
- }
1252
- getRaw() {
1253
- return this.raw;
1254
- }
1255
- getOffset() {
1256
- return this.offset;
1257
- }
1258
- }
1170
+ const lexer_buffer_1 = __webpack_require__(/*! ./lexer_buffer */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/lexer_buffer.js");
1171
+ const lexer_stream_1 = __webpack_require__(/*! ./lexer_stream */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/lexer_stream.js");
1259
1172
  class Lexer {
1260
1173
  constructor() {
1261
1174
  this.ModeNormal = 1;
@@ -1463,8 +1376,8 @@ class Lexer {
1463
1376
  this.buffer.clear();
1464
1377
  }
1465
1378
  process(raw) {
1466
- this.stream = new Stream(raw.replace(/\r/g, ""));
1467
- this.buffer = new Buffer();
1379
+ this.stream = new lexer_stream_1.LexerStream(raw.replace(/\r/g, ""));
1380
+ this.buffer = new lexer_buffer_1.LexerBuffer();
1468
1381
  const splits = {};
1469
1382
  splits[" "] = true;
1470
1383
  splits[":"] = true;
@@ -1609,6 +1522,125 @@ exports.Lexer = Lexer;
1609
1522
 
1610
1523
  /***/ }),
1611
1524
 
1525
+ /***/ "./node_modules/@abaplint/core/build/src/abap/1_lexer/lexer_buffer.js":
1526
+ /*!****************************************************************************!*\
1527
+ !*** ./node_modules/@abaplint/core/build/src/abap/1_lexer/lexer_buffer.js ***!
1528
+ \****************************************************************************/
1529
+ /***/ ((__unused_webpack_module, exports) => {
1530
+
1531
+ "use strict";
1532
+
1533
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1534
+ exports.LexerBuffer = void 0;
1535
+ class LexerBuffer {
1536
+ constructor() {
1537
+ this.buf = "";
1538
+ }
1539
+ add(s) {
1540
+ this.buf = this.buf + s;
1541
+ return this.buf;
1542
+ }
1543
+ get() {
1544
+ return this.buf;
1545
+ }
1546
+ clear() {
1547
+ this.buf = "";
1548
+ }
1549
+ countIsEven(char) {
1550
+ let count = 0;
1551
+ for (let i = 0; i < this.buf.length; i += 1) {
1552
+ if (this.buf.charAt(i) === char) {
1553
+ count += 1;
1554
+ }
1555
+ }
1556
+ return count % 2 === 0;
1557
+ }
1558
+ }
1559
+ exports.LexerBuffer = LexerBuffer;
1560
+ //# sourceMappingURL=lexer_buffer.js.map
1561
+
1562
+ /***/ }),
1563
+
1564
+ /***/ "./node_modules/@abaplint/core/build/src/abap/1_lexer/lexer_stream.js":
1565
+ /*!****************************************************************************!*\
1566
+ !*** ./node_modules/@abaplint/core/build/src/abap/1_lexer/lexer_stream.js ***!
1567
+ \****************************************************************************/
1568
+ /***/ ((__unused_webpack_module, exports) => {
1569
+
1570
+ "use strict";
1571
+
1572
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1573
+ exports.LexerStream = void 0;
1574
+ class LexerStream {
1575
+ constructor(raw) {
1576
+ this.offset = -1;
1577
+ this.raw = raw;
1578
+ this.row = 0;
1579
+ this.col = 0;
1580
+ }
1581
+ advance() {
1582
+ if (this.currentChar() === "\n") {
1583
+ this.col = 1;
1584
+ this.row = this.row + 1;
1585
+ }
1586
+ if (this.offset === this.raw.length) {
1587
+ return false;
1588
+ }
1589
+ this.col = this.col + 1;
1590
+ this.offset = this.offset + 1;
1591
+ return true;
1592
+ }
1593
+ getCol() {
1594
+ return this.col;
1595
+ }
1596
+ getRow() {
1597
+ return this.row;
1598
+ }
1599
+ prevChar() {
1600
+ if (this.offset - 1 < 0) {
1601
+ return "";
1602
+ }
1603
+ return this.raw.substr(this.offset - 1, 1);
1604
+ }
1605
+ prevPrevChar() {
1606
+ if (this.offset - 2 < 0) {
1607
+ return "";
1608
+ }
1609
+ return this.raw.substr(this.offset - 2, 2);
1610
+ }
1611
+ currentChar() {
1612
+ if (this.offset < 0) {
1613
+ return "\n"; // simulate newline at start of file to handle star(*) comments
1614
+ }
1615
+ else if (this.offset >= this.raw.length) {
1616
+ return "";
1617
+ }
1618
+ return this.raw.substr(this.offset, 1);
1619
+ }
1620
+ nextChar() {
1621
+ if (this.offset + 2 > this.raw.length) {
1622
+ return "";
1623
+ }
1624
+ return this.raw.substr(this.offset + 1, 1);
1625
+ }
1626
+ nextNextChar() {
1627
+ if (this.offset + 3 > this.raw.length) {
1628
+ return this.nextChar();
1629
+ }
1630
+ return this.raw.substr(this.offset + 1, 2);
1631
+ }
1632
+ getRaw() {
1633
+ return this.raw;
1634
+ }
1635
+ getOffset() {
1636
+ return this.offset;
1637
+ }
1638
+ }
1639
+ exports.LexerStream = LexerStream;
1640
+ //# sourceMappingURL=lexer_stream.js.map
1641
+
1642
+ /***/ }),
1643
+
1612
1644
  /***/ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/abstract_token.js":
1613
1645
  /*!*************************************************************************************!*\
1614
1646
  !*** ./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/abstract_token.js ***!
@@ -34654,6 +34686,7 @@ __exportStar(__webpack_require__(/*! ./expression_node */ "./node_modules/@abapl
34654
34686
  __exportStar(__webpack_require__(/*! ./statement_node */ "./node_modules/@abaplint/core/build/src/abap/nodes/statement_node.js"), exports);
34655
34687
  __exportStar(__webpack_require__(/*! ./structure_node */ "./node_modules/@abaplint/core/build/src/abap/nodes/structure_node.js"), exports);
34656
34688
  __exportStar(__webpack_require__(/*! ./token_node */ "./node_modules/@abaplint/core/build/src/abap/nodes/token_node.js"), exports);
34689
+ __exportStar(__webpack_require__(/*! ./token_node_regex */ "./node_modules/@abaplint/core/build/src/abap/nodes/token_node_regex.js"), exports);
34657
34690
  //# sourceMappingURL=index.js.map
34658
34691
 
34659
34692
  /***/ }),
@@ -35274,7 +35307,7 @@ exports.StructureNode = StructureNode;
35274
35307
  "use strict";
35275
35308
 
35276
35309
  Object.defineProperty(exports, "__esModule", ({ value: true }));
35277
- exports.TokenNodeRegex = exports.TokenNode = void 0;
35310
+ exports.TokenNode = void 0;
35278
35311
  class TokenNode {
35279
35312
  constructor(token) {
35280
35313
  this.token = token;
@@ -35305,10 +35338,25 @@ class TokenNode {
35305
35338
  }
35306
35339
  }
35307
35340
  exports.TokenNode = TokenNode;
35308
- class TokenNodeRegex extends TokenNode {
35341
+ //# sourceMappingURL=token_node.js.map
35342
+
35343
+ /***/ }),
35344
+
35345
+ /***/ "./node_modules/@abaplint/core/build/src/abap/nodes/token_node_regex.js":
35346
+ /*!******************************************************************************!*\
35347
+ !*** ./node_modules/@abaplint/core/build/src/abap/nodes/token_node_regex.js ***!
35348
+ \******************************************************************************/
35349
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
35350
+
35351
+ "use strict";
35352
+
35353
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
35354
+ exports.TokenNodeRegex = void 0;
35355
+ const token_node_1 = __webpack_require__(/*! ./token_node */ "./node_modules/@abaplint/core/build/src/abap/nodes/token_node.js");
35356
+ class TokenNodeRegex extends token_node_1.TokenNode {
35309
35357
  }
35310
35358
  exports.TokenNodeRegex = TokenNodeRegex;
35311
- //# sourceMappingURL=token_node.js.map
35359
+ //# sourceMappingURL=token_node_regex.js.map
35312
35360
 
35313
35361
  /***/ }),
35314
35362
 
@@ -42171,6 +42219,7 @@ class Help {
42171
42219
  switch (node.constructor.name) {
42172
42220
  case "TokenNode":
42173
42221
  case "TokenNodeRegex":
42222
+ // @ts-ignore
42174
42223
  extra = node.get().constructor.name + ", \"" + node.get().getStr() + "\"";
42175
42224
  break;
42176
42225
  case "ExpressionNode":
@@ -50918,7 +50967,7 @@ class Registry {
50918
50967
  }
50919
50968
  static abaplintVersion() {
50920
50969
  // magic, see build script "version.sh"
50921
- return "2.103.6";
50970
+ return "2.103.7";
50922
50971
  }
50923
50972
  getDDICReferences() {
50924
50973
  return this.ddicReferences;
@@ -58408,24 +58457,40 @@ ${indentation} output = ${uniqueName}.\n`;
58408
58457
  if (cdef && cdef.getMethodDefinitions === undefined) {
58409
58458
  return undefined; // something wrong
58410
58459
  }
58411
- const importing = (_c = cdef === null || cdef === void 0 ? void 0 : cdef.getMethodDefinitions().getByName("CONSTRUCTOR")) === null || _c === void 0 ? void 0 : _c.getParameters().getDefaultImporting();
58460
+ const importing = (_c = this.findConstructor(cdef, spag)) === null || _c === void 0 ? void 0 : _c.getParameters().getDefaultImporting();
58412
58461
  if (importing) {
58413
58462
  extra += " EXPORTING " + importing + " = " + source;
58414
58463
  }
58415
58464
  else if (spag === undefined) {
58416
- extra += " SpagUndefined";
58465
+ extra += " SpagUndefined ERROR";
58417
58466
  }
58418
58467
  else if (cdef === undefined) {
58419
- extra += " ClassDefinitionNotFound";
58468
+ extra += " ClassDefinitionNotFound ERROR";
58420
58469
  }
58421
58470
  else {
58422
- extra += " SomeError";
58471
+ extra += " SomeError ERROR";
58423
58472
  }
58424
58473
  }
58425
58474
  }
58426
58475
  const abap = `CREATE OBJECT ${name}${extra}.`;
58427
58476
  return abap;
58428
58477
  }
58478
+ findConstructor(cdef, spag) {
58479
+ let def = cdef;
58480
+ while (def !== undefined) {
58481
+ const method = def === null || def === void 0 ? void 0 : def.getMethodDefinitions().getByName("CONSTRUCTOR");
58482
+ if (method) {
58483
+ return method;
58484
+ }
58485
+ const name = def.getSuperClass();
58486
+ if (name) {
58487
+ def = spag === null || spag === void 0 ? void 0 : spag.findClassDefinition(name);
58488
+ }
58489
+ else {
58490
+ return undefined;
58491
+ }
58492
+ }
58493
+ }
58429
58494
  }
58430
58495
  exports.Downport = Downport;
58431
58496
  //# sourceMappingURL=downport.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.103.6",
3
+ "version": "2.103.7",
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.103.6",
41
+ "@abaplint/core": "^2.103.7",
42
42
  "@types/chai": "^4.3.10",
43
43
  "@types/glob": "^7.2.0",
44
44
  "@types/minimist": "^1.2.5",