@abaplint/transpiler-cli 2.13.16 → 2.13.18

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/abap_transpile CHANGED
@@ -1,2 +1,2 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
  require("./build/bundle");
package/build/bundle.js CHANGED
@@ -6602,8 +6602,9 @@ class SelectLoop extends combi_1.Expression {
6602
6602
  const into = (0, combi_1.altPrio)(sql_into_structure_1.SQLIntoStructure, _1.SQLIntoList);
6603
6603
  const perm = (0, combi_1.per)(_1.SQLFrom, where, sql_up_to_1.SQLUpTo, sql_order_by_1.SQLOrderBy, sql_having_1.SQLHaving, _1.SQLClient, bypass, _1.SQLGroupBy, _1.SQLForAllEntries, _1.DatabaseConnection, (0, combi_1.alt)(tab, sql_into_structure_1.SQLIntoStructure, _1.SQLIntoList, packTab));
6604
6604
  const strict = (0, combi_1.seq)(_1.SQLFrom, (0, combi_1.ver)(version_1.Version.v750, sql_fields_loop_1.SQLFieldsLoop), (0, combi_1.optPrio)(_1.SQLForAllEntries), (0, combi_1.optPrio)((0, combi_1.seq)(where, (0, combi_1.optPrio)(sql_order_by_1.SQLOrderBy), into, (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo))));
6605
- const aggr = (0, combi_1.seq)((0, combi_1.plusPrio)(_1.SQLAggregation), into, (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo), _1.SQLFrom, (0, combi_1.optPrio)(_1.SQLClient), (0, combi_1.optPrio)(where), _1.SQLGroupBy);
6606
- const ret = (0, combi_1.seq)("SELECT", (0, combi_1.altPrio)((0, combi_1.seq)((0, combi_1.optPrio)("DISTINCT"), sql_field_list_loop_1.SQLFieldListLoop, perm), strict, aggr), (0, combi_1.optPrio)(sql_hints_1.SQLHints));
6605
+ const aggrIntoBeforeFrom = (0, combi_1.seq)((0, combi_1.plusPrio)(_1.SQLAggregation), into, (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo), _1.SQLFrom, (0, combi_1.optPrio)(_1.SQLClient), (0, combi_1.optPrio)(where), _1.SQLGroupBy);
6606
+ const aggrIntoAfterFrom = (0, combi_1.seq)((0, combi_1.plusPrio)(_1.SQLAggregation), _1.SQLFrom, (0, combi_1.optPrio)(_1.SQLClient), into, (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo), (0, combi_1.optPrio)(where), _1.SQLGroupBy);
6607
+ const ret = (0, combi_1.seq)("SELECT", (0, combi_1.altPrio)((0, combi_1.seq)((0, combi_1.optPrio)("DISTINCT"), sql_field_list_loop_1.SQLFieldListLoop, perm), strict, aggrIntoBeforeFrom, aggrIntoAfterFrom), (0, combi_1.optPrio)(sql_hints_1.SQLHints));
6607
6608
  return ret;
6608
6609
  }
6609
6610
  }
@@ -7090,7 +7091,7 @@ class SQLCase extends combi_1.Expression {
7090
7091
  const val = (0, combi_1.altPrio)(sql_cond_1.SQLCond, constant_1.Constant, abap);
7091
7092
  const when = (0, combi_1.seq)("WHEN", val, "THEN", sourc, (0, combi_1.starPrio)(sub));
7092
7093
  const els = (0, combi_1.seq)("ELSE", sourc);
7093
- return (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("CASE", (0, combi_1.opt)((0, combi_1.altPrio)(sql_field_name_1.SQLFieldName, abap)), (0, combi_1.plusPrio)(when), (0, combi_1.optPrio)(els), "END"));
7094
+ return (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("CASE", (0, combi_1.opt)((0, combi_1.altPrio)(sql_field_name_1.SQLFieldName, abap)), (0, combi_1.plusPrio)(when), (0, combi_1.optPrio)(els), "END"), version_1.Version.OpenABAP);
7094
7095
  }
7095
7096
  }
7096
7097
  exports.SQLCase = SQLCase;
@@ -7308,9 +7309,12 @@ exports.SQLFieldList = void 0;
7308
7309
  const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
7309
7310
  const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
7310
7311
  const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
7312
+ const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
7311
7313
  class SQLFieldList extends combi_1.Expression {
7312
7314
  getRunnable() {
7313
- const nev = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.starPrio)((0, combi_1.seq)(",", _1.SQLField)), version_1.Version.OpenABAP);
7315
+ const as = (0, combi_1.seq)("AS", _1.SQLAsName);
7316
+ const commaParenField = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeftW), _1.SQLFieldName, (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WParenRightW), (0, combi_1.tok)(tokens_1.WParenRight)), (0, combi_1.optPrio)(as));
7317
+ const nev = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.starPrio)((0, combi_1.seq)(",", (0, combi_1.altPrio)(_1.SQLField, commaParenField))), version_1.Version.OpenABAP);
7314
7318
  const old = (0, combi_1.starPrio)(_1.SQLField);
7315
7319
  return (0, combi_1.altPrio)("*", _1.Dynamic, (0, combi_1.seq)(_1.SQLField, (0, combi_1.alt)(nev, old)));
7316
7320
  }
@@ -7459,14 +7463,15 @@ class SQLFrom extends combi_1.Expression {
7459
7463
  const joins = (0, combi_1.starPrio)((0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), _1.SQLJoin));
7460
7464
  // No opening parens
7461
7465
  const from0 = (0, combi_1.seq)("FROM", _1.SQLFromSource, joins);
7462
- // 1 to 6 opening parens, with up to that many closing parens at the end
7466
+ // 1 to 7 opening parens, with up to that many closing parens at the end
7463
7467
  const from1 = (0, combi_1.seq)("FROM", (0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFromSource, joins, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
7464
7468
  const from2 = (0, combi_1.seq)("FROM", (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFromSource, joins, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
7465
7469
  const from3 = (0, combi_1.seq)("FROM", (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFromSource, joins, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
7466
7470
  const from4 = (0, combi_1.seq)("FROM", (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFromSource, joins, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
7467
7471
  const from5 = (0, combi_1.seq)("FROM", (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFromSource, joins, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
7468
7472
  const from6 = (0, combi_1.seq)("FROM", (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFromSource, joins, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
7469
- const source = (0, combi_1.altPrio)(from6, from5, from4, from3, from2, from1, from0);
7473
+ const from7 = (0, combi_1.seq)("FROM", (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFromSource, joins, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
7474
+ const source = (0, combi_1.altPrio)(from7, from6, from5, from4, from3, from2, from1, from0);
7470
7475
  return source;
7471
7476
  }
7472
7477
  }
@@ -10734,7 +10739,7 @@ class Convert {
10734
10739
  const invert = (0, combi_1.seq)("INTO INVERTED-DATE", expressions_1.Target);
10735
10740
  const date = (0, combi_1.seq)((0, combi_1.per)(dat, tim), (0, combi_1.per)(daylightSource, stamp, zone, invert, intoutc));
10736
10741
  const inv = (0, combi_1.seq)("INVERTED-DATE", expressions_1.Source, "INTO DATE", expressions_1.Target);
10737
- const utclong = (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("UTCLONG", expressions_1.Source, (0, combi_1.per)(zone, into, daylightSource)));
10742
+ const utclong = (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("UTCLONG", expressions_1.Source, (0, combi_1.per)(zone, into, daylightSource)), version_1.Version.OpenABAP);
10738
10743
  return (0, combi_1.seq)("CONVERT", (0, combi_1.alt)(time, date, inv, utclong));
10739
10744
  }
10740
10745
  }
@@ -55149,7 +55154,7 @@ class Registry {
55149
55154
  }
55150
55155
  static abaplintVersion() {
55151
55156
  // magic, see build script "version.sh"
55152
- return "2.119.10";
55157
+ return "2.119.12";
55153
55158
  }
55154
55159
  getDDICReferences() {
55155
55160
  return this.ddicReferences;
@@ -88127,6 +88132,13 @@ class ConvertTranspiler {
88127
88132
  else if (stamp?.get() instanceof abaplint.Expressions.Target) {
88128
88133
  target.push("stamp: " + new expressions_1.TargetTranspiler().transpile(stamp, traversal).getCode());
88129
88134
  }
88135
+ const utclong = node.findExpressionAfterToken("UTCLONG");
88136
+ if (utclong?.get() instanceof abaplint.Expressions.Source) {
88137
+ source.push("utclong: " + new expressions_1.SourceTranspiler().transpile(utclong, traversal).getCode());
88138
+ }
88139
+ else if (utclong?.get() instanceof abaplint.Expressions.Target) {
88140
+ target.push("utclong: " + new expressions_1.TargetTranspiler().transpile(utclong, traversal).getCode());
88141
+ }
88130
88142
  const zone = node.findExpressionAfterToken("ZONE");
88131
88143
  if (zone?.get() instanceof abaplint.Expressions.Source) {
88132
88144
  source.push("zone: " + new expressions_1.SourceTranspiler().transpile(zone, traversal).getCode());
@@ -95510,6 +95522,25 @@ this.INTERNAL_ID = abap.internalIdCounter++;\n`;
95510
95522
  static setValues(identifier, name) {
95511
95523
  const val = identifier.getValue();
95512
95524
  let ret = "";
95525
+ // abaplint can use this sentinel for enum-like class constants. Synthesize
95526
+ // deterministic member values so the enum fields have distinct runtime values.
95527
+ if (val === "novalueClassAttributeEnum") {
95528
+ const type = identifier.getType();
95529
+ if (type instanceof abaplint.BasicTypes.StructureType) {
95530
+ let index = 0;
95531
+ for (const component of type.getComponents()) {
95532
+ const fieldName = component.name.toLowerCase();
95533
+ ret += Traversal.prefixVariable(name)
95534
+ + ".get()["
95535
+ + JSON.stringify(fieldName)
95536
+ + "].set("
95537
+ + index
95538
+ + ");\n";
95539
+ index++;
95540
+ }
95541
+ }
95542
+ return ret;
95543
+ }
95513
95544
  const handle = (val, name) => {
95514
95545
  if (typeof val === "string") {
95515
95546
  const e = expressions_1.ConstantTranspiler.escape(val);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.13.16",
3
+ "version": "2.13.18",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -27,8 +27,8 @@
27
27
  "author": "abaplint",
28
28
  "license": "MIT",
29
29
  "devDependencies": {
30
- "@abaplint/core": "^2.119.10",
31
- "@abaplint/transpiler": "^2.13.16",
30
+ "@abaplint/core": "^2.119.12",
31
+ "@abaplint/transpiler": "^2.13.18",
32
32
  "@types/glob": "^8.1.0",
33
33
  "@types/node": "^24.12.2",
34
34
  "@types/progress": "^2.0.7",