@abaplint/cli 2.120.40 → 2.120.42

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 +31 -7
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -8991,21 +8991,21 @@ class SQLFunction extends combi_1.Expression {
8991
8991
  const fn = (name, params, v) => {
8992
8992
  const nameReg = (0, combi_1.regex)(new RegExp("^" + name + "$", "i"));
8993
8993
  if (params === 0) {
8994
- return (0, combi_1.ver)(v, (0, combi_1.seq)(nameReg, (0, combi_1.tok)(tokens_1.ParenLeftW), (0, combi_1.tok)(tokens_1.WParenRightW)));
8994
+ return (0, combi_1.ver)(v, (0, combi_1.seq)(nameReg, (0, combi_1.tok)(tokens_1.ParenLeftW), (0, combi_1.tok)(tokens_1.WParenRightW)), { also: combi_1.AlsoIn.OpenABAP });
8995
8995
  }
8996
8996
  else if (params === VARIADIC) {
8997
- return (0, combi_1.ver)(v, (0, combi_1.seq)(nameReg, (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, (0, combi_1.starPrio)(commaParam), (0, combi_1.tok)(tokens_1.WParenRightW)));
8997
+ return (0, combi_1.ver)(v, (0, combi_1.seq)(nameReg, (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, (0, combi_1.starPrio)(commaParam), (0, combi_1.tok)(tokens_1.WParenRightW)), { also: combi_1.AlsoIn.OpenABAP });
8998
8998
  }
8999
8999
  else {
9000
9000
  const extra = [];
9001
9001
  for (let i = 1; i < params; i++) {
9002
9002
  extra.push(commaParam);
9003
9003
  }
9004
- return (0, combi_1.ver)(v, (0, combi_1.seq)(nameReg, (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, ...extra, (0, combi_1.tok)(tokens_1.WParenRightW)));
9004
+ return (0, combi_1.ver)(v, (0, combi_1.seq)(nameReg, (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, ...extra, (0, combi_1.tok)(tokens_1.WParenRightW)), { also: combi_1.AlsoIn.OpenABAP });
9005
9005
  }
9006
9006
  };
9007
9007
  const castInput = (0, combi_1.altPrio)(sql_case_1.SQLCase, sql_function_input_1.SQLFunctionInput);
9008
- const cast = (0, combi_1.ver)(version_1.Release.v750, (0, combi_1.seq)((0, combi_1.regex)(/^cast$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), castInput, "AS", castTypes, (0, combi_1.tok)(tokens_1.WParenRightW)));
9008
+ const cast = (0, combi_1.ver)(version_1.Release.v750, (0, combi_1.seq)((0, combi_1.regex)(/^cast$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), castInput, "AS", castTypes, (0, combi_1.tok)(tokens_1.WParenRightW)), { also: combi_1.AlsoIn.OpenABAP });
9009
9009
  const hostParen = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, (0, combi_1.tok)(tokens_1.WParenRightW));
9010
9010
  const hostVar = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), (0, combi_1.altPrio)(simple_source3_1.SimpleSource3, hostParen));
9011
9011
  const abapOnly = (0, combi_1.altPrio)(constant_1.Constant, hostVar);
@@ -9015,7 +9015,7 @@ class SQLFunction extends combi_1.Expression {
9015
9015
  const kvs = params.map(p => (0, combi_1.seq)((0, combi_1.regex)(new RegExp("^" + p.name + "$", "i")), "=", valueFor(p)));
9016
9016
  const anyKv = kvs.length === 1 ? kvs[0] : (0, combi_1.altPrio)(kvs[0], kvs[1], ...kvs.slice(2));
9017
9017
  const body = (0, combi_1.optPrio)((0, combi_1.seq)(anyKv, (0, combi_1.starPrio)((0, combi_1.seq)(",", anyKv))));
9018
- return (0, combi_1.ver)(v, (0, combi_1.seq)(nameReg, (0, combi_1.tok)(tokens_1.ParenLeftW), body, (0, combi_1.tok)(tokens_1.WParenRightW)));
9018
+ return (0, combi_1.ver)(v, (0, combi_1.seq)(nameReg, (0, combi_1.tok)(tokens_1.ParenLeftW), body, (0, combi_1.tok)(tokens_1.WParenRightW)), { also: combi_1.AlsoIn.OpenABAP });
9019
9019
  };
9020
9020
  return (0, combi_1.altPrio)(cast, sql_replace_regexpr_1.SQLReplaceRegexpr, sql_occurrences_regexpr_1.SQLOccurrencesRegexpr, sql_substring_regexpr_1.SQLSubstringRegexpr, sql_locate_regexpr_1.SQLLocateRegexpr, ...exports.sqlFunctionDefs.map(([name, params, v]) => fn(name, params, v)), ...exports.sqlNamedFunctionDefs.map(([name, v, params]) => namedFn(name, v, params)), ...exports.sqlSpatialFunctionDefs.map(([name, params, v]) => fn(name, params, v)), ...exports.sqlSpatialAggregateDefs.map(([name, params, v]) => fn(name, params, v)));
9021
9021
  }
@@ -70174,7 +70174,7 @@ class Registry {
70174
70174
  }
70175
70175
  static abaplintVersion() {
70176
70176
  // magic, see build script "version.js"
70177
- return "2.120.40";
70177
+ return "2.120.42";
70178
70178
  }
70179
70179
  getDDICReferences() {
70180
70180
  return this.ddicReferences;
@@ -72865,7 +72865,7 @@ const KNOWN_CURR_DATA_ELEMENTS = ["BWERT", "DZWERT"];
72865
72865
  const RESERVED_ELEMENT_NAMES = ["BEGIN", "NUMBER", "POSITION"];
72866
72866
  const MAX_LABEL_LENGTH = 40;
72867
72867
  // Annotations which are not supported in CDS view entities
72868
- const VIEW_ENTITY_FORBIDDEN_ANNOTATIONS = ["Semantics.unitOfMeasure"];
72868
+ const VIEW_ENTITY_FORBIDDEN_ANNOTATIONS = ["Semantics.unitOfMeasure", "Semantics.currencyCode"];
72869
72869
  class CDSCheckSyntax {
72870
72870
  constructor() {
72871
72871
  this.conf = new CDSCheckSyntaxConf();
@@ -72909,6 +72909,7 @@ Missing objects are only reported when their names match the configured errorNam
72909
72909
  this.checkFieldAnnotations(tree, ddic, issues, file);
72910
72910
  this.checkLabels(tree, issues, file);
72911
72911
  this.checkViewEntityAnnotations(tree, issues, file);
72912
+ this.checkSearchable(tree, issues, file);
72912
72913
  this.checkReservedNames(tree, issues, file);
72913
72914
  this.checkFields(tree, sources, object, issues, file);
72914
72915
  return issues;
@@ -73130,6 +73131,29 @@ Missing objects are only reported when their names match the configured errorNam
73130
73131
  }
73131
73132
  }
73132
73133
  }
73134
+ checkSearchable(tree, issues, file) {
73135
+ let searchable;
73136
+ for (const annotation of tree.findAllExpressionsRecursive(expressions_1.CDSAnnotation)) {
73137
+ const normalized = annotation.concatTokens().replace(/\s/g, "").toUpperCase().replace(/^@</, "@");
73138
+ if (this.hasSearchAnnotation(normalized, "defaultSearchElement")) {
73139
+ return;
73140
+ }
73141
+ else if (searchable === undefined && this.hasSearchAnnotation(normalized, "searchable")) {
73142
+ searchable = annotation;
73143
+ }
73144
+ }
73145
+ if (searchable !== undefined) {
73146
+ const message = "@Search.defaultSearchElement: true required on at least one element " +
73147
+ "when @Search.searchable: true";
73148
+ issues.push(issue_1.Issue.atToken(file, searchable.getFirstToken(), message, this.getMetadata().key, this.conf.severity));
73149
+ }
73150
+ }
73151
+ hasSearchAnnotation(normalized, name) {
73152
+ if (normalized.startsWith("@SEARCH") === false) {
73153
+ return false;
73154
+ }
73155
+ return new RegExp("[.{,]" + name.toUpperCase() + ":TRUE").test(normalized);
73156
+ }
73133
73157
  checkReservedNames(tree, issues, file) {
73134
73158
  var _a, _b;
73135
73159
  for (const element of tree.findAllExpressionsRecursive(expressions_1.CDSElement)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.120.40",
3
+ "version": "2.120.42",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "homepage": "https://abaplint.org",
41
41
  "devDependencies": {
42
- "@abaplint/core": "^2.120.40",
42
+ "@abaplint/core": "^2.120.42",
43
43
  "@types/chai": "^4.3.20",
44
44
  "@types/minimist": "^1.2.5",
45
45
  "@types/mocha": "^10.0.10",