@abaplint/cli 2.113.51 → 2.113.53

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 +51 -32
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -6056,7 +6056,8 @@ const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src
6056
6056
  class InlineLoopDefinition extends combi_1.Expression {
6057
6057
  getRunnable() {
6058
6058
  const index = (0, combi_1.seq)("INDEX INTO", _1.TargetField);
6059
- return (0, combi_1.seq)((0, combi_1.altPrio)(_1.TargetFieldSymbol, _1.TargetField), "IN", (0, combi_1.opt)("GROUP"), _1.Source, (0, combi_1.optPrio)(index));
6059
+ const key = (0, combi_1.seq)("USING KEY", _1.SimpleName);
6060
+ return (0, combi_1.seq)((0, combi_1.altPrio)(_1.TargetFieldSymbol, _1.TargetField), "IN", (0, combi_1.opt)("GROUP"), _1.Source, (0, combi_1.optPrio)(key), (0, combi_1.optPrio)(index));
6060
6061
  }
6061
6062
  }
6062
6063
  exports.InlineLoopDefinition = InlineLoopDefinition;
@@ -7458,8 +7459,6 @@ const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src
7458
7459
  const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
7459
7460
  const sql_group_by_1 = __webpack_require__(/*! ./sql_group_by */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_group_by.js");
7460
7461
  const sql_into_structure_1 = __webpack_require__(/*! ./sql_into_structure */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_into_structure.js");
7461
- const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
7462
- const sql_field_name_1 = __webpack_require__(/*! ./sql_field_name */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_field_name.js");
7463
7462
  const sql_up_to_1 = __webpack_require__(/*! ./sql_up_to */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_up_to.js");
7464
7463
  class Select extends combi_1.Expression {
7465
7464
  getRunnable() {
@@ -7471,8 +7470,7 @@ class Select extends combi_1.Expression {
7471
7470
  // todo, HINTS cannot be anywhere, need an expression dedicated for strict sql
7472
7471
  const perm = (0, combi_1.per)(_1.SQLFrom, into, _1.SQLForAllEntries, where, _1.SQLOrderBy, sql_up_to_1.SQLUpTo, offset, _1.SQLClient, _1.SQLHaving, bypass, sql_group_by_1.SQLGroupBy, fields, _1.DatabaseConnection, _1.SQLHints);
7473
7472
  const permSingle = (0, combi_1.per)(_1.SQLFrom, (0, combi_1.altPrio)(sql_into_structure_1.SQLIntoStructure, _1.SQLIntoList), where, _1.SQLClient, bypass, sql_group_by_1.SQLGroupBy, fields, _1.DatabaseConnection, _1.SQLHints);
7474
- const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), sql_field_name_1.SQLFieldName, (0, combi_1.tok)(tokens_1.WParenRightW));
7475
- const fieldList = (0, combi_1.optPrio)((0, combi_1.altPrio)(_1.SQLFieldList, paren));
7473
+ const fieldList = (0, combi_1.optPrio)(_1.SQLFieldList);
7476
7474
  const single = (0, combi_1.seq)("SINGLE", (0, combi_1.optPrio)("FOR UPDATE"), fieldList, permSingle);
7477
7475
  const other = (0, combi_1.seq)((0, combi_1.optPrio)("DISTINCT"), fieldList, perm);
7478
7476
  const ret = (0, combi_1.seq)("SELECT", (0, combi_1.altPrio)(single, other));
@@ -8213,11 +8211,13 @@ exports.SQLFieldList = void 0;
8213
8211
  const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
8214
8212
  const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
8215
8213
  const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
8214
+ const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
8216
8215
  class SQLFieldList extends combi_1.Expression {
8217
8216
  getRunnable() {
8217
+ const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFieldName, (0, combi_1.tok)(tokens_1.WParenRightW));
8218
8218
  const nev = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.starPrio)((0, combi_1.seq)(",", _1.SQLField)));
8219
8219
  const old = (0, combi_1.starPrio)(_1.SQLField);
8220
- return (0, combi_1.altPrio)("*", _1.Dynamic, (0, combi_1.seq)(_1.SQLField, (0, combi_1.alt)(nev, old)));
8220
+ return (0, combi_1.altPrio)("*", _1.Dynamic, (0, combi_1.seq)(_1.SQLField, (0, combi_1.alt)(nev, old)), paren);
8221
8221
  }
8222
8222
  }
8223
8223
  exports.SQLFieldList = SQLFieldList;
@@ -8901,7 +8901,7 @@ class StringTemplateFormatting extends combi_1.Expression {
8901
8901
  const alignOptions = (0, combi_1.altPrio)("LEFT", "RIGHT", "CENTER", _1.Source);
8902
8902
  const dateTimeOptions = (0, combi_1.altPrio)("RAW", "ISO", "USER", "ENVIRONMENT", _1.Source, dynamic_1.Dynamic);
8903
8903
  const timeStampOptions = (0, combi_1.altPrio)("SPACE", "ISO", "USER", "ENVIRONMENT", _1.Source);
8904
- const numberOptions = (0, combi_1.altPrio)("RAW", "USER", "ENVIRONMENT", _1.Source);
8904
+ const numberOptions = (0, combi_1.altPrio)("RAW", "USER", "ENVIRONMENT", _1.Source, dynamic_1.Dynamic);
8905
8905
  const signOptions = (0, combi_1.altPrio)("LEFT", "LEFTPLUS", "LEFTSPACE", "RIGHT", "RIGHTPLUS", "RIGHTSPACE", _1.Source);
8906
8906
  const caseOptions = (0, combi_1.altPrio)("RAW", "UPPER", "LOWER", _1.Source, dynamic_1.Dynamic);
8907
8907
  const zeroXSDOptions = (0, combi_1.altPrio)("YES", "NO", _1.Source);
@@ -9113,7 +9113,7 @@ const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/co
9113
9113
  const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
9114
9114
  class TargetFieldSymbol extends combi_1.Expression {
9115
9115
  getRunnable() {
9116
- return new _1.FieldSymbol();
9116
+ return (0, combi_1.seq)(_1.FieldSymbol, (0, combi_1.optPrio)(_1.TableBody));
9117
9117
  }
9118
9118
  }
9119
9119
  exports.TargetFieldSymbol = TargetFieldSymbol;
@@ -14695,7 +14695,7 @@ class MethodDef {
14695
14695
  const behavior = (0, combi_1.altPrio)((0, combi_1.seq)("VALIDATE ON SAVE IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("MODIFY IMPORTING", expressions_1.MethodParamName, modify), (0, combi_1.seq)("READ IMPORTING", expressions_1.MethodParamName, (0, combi_1.altPrio)(forRead, forfunction)), (0, combi_1.seq)("FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.NamespaceSimpleName, "FOR", expressions_1.NamespaceSimpleName, result), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR CREATE", expressions_1.TypeName, expressions_1.MethodParamName, "FOR UPDATE", expressions_1.TypeName, expressions_1.MethodParamName, "FOR DELETE", expressions_1.TypeName), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR READ", expressions_1.TypeName, result), (0, combi_1.seq)((0, combi_1.alt)("BEHAVIOR", "LOCK"), "IMPORTING", expressions_1.MethodParamName, "FOR LOCK", expressions_1.TypeName), (0, combi_1.seq)("DETERMINE", (0, combi_1.alt)("ON MODIFY", "ON SAVE"), "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("GLOBAL AUTHORIZATION IMPORTING REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)("INSTANCE AUTHORIZATION IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)("INSTANCE FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result));
14696
14696
  // todo, this is only from version something
14697
14697
  const amdp = (0, combi_1.seq)("AMDP OPTIONS CDS SESSION CLIENT CURRENT", (0, combi_1.optPrio)(expressions_1.MethodDefImporting), (0, combi_1.optPrio)(expressions_1.MethodDefExporting), (0, combi_1.optPrio)(expressions_1.MethodDefRaising));
14698
- const ret = (0, combi_1.seq)((0, combi_1.altPrio)("CLASS-METHODS", "METHODS"), expressions_1.MethodName, (0, combi_1.alt)((0, combi_1.seq)((0, combi_1.optPrio)(expressions_1.Abstract), expressions_1.EventHandler), parameters, testing, (0, combi_1.seq)("FOR", (0, combi_1.alt)(tableFunction, ddl, behavior)), amdp, "NOT AT END OF MODE", (0, combi_1.optPrio)(expressions_1.Redefinition)));
14698
+ const ret = (0, combi_1.seq)((0, combi_1.altPrio)("CLASS-METHODS", "METHODS"), expressions_1.MethodName, (0, combi_1.alt)((0, combi_1.seq)((0, combi_1.optPrio)(expressions_1.Abstract), (0, combi_1.optPrio)(def), expressions_1.EventHandler), parameters, testing, (0, combi_1.seq)("FOR", (0, combi_1.alt)(tableFunction, ddl, behavior)), amdp, "NOT AT END OF MODE", (0, combi_1.optPrio)(expressions_1.Redefinition)));
14699
14699
  return ret;
14700
14700
  }
14701
14701
  }
@@ -16218,7 +16218,7 @@ class SelectionScreen {
16218
16218
  const posIntegers = (0, combi_1.regex)(/^(0?[1-9]|[1234567][0-9]|8[0-3])$/);
16219
16219
  const pos = (0, combi_1.seq)("POSITION", (0, combi_1.altPrio)(posIntegers, posSymbols));
16220
16220
  const incl = (0, combi_1.seq)("INCLUDE BLOCKS", expressions_1.BlockName);
16221
- const tabbed = (0, combi_1.seq)("BEGIN OF TABBED BLOCK", expressions_1.InlineField, "FOR", expressions_1.Integer, "LINES", (0, combi_1.optPrio)("NO INTERVALS"));
16221
+ const tabbed = (0, combi_1.seq)("BEGIN OF TABBED BLOCK", expressions_1.BlockName, "FOR", expressions_1.Integer, "LINES", (0, combi_1.optPrio)("NO INTERVALS"));
16222
16222
  const uline = (0, combi_1.seq)("ULINE", (0, combi_1.opt)(position));
16223
16223
  const param = (0, combi_1.seq)("INCLUDE PARAMETERS", expressions_1.Field);
16224
16224
  const iso = (0, combi_1.seq)("INCLUDE SELECT-OPTIONS", expressions_1.Field);
@@ -21989,7 +21989,7 @@ class ObjectOriented {
21989
21989
  return undefined;
21990
21990
  }
21991
21991
  findMethodViaAlias(methodName, def) {
21992
- for (const a of def.getAliases()) {
21992
+ for (const a of def.getAliases() || []) {
21993
21993
  if (a.getName().toUpperCase() === methodName.toUpperCase()) {
21994
21994
  const comp = a.getComponent();
21995
21995
  const res = this.findMethodInInterface(comp.split("~")[0], comp.split("~")[1]);
@@ -22072,9 +22072,12 @@ class ObjectOriented {
22072
22072
  return undefined;
22073
22073
  }
22074
22074
  const upper = name.toUpperCase();
22075
- for (const a of def.getAttributes().getAll()) {
22076
- if (a.getName().toUpperCase() === upper) {
22077
- return a;
22075
+ const attr = def.getAttributes();
22076
+ if (attr) {
22077
+ for (const a of attr.getAll()) {
22078
+ if (a.getName().toUpperCase() === upper) {
22079
+ return a;
22080
+ }
22078
22081
  }
22079
22082
  }
22080
22083
  for (const a of def.getAliases() || []) {
@@ -22188,7 +22191,11 @@ class ObjectOriented {
22188
22191
  return { method: undefined, def: undefined };
22189
22192
  }
22190
22193
  findMethod(def, methodName) {
22191
- for (const method of def.getMethodDefinitions().getAll()) {
22194
+ const defs = def.getMethodDefinitions();
22195
+ if (defs === undefined) {
22196
+ return undefined;
22197
+ }
22198
+ for (const method of defs.getAll()) {
22192
22199
  if (method.getName().toUpperCase() === methodName.toUpperCase()) {
22193
22200
  if (method.isRedefinition()) {
22194
22201
  return this.findMethodInSuper(def, methodName);
@@ -22942,6 +22949,9 @@ class TypeUtils {
22942
22949
  return this.isAssignable(source, target);
22943
22950
  }
22944
22951
  isAssignable(source, target) {
22952
+ if (source === undefined || target === undefined) {
22953
+ return true;
22954
+ }
22945
22955
  /*
22946
22956
  console.dir(source);
22947
22957
  console.dir(target);
@@ -27299,7 +27309,7 @@ class Source {
27299
27309
  const foundType = this.determineType(node, input, targetType);
27300
27310
  const bodyType = new conv_body_1.ConvBody().runSyntax(node.findDirectExpression(Expressions.ConvBody), input);
27301
27311
  if (new _type_utils_1.TypeUtils(input.scope).isAssignable(foundType, bodyType) === false) {
27302
- const message = "CONV: Types not compatible";
27312
+ const message = `CONV: Types not compatible, ${foundType === null || foundType === void 0 ? void 0 : foundType.constructor.name}, ${bodyType === null || bodyType === void 0 ? void 0 : bodyType.constructor.name}`;
27303
27313
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
27304
27314
  return new basic_1.VoidType(_syntax_input_1.CheckSyntaxKey);
27305
27315
  }
@@ -32862,30 +32872,35 @@ const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@ab
32862
32872
  const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
32863
32873
  class SelectionScreen {
32864
32874
  runSyntax(node, input) {
32865
- const field = node.findFirstExpression(Expressions.InlineField);
32866
- if (field === undefined) {
32875
+ const blockNode = node.findFirstExpression(Expressions.BlockName);
32876
+ const blockToken = blockNode === null || blockNode === void 0 ? void 0 : blockNode.getFirstToken();
32877
+ const blockName = blockNode === null || blockNode === void 0 ? void 0 : blockNode.concatTokens();
32878
+ if (blockName !== undefined && blockName.length > 16) {
32879
+ const message = "SELECTION-SCREEN block name too long, " + blockName;
32880
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
32867
32881
  return;
32868
32882
  }
32869
- if (field.getFirstToken().getStr().length > 8) {
32883
+ const field = node.findFirstExpression(Expressions.InlineField);
32884
+ if (field !== undefined && field.getFirstToken().getStr().length > 8) {
32870
32885
  const message = "SELECTION-SCREEN name too long, " + field.getFirstToken().getStr();
32871
32886
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, field.getFirstToken(), message));
32872
32887
  return;
32873
32888
  }
32874
- const name = field.getFirstToken();
32889
+ const fieldName = field === null || field === void 0 ? void 0 : field.getFirstToken();
32875
32890
  const concat = node.concatTokens().toUpperCase();
32876
- if (concat.includes("BEGIN OF TABBED BLOCK")) {
32891
+ if (concat.includes("BEGIN OF TABBED BLOCK") && blockToken) {
32877
32892
  const type = new basic_1.StructureType([
32878
32893
  { name: "PROG", type: new basic_1.CharacterType(40) },
32879
32894
  { name: "DYNNR", type: new basic_1.CharacterType(4) },
32880
32895
  { name: "ACTIVETAB", type: new basic_1.CharacterType(132) },
32881
32896
  ]);
32882
- input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(name, input.filename, type, ["selection_screen_tab" /* IdentifierMeta.SelectionScreenTab */]));
32897
+ input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(blockToken, input.filename, type, ["selection_screen_tab" /* IdentifierMeta.SelectionScreenTab */]));
32883
32898
  }
32884
- else if (concat.startsWith("SELECTION-SCREEN TAB")) {
32885
- input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(name, input.filename, new basic_1.CharacterType(83), ["selection_screen_tab" /* IdentifierMeta.SelectionScreenTab */]));
32899
+ else if (concat.startsWith("SELECTION-SCREEN TAB") && fieldName) {
32900
+ input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(fieldName, input.filename, new basic_1.CharacterType(83), ["selection_screen_tab" /* IdentifierMeta.SelectionScreenTab */]));
32886
32901
  }
32887
- else {
32888
- input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(name, input.filename, new basic_1.CharacterType(83)));
32902
+ else if (fieldName) {
32903
+ input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(fieldName, input.filename, new basic_1.CharacterType(83)));
32889
32904
  }
32890
32905
  }
32891
32906
  }
@@ -39810,7 +39825,7 @@ exports.CDSDetermineTypes = void 0;
39810
39825
  const basic_1 = __webpack_require__(/*! ../abap/types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
39811
39826
  const ddic_1 = __webpack_require__(/*! ../ddic */ "./node_modules/@abaplint/core/build/src/ddic.js");
39812
39827
  class CDSDetermineTypes {
39813
- parseType(reg, parsedData) {
39828
+ parseType(reg, parsedData, ddlsName) {
39814
39829
  const ddic = new ddic_1.DDIC(reg);
39815
39830
  if ((parsedData === null || parsedData === void 0 ? void 0 : parsedData.fields.length) === 0) {
39816
39831
  return new basic_1.VoidType("DDLS:todo");
@@ -39836,7 +39851,7 @@ class CDSDetermineTypes {
39836
39851
  if ((source === null || source === void 0 ? void 0 : source.name) === undefined) {
39837
39852
  components.push({
39838
39853
  name: f.name,
39839
- type: new basic_1.UnknownType("CDS parser error, unknown source"),
39854
+ type: new basic_1.UnknownType("CDS parser error, unknown source, " + ddlsName),
39840
39855
  });
39841
39856
  continue;
39842
39857
  }
@@ -39881,7 +39896,7 @@ class CDSDetermineTypes {
39881
39896
  else {
39882
39897
  components.push({
39883
39898
  name: f.name,
39884
- type: new basic_1.VoidType("DDLS:fieldname"),
39899
+ type: new basic_1.VoidType("DDLS:fieldname:" + ddlsName),
39885
39900
  });
39886
39901
  }
39887
39902
  }
@@ -46812,7 +46827,7 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
46812
46827
  }
46813
46828
  parseType(reg) {
46814
46829
  this.parse();
46815
- return new cds_determine_types_1.CDSDetermineTypes().parseType(reg, this.parsedData);
46830
+ return new cds_determine_types_1.CDSDetermineTypes().parseType(reg, this.parsedData, this.getName());
46816
46831
  }
46817
46832
  getParsedData() {
46818
46833
  return this.parsedData;
@@ -53114,7 +53129,7 @@ class Registry {
53114
53129
  }
53115
53130
  static abaplintVersion() {
53116
53131
  // magic, see build script "version.sh"
53117
- return "2.113.51";
53132
+ return "2.113.53";
53118
53133
  }
53119
53134
  getDDICReferences() {
53120
53135
  return this.ddicReferences;
@@ -71471,7 +71486,11 @@ class SelectionScreenNaming extends _abap_rule_1.ABAPRule {
71471
71486
  return statNode.findFirstExpression(expressions_1.FieldSub);
71472
71487
  }
71473
71488
  else if (statNode.get() instanceof statements_1.SelectionScreen) {
71474
- return statNode.findFirstExpression(expressions_1.InlineField);
71489
+ let ret = statNode.findFirstExpression(expressions_1.InlineField);
71490
+ if (ret === undefined && statNode.concatTokens().toUpperCase().includes(" BEGIN OF TABBED BLOCK")) {
71491
+ ret = statNode.findFirstExpression(expressions_1.BlockName);
71492
+ }
71493
+ return ret;
71475
71494
  }
71476
71495
  else {
71477
71496
  return undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.113.51",
3
+ "version": "2.113.53",
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.51",
41
+ "@abaplint/core": "^2.113.53",
42
42
  "@types/chai": "^4.3.20",
43
43
  "@types/glob": "^8.1.0",
44
44
  "@types/minimist": "^1.2.5",