@abaplint/core 2.113.93 → 2.113.95

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.
@@ -827,6 +827,10 @@ declare class CDSDefineProjection extends Expression {
827
827
  getRunnable(): IStatementRunnable;
828
828
  }
829
829
 
830
+ declare class CDSDefineTableFunction extends Expression {
831
+ getRunnable(): IStatementRunnable;
832
+ }
833
+
830
834
  declare class CDSDefineView extends Expression {
831
835
  getRunnable(): IStatementRunnable;
832
836
  }
@@ -2442,11 +2446,12 @@ declare namespace ExpressionsCDS {
2442
2446
  CDSDefineAbstract,
2443
2447
  CDSDefineCustom,
2444
2448
  CDSDefineProjection,
2449
+ CDSDefineTableFunction,
2445
2450
  CDSDefineView,
2446
2451
  CDSElement,
2447
2452
  CDSExtendView,
2448
- CDSFunction,
2449
2453
  CDSFunctionInput,
2454
+ CDSFunction,
2450
2455
  CDSGroupBy,
2451
2456
  CDSHaving,
2452
2457
  CDSInteger,
@@ -4,9 +4,10 @@ exports.FieldSub = void 0;
4
4
  const combi_1 = require("../combi");
5
5
  const tokens_1 = require("../../1_lexer/tokens");
6
6
  const table_body_1 = require("./table_body");
7
+ const field_length_1 = require("./field_length");
7
8
  class FieldSub extends combi_1.Expression {
8
9
  getRunnable() {
9
- const ret = (0, combi_1.seq)((0, combi_1.regex)(/^\*?!?&?(\/\w+\/)?[a-zA-Z_%$\?][\w%$\$\*]*$/), (0, combi_1.starPrio)((0, combi_1.seq)((0, combi_1.tok)(tokens_1.Dash), (0, combi_1.regex)(/^[\w%$\$\*]+$/))), (0, combi_1.opt)(table_body_1.TableBody));
10
+ const ret = (0, combi_1.seq)((0, combi_1.regex)(/^\*?!?&?(\/\w+\/)?[a-zA-Z_%$\?][\w%$\$\*]*$/), (0, combi_1.starPrio)((0, combi_1.seq)((0, combi_1.tok)(tokens_1.Dash), (0, combi_1.regex)(/^[\w%$\$\*]+$/))), (0, combi_1.opt)(field_length_1.FieldLength), (0, combi_1.opt)(table_body_1.TableBody));
10
11
  return ret;
11
12
  }
12
13
  }
@@ -8,7 +8,7 @@ const integer_1 = require("./integer");
8
8
  const sql_function_input_1 = require("./sql_function_input");
9
9
  class SQLFunction extends combi_1.Expression {
10
10
  getRunnable() {
11
- const castTypes = (0, combi_1.altPrio)((0, combi_1.seq)("CHAR", (0, combi_1.tok)(tokens_1.ParenLeftW), integer_1.Integer, (0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.seq)("DEC", (0, combi_1.tok)(tokens_1.ParenLeftW), integer_1.Integer, ",", integer_1.Integer, (0, combi_1.tok)(tokens_1.WParenRightW)), "FLTP", "NUMC", "INT8");
11
+ const castTypes = (0, combi_1.altPrio)((0, combi_1.seq)("CHAR", (0, combi_1.optPrio)((0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeftW), integer_1.Integer, (0, combi_1.tok)(tokens_1.WParenRightW)))), (0, combi_1.seq)("DEC", (0, combi_1.tok)(tokens_1.ParenLeftW), integer_1.Integer, ",", integer_1.Integer, (0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.seq)("NUMC", (0, combi_1.optPrio)((0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeftW), integer_1.Integer, (0, combi_1.tok)(tokens_1.WParenRightW)))), "FLTP", "INT2", "INT8");
12
12
  const commaParam = (0, combi_1.seq)(",", sql_function_input_1.SQLFunctionInput);
13
13
  // note: the function names are not keywords, they are usually in lower case
14
14
  const abs = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.regex)(/^abs$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, (0, combi_1.tok)(tokens_1.WParenRightW)));
@@ -17,7 +17,7 @@ class TypeTable extends combi_1.Expression {
17
17
  const rangeLike = (0, combi_1.seq)("RANGE OF", field_chain_1.FieldChain, (0, combi_1.optPrio)(header), (0, combi_1.optPrio)(initial), (0, combi_1.optPrio)("VALUE IS INITIAL"));
18
18
  // a maximum of 15 secondary table keys can be defined
19
19
  // "WITH" is not allowed as a field name in keys
20
- const typetable = (0, combi_1.alt)(generic, (0, combi_1.seq)(normal1, (0, combi_1.alt)((0, combi_1.opt)((0, combi_1.per)(header, initial, (0, combi_1.plusPrio)(type_table_key_1.TypeTableKey))), (0, combi_1.seq)((0, combi_1.plus)(type_table_key_1.TypeTableKey), (0, combi_1.optPrio)(initial)))));
20
+ const typetable = (0, combi_1.alt)(generic, (0, combi_1.seq)(normal1, (0, combi_1.alt)((0, combi_1.opt)((0, combi_1.per)(header, initial, (0, combi_1.plusPrio)(type_table_key_1.TypeTableKey))), (0, combi_1.seq)((0, combi_1.plus)(type_table_key_1.TypeTableKey), (0, combi_1.optPrio)(initial))), (0, combi_1.optPrio)("VALUE IS INITIAL")));
21
21
  const occurs = (0, combi_1.seq)("OCCURS", (0, combi_1.altPrio)(_1.Integer, field_chain_1.FieldChain));
22
22
  const derived = (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("TABLE FOR", (0, combi_1.altPrio)("ACTION IMPORT", "ACTION RESULT", "CREATE", "EVENT", "REPORTED EARLY", "FAILED EARLY", "FAILED", "LOCK", "DETERMINATION", "READ RESULT", "UPDATE"), (0, combi_1.alt)(_1.TypeName, _1.EntityAssociation)));
23
23
  const oldType = (0, combi_1.seq)((0, combi_1.opt)("REF TO"), _1.TypeName, (0, combi_1.alt)((0, combi_1.seq)(occurs, (0, combi_1.opt)(header)), header));
@@ -8,7 +8,8 @@ class DeleteDatabase {
8
8
  getMatcher() {
9
9
  const where = (0, combi_1.seq)("WHERE", (0, combi_1.altPrio)(expressions_1.SQLCond, expressions_1.Dynamic));
10
10
  const from = (0, combi_1.seq)("FROM", expressions_1.DatabaseTable, (0, combi_1.optPrio)(sql_client_1.SQLClient), (0, combi_1.optPrio)(expressions_1.DatabaseConnection), (0, combi_1.opt)(where));
11
- const table = (0, combi_1.seq)(expressions_1.DatabaseTable, (0, combi_1.optPrio)(sql_client_1.SQLClient), (0, combi_1.optPrio)(expressions_1.DatabaseConnection), "FROM", (0, combi_1.opt)("TABLE"), expressions_1.SQLSourceSimple);
11
+ const fromSomething = (0, combi_1.seq)("FROM", (0, combi_1.opt)("TABLE"), expressions_1.SQLSourceSimple);
12
+ const table = (0, combi_1.seq)(expressions_1.DatabaseTable, (0, combi_1.optPrio)(sql_client_1.SQLClient), (0, combi_1.optPrio)(expressions_1.DatabaseConnection), (0, combi_1.optPrio)(fromSomething));
12
13
  const ret = (0, combi_1.seq)("DELETE", (0, combi_1.altPrio)(from, table));
13
14
  return ret;
14
15
  }
@@ -9,13 +9,13 @@ class DeleteInternal {
9
9
  const index = (0, combi_1.seq)("INDEX", expressions_1.Source);
10
10
  const keyName = (0, combi_1.altPrio)(expressions_1.SimpleName, expressions_1.Dynamic);
11
11
  const using = (0, combi_1.seq)("USING KEY", keyName);
12
- const from = (0, combi_1.optPrio)((0, combi_1.seq)("FROM", expressions_1.Source));
13
- const fromTo = (0, combi_1.seq)(from, (0, combi_1.optPrio)((0, combi_1.seq)("TO", expressions_1.Source)));
12
+ const from = (0, combi_1.seq)("FROM", expressions_1.Source);
13
+ const fromTo = (0, combi_1.seq)((0, combi_1.optPrio)(from), (0, combi_1.optPrio)((0, combi_1.seq)("TO", expressions_1.Source)));
14
14
  const where = (0, combi_1.seq)("WHERE", (0, combi_1.alt)(expressions_1.ComponentCond, expressions_1.Dynamic));
15
15
  const key = (0, combi_1.seq)("WITH TABLE KEY", (0, combi_1.opt)((0, combi_1.seq)(keyName, "COMPONENTS")), (0, combi_1.plus)(expressions_1.ComponentCompare));
16
- const table = (0, combi_1.seq)("TABLE", expressions_1.Target, (0, combi_1.alt)((0, combi_1.per)(index, using), from, key));
16
+ const table = (0, combi_1.seq)("TABLE", expressions_1.Target, (0, combi_1.alt)((0, combi_1.per)(index, using), (0, combi_1.seq)((0, combi_1.optPrio)(from), (0, combi_1.optPrio)(using)), key));
17
17
  const other = (0, combi_1.seq)(expressions_1.Target, (0, combi_1.alt)((0, combi_1.per)(index, using), fromTo, key), (0, combi_1.opt)(where));
18
- const f = (0, combi_1.seq)(expressions_1.FieldSub, (0, combi_1.optPrio)(expressions_1.FieldOffset), (0, combi_1.optPrio)(expressions_1.FieldLength));
18
+ const f = (0, combi_1.seq)(expressions_1.SimpleFieldChain2, (0, combi_1.optPrio)(expressions_1.FieldOffset), (0, combi_1.optPrio)(expressions_1.FieldLength));
19
19
  const adjacent = (0, combi_1.seq)("ADJACENT DUPLICATES FROM", expressions_1.Target, (0, combi_1.optPrio)(using), (0, combi_1.opt)((0, combi_1.seq)("COMPARING", (0, combi_1.altPrio)("ALL FIELDS", (0, combi_1.plus)((0, combi_1.altPrio)(f, expressions_1.Dynamic))))), (0, combi_1.optPrio)(using));
20
20
  return (0, combi_1.seq)("DELETE", (0, combi_1.alt)(table, adjacent, other));
21
21
  }
@@ -29,6 +29,9 @@ class CDSParser {
29
29
  if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {
30
30
  res = combi_1.Combi.run(new Expressions.CDSDefineCustom(), tokens, version_1.defaultVersion);
31
31
  }
32
+ if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {
33
+ res = combi_1.Combi.run(new Expressions.CDSDefineTableFunction(), tokens, version_1.defaultVersion);
34
+ }
32
35
  if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {
33
36
  res = combi_1.Combi.run(new Expressions.CDSExtendView(), tokens, version_1.defaultVersion);
34
37
  }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CDSDefineTableFunction = void 0;
4
+ const _1 = require(".");
5
+ const combi_1 = require("../../abap/2_statements/combi");
6
+ const cds_name_1 = require("./cds_name");
7
+ class CDSDefineTableFunction extends combi_1.Expression {
8
+ getRunnable() {
9
+ const methodName = (0, combi_1.seq)(cds_name_1.CDSName, "=", ">", cds_name_1.CDSName);
10
+ return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.str)("DEFINE TABLE FUNCTION"), cds_name_1.CDSName, _1.CDSWithParameters, (0, combi_1.str)("RETURNS {"), (0, combi_1.plus)((0, combi_1.seq)(cds_name_1.CDSName, ":", _1.CDSType, ";")), (0, combi_1.str)("} IMPLEMENTED BY METHOD"), methodName, (0, combi_1.opt)(";"));
11
+ }
12
+ }
13
+ exports.CDSDefineTableFunction = CDSDefineTableFunction;
14
+ //# sourceMappingURL=cds_define_table_function.js.map
@@ -31,11 +31,12 @@ __exportStar(require("./cds_condition"), exports);
31
31
  __exportStar(require("./cds_define_abstract"), exports);
32
32
  __exportStar(require("./cds_define_custom"), exports);
33
33
  __exportStar(require("./cds_define_projection"), exports);
34
+ __exportStar(require("./cds_define_table_function"), exports);
34
35
  __exportStar(require("./cds_define_view"), exports);
35
36
  __exportStar(require("./cds_element"), exports);
36
37
  __exportStar(require("./cds_extend_view"), exports);
37
- __exportStar(require("./cds_function"), exports);
38
38
  __exportStar(require("./cds_function_input"), exports);
39
+ __exportStar(require("./cds_function"), exports);
39
40
  __exportStar(require("./cds_group_by"), exports);
40
41
  __exportStar(require("./cds_having"), exports);
41
42
  __exportStar(require("./cds_integer"), exports);
@@ -78,13 +78,13 @@ class FunctionGroup extends _abap_object_1.ABAPObject {
78
78
  if (namespaced) {
79
79
  search = search.replace(/\//g, "#");
80
80
  }
81
- if ((i.startsWith("L") || namespaced) && f.getFilename().includes(search.toLowerCase())) {
81
+ if ((i.startsWith("L") || namespaced) && f.getFilename().includes(search.toLowerCase() + ".")) {
82
82
  ret.push({ file: f, name: i });
83
83
  }
84
84
  // fix for URL encoded? Uris
85
85
  if (namespaced) {
86
86
  search = i.replace(/\//g, "%23");
87
- if (f.getFilename().includes(search.toLowerCase())) {
87
+ if (f.getFilename().includes(search.toLowerCase() + ".")) {
88
88
  ret.push({ file: f, name: i });
89
89
  }
90
90
  }
@@ -67,7 +67,7 @@ class Registry {
67
67
  }
68
68
  static abaplintVersion() {
69
69
  // magic, see build script "version.sh"
70
- return "2.113.93";
70
+ return "2.113.95";
71
71
  }
72
72
  getDDICReferences() {
73
73
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.113.93",
3
+ "version": "2.113.95",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",