@abaplint/transpiler-cli 2.13.13 → 2.13.15

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/bundle.js +38 -11
  2. package/package.json +3 -3
package/build/bundle.js CHANGED
@@ -7365,7 +7365,7 @@ exports.SQLFieldName = void 0;
7365
7365
  const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
7366
7366
  class SQLFieldName extends combi_1.Expression {
7367
7367
  getRunnable() {
7368
- return (0, combi_1.regex)(/^(?!(?:SINGLE|INTO|DISTINCT|AS|WHERE|FOR|HAVING|APPENDING|UP|FROM)$)(\/\w+\/)?(\w+~(\/\w+\/)?(\w+|\*)|\w+)$/i);
7368
+ return (0, combi_1.regex)(/^(?!(?:SINGLE|INTO|DISTINCT|AS|WHERE|FOR|HAVING|APPENDING|UP|FROM)$)(\/\w+\/)?(\*?\w+~(\/\w+\/)?(\w+|\*)|\w+)$/i);
7369
7369
  }
7370
7370
  }
7371
7371
  exports.SQLFieldName = SQLFieldName;
@@ -9483,7 +9483,7 @@ class AtSelectionScreen {
9483
9483
  const field = (0, combi_1.seq)("ON", expressions_1.FieldSub);
9484
9484
  const end = (0, combi_1.seq)("ON END OF", expressions_1.Field);
9485
9485
  const radio = (0, combi_1.seq)("ON RADIOBUTTON GROUP", expressions_1.Field);
9486
- const block = (0, combi_1.seq)("ON BLOCK", (0, combi_1.regex)(/^\w+$/));
9486
+ const block = (0, combi_1.seq)("ON BLOCK", expressions_1.BlockName);
9487
9487
  const help = (0, combi_1.seq)("ON HELP-REQUEST FOR", expressions_1.FieldSub);
9488
9488
  const ret = (0, combi_1.seq)("AT SELECTION-SCREEN", (0, combi_1.opt)((0, combi_1.alt)(output, value, radio, exit, field, end, help, block)));
9489
9489
  return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
@@ -25510,7 +25510,7 @@ const assert_error_1 = __webpack_require__(/*! ../assert_error */ "./node_module
25510
25510
  const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
25511
25511
  class FormParam {
25512
25512
  static runSyntax(node, input) {
25513
- var _a, _b;
25513
+ var _a, _b, _c;
25514
25514
  const formParamName = node.findFirstExpression(expressions_1.FormParamName);
25515
25515
  if (formParamName === undefined) {
25516
25516
  throw new assert_error_1.AssertError("FormParam, could not find FormParamName");
@@ -25538,7 +25538,13 @@ class FormParam {
25538
25538
  // untyped FORM parameter
25539
25539
  return new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, basic_1.AnyType.get(), ["form_parameter" /* IdentifierMeta.FormParameter */]);
25540
25540
  }
25541
- const bfound = new basic_types_1.BasicTypes(input).parseType(node);
25541
+ let bfound = new basic_types_1.BasicTypes(input).parseType(node);
25542
+ const isTypeC = ((_c = node.findFirstExpression(expressions_1.TypeName)) === null || _c === void 0 ? void 0 : _c.concatTokens().toUpperCase()) === "C";
25543
+ const hasExplicitLength = node.findFirstExpression(expressions_1.Length) !== undefined
25544
+ || node.findFirstExpression(expressions_1.ConstantFieldLength) !== undefined;
25545
+ if (isTypeC && hasExplicitLength === false && bfound instanceof basic_1.CharacterType) {
25546
+ bfound = basic_1.CGenericType.get();
25547
+ }
25542
25548
  if (nameToken && bfound) {
25543
25549
  return new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, bfound, ["form_parameter" /* IdentifierMeta.FormParameter */]);
25544
25550
  }
@@ -55047,7 +55053,7 @@ class Registry {
55047
55053
  }
55048
55054
  static abaplintVersion() {
55049
55055
  // magic, see build script "version.sh"
55050
- return "2.119.0";
55056
+ return "2.119.1";
55051
55057
  }
55052
55058
  getDDICReferences() {
55053
55059
  return this.ddicReferences;
@@ -81957,8 +81963,8 @@ class CorrespondingBodyTranspiler {
81957
81963
  const type = new type_name_or_infer_1.TypeNameOrInfer().findType(typ, traversal);
81958
81964
  let target = transpile_types_1.TranspileTypes.toType(type);
81959
81965
  let source;
81966
+ const isTableType = type instanceof core_1.BasicTypes.TableType;
81960
81967
  const mapping = [];
81961
- const mappingRow = { componentName: undefined, componentChain: undefined };
81962
81968
  for (const child of body.getChildren()) {
81963
81969
  const c = child.get();
81964
81970
  if (c instanceof core_1.Expressions.Source && child instanceof core_1.Nodes.ExpressionNode) {
@@ -81969,6 +81975,7 @@ class CorrespondingBodyTranspiler {
81969
81975
  target = `abap.statements.moveCorresponding(${source.getCode()}, ${target})`;
81970
81976
  }
81971
81977
  else if (c instanceof core_1.Expressions.CorrespondingBodyMapping && child instanceof core_1.Nodes.ExpressionNode) {
81978
+ let mappingRow = { componentName: undefined, componentChain: undefined };
81972
81979
  for (const cc of child.getChildren()) {
81973
81980
  if (cc.get() instanceof core_1.Expressions.ComponentName) {
81974
81981
  mappingRow.componentName = cc;
@@ -81976,6 +81983,7 @@ class CorrespondingBodyTranspiler {
81976
81983
  else if (cc.get() instanceof core_1.Expressions.ComponentChain) {
81977
81984
  mappingRow.componentChain = cc;
81978
81985
  mapping.push(mappingRow);
81986
+ mappingRow = { componentName: undefined, componentChain: undefined };
81979
81987
  }
81980
81988
  }
81981
81989
  }
@@ -81985,13 +81993,32 @@ class CorrespondingBodyTranspiler {
81985
81993
  }
81986
81994
  const ret = new chunk_1.Chunk();
81987
81995
  const id = unique_identifier_1.UniqueIdentifier.get();
81996
+ const sourceId = unique_identifier_1.UniqueIdentifier.get();
81988
81997
  ret.appendString("(await (async () => {\n");
81989
81998
  ret.appendString(`const ${id} = ${target};\n`);
81990
- ret.appendString(`abap.statements.moveCorresponding(${source.getCode()}, ${id});\n`);
81991
- for (const map of mapping) {
81992
- const componentName = map.componentName.concatTokens().toLowerCase();
81993
- const chain = new component_chain_1.ComponentChainTranspiler().transpile(map.componentChain, traversal).getCode();
81994
- ret.appendString(`${id}.get().${componentName}.set(${source.getCode()}.get().${chain});\n`);
81999
+ ret.appendString(`const ${sourceId} = ${source.getCode()};\n`);
82000
+ if (isTableType) {
82001
+ const rowTargetType = transpile_types_1.TranspileTypes.toType(type.getRowType());
82002
+ const sourceRowId = unique_identifier_1.UniqueIdentifier.get();
82003
+ const targetRowId = unique_identifier_1.UniqueIdentifier.get();
82004
+ ret.appendString(`for (const ${sourceRowId} of ${sourceId}.array()) {\n`);
82005
+ ret.appendString(`const ${targetRowId} = ${rowTargetType};\n`);
82006
+ ret.appendString(`abap.statements.moveCorresponding(${sourceRowId}, ${targetRowId});\n`);
82007
+ for (const map of mapping) {
82008
+ const componentName = map.componentName.concatTokens().toLowerCase();
82009
+ const chain = new component_chain_1.ComponentChainTranspiler().transpile(map.componentChain, traversal).getCode();
82010
+ ret.appendString(`${targetRowId}.get().${componentName}.set(${sourceRowId}.get().${chain});\n`);
82011
+ }
82012
+ ret.appendString(`abap.statements.insertInternal({table: ${id}, data: ${targetRowId}});\n`);
82013
+ ret.appendString("}\n");
82014
+ }
82015
+ else {
82016
+ ret.appendString(`abap.statements.moveCorresponding(${sourceId}, ${id});\n`);
82017
+ for (const map of mapping) {
82018
+ const componentName = map.componentName.concatTokens().toLowerCase();
82019
+ const chain = new component_chain_1.ComponentChainTranspiler().transpile(map.componentChain, traversal).getCode();
82020
+ ret.appendString(`${id}.get().${componentName}.set(${sourceId}.get().${chain});\n`);
82021
+ }
81995
82022
  }
81996
82023
  ret.appendString("return " + id + ";\n");
81997
82024
  ret.appendString("})())");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.13.13",
3
+ "version": "2.13.15",
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.0",
31
- "@abaplint/transpiler": "^2.13.13",
30
+ "@abaplint/core": "^2.119.1",
31
+ "@abaplint/transpiler": "^2.13.15",
32
32
  "@types/glob": "^8.1.0",
33
33
  "@types/node": "^24.12.2",
34
34
  "@types/progress": "^2.0.7",