@abaplint/core 2.113.52 → 2.113.54

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.
@@ -6,7 +6,8 @@ const _1 = require(".");
6
6
  class InlineLoopDefinition extends combi_1.Expression {
7
7
  getRunnable() {
8
8
  const index = (0, combi_1.seq)("INDEX INTO", _1.TargetField);
9
- 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));
9
+ const key = (0, combi_1.seq)("USING KEY", _1.SimpleName);
10
+ 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));
10
11
  }
11
12
  }
12
13
  exports.InlineLoopDefinition = InlineLoopDefinition;
@@ -6,7 +6,9 @@ const _1 = require(".");
6
6
  class RaiseWith extends combi_1.Expression {
7
7
  getRunnable() {
8
8
  const wit = (0, combi_1.seq)("WITH", _1.SimpleSource1, (0, combi_1.opt)(_1.SimpleSource1), (0, combi_1.opt)(_1.SimpleSource1), (0, combi_1.opt)(_1.SimpleSource1));
9
- return wit;
9
+ // todo: I guess this is from version something?
10
+ const witComplex = (0, combi_1.seq)("WITH", _1.Source, (0, combi_1.opt)(_1.Source), (0, combi_1.opt)(_1.Source), (0, combi_1.opt)(_1.Source));
11
+ return (0, combi_1.alt)(wit, witComplex);
10
12
  }
11
13
  }
12
14
  exports.RaiseWith = RaiseWith;
@@ -6,8 +6,6 @@ const _1 = require(".");
6
6
  const version_1 = require("../../../version");
7
7
  const sql_group_by_1 = require("./sql_group_by");
8
8
  const sql_into_structure_1 = require("./sql_into_structure");
9
- const tokens_1 = require("../../1_lexer/tokens");
10
- const sql_field_name_1 = require("./sql_field_name");
11
9
  const sql_up_to_1 = require("./sql_up_to");
12
10
  class Select extends combi_1.Expression {
13
11
  getRunnable() {
@@ -19,8 +17,7 @@ class Select extends combi_1.Expression {
19
17
  // todo, HINTS cannot be anywhere, need an expression dedicated for strict sql
20
18
  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);
21
19
  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);
22
- 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));
23
- const fieldList = (0, combi_1.optPrio)((0, combi_1.altPrio)(_1.SQLFieldList, paren));
20
+ const fieldList = (0, combi_1.optPrio)(_1.SQLFieldList);
24
21
  const single = (0, combi_1.seq)("SINGLE", (0, combi_1.optPrio)("FOR UPDATE"), fieldList, permSingle);
25
22
  const other = (0, combi_1.seq)((0, combi_1.optPrio)("DISTINCT"), fieldList, perm);
26
23
  const ret = (0, combi_1.seq)("SELECT", (0, combi_1.altPrio)(single, other));
@@ -8,7 +8,7 @@ const dynamic_1 = require("./dynamic");
8
8
  const sql_arithmetics_1 = require("./sql_arithmetics");
9
9
  class SQLAggregation extends combi_1.Expression {
10
10
  getRunnable() {
11
- const f = (0, combi_1.seq)((0, combi_1.optPrio)("DISTINCT"), (0, combi_1.altPrio)(sql_arithmetics_1.SQLArithmetics, dynamic_1.Dynamic, _1.SQLFunction));
11
+ const f = (0, combi_1.seq)((0, combi_1.optPrio)("DISTINCT"), (0, combi_1.altPrio)(sql_arithmetics_1.SQLArithmetics, dynamic_1.Dynamic, _1.SQLFunction, _1.SQLCase));
12
12
  const fparen = (0, combi_1.seq)("(", _1.Field, ")");
13
13
  const count = (0, combi_1.seq)("COUNT", (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenLeft), (0, combi_1.tok)(tokens_1.ParenLeftW)), (0, combi_1.optPrio)("DISTINCT"), (0, combi_1.altPrio)("*", _1.Field, fparen), ")");
14
14
  const max = (0, combi_1.seq)("MAX", (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenLeft), (0, combi_1.tok)(tokens_1.ParenLeftW)), f, ")");
@@ -4,11 +4,13 @@ exports.SQLFieldList = void 0;
4
4
  const combi_1 = require("../combi");
5
5
  const _1 = require(".");
6
6
  const version_1 = require("../../../version");
7
+ const tokens_1 = require("../../1_lexer/tokens");
7
8
  class SQLFieldList extends combi_1.Expression {
8
9
  getRunnable() {
10
+ const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFieldName, (0, combi_1.tok)(tokens_1.WParenRightW));
9
11
  const nev = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.starPrio)((0, combi_1.seq)(",", _1.SQLField)));
10
12
  const old = (0, combi_1.starPrio)(_1.SQLField);
11
- return (0, combi_1.altPrio)("*", _1.Dynamic, (0, combi_1.seq)(_1.SQLField, (0, combi_1.alt)(nev, old)));
13
+ return (0, combi_1.altPrio)("*", _1.Dynamic, (0, combi_1.seq)(_1.SQLField, (0, combi_1.alt)(nev, old)), paren);
12
14
  }
13
15
  }
14
16
  exports.SQLFieldList = SQLFieldList;
@@ -12,7 +12,7 @@ class StringTemplateFormatting extends combi_1.Expression {
12
12
  const alignOptions = (0, combi_1.altPrio)("LEFT", "RIGHT", "CENTER", _1.Source);
13
13
  const dateTimeOptions = (0, combi_1.altPrio)("RAW", "ISO", "USER", "ENVIRONMENT", _1.Source, dynamic_1.Dynamic);
14
14
  const timeStampOptions = (0, combi_1.altPrio)("SPACE", "ISO", "USER", "ENVIRONMENT", _1.Source);
15
- const numberOptions = (0, combi_1.altPrio)("RAW", "USER", "ENVIRONMENT", _1.Source);
15
+ const numberOptions = (0, combi_1.altPrio)("RAW", "USER", "ENVIRONMENT", _1.Source, dynamic_1.Dynamic);
16
16
  const signOptions = (0, combi_1.altPrio)("LEFT", "LEFTPLUS", "LEFTSPACE", "RIGHT", "RIGHTPLUS", "RIGHTSPACE", _1.Source);
17
17
  const caseOptions = (0, combi_1.altPrio)("RAW", "UPPER", "LOWER", _1.Source, dynamic_1.Dynamic);
18
18
  const zeroXSDOptions = (0, combi_1.altPrio)("YES", "NO", _1.Source);
@@ -5,7 +5,7 @@ const combi_1 = require("../combi");
5
5
  const _1 = require(".");
6
6
  class TargetFieldSymbol extends combi_1.Expression {
7
7
  getRunnable() {
8
- return new _1.FieldSymbol();
8
+ return (0, combi_1.seq)(_1.FieldSymbol, (0, combi_1.optPrio)(_1.TableBody));
9
9
  }
10
10
  }
11
11
  exports.TargetFieldSymbol = TargetFieldSymbol;
@@ -6,8 +6,8 @@ const _1 = require(".");
6
6
  const tokens_1 = require("../../1_lexer/tokens");
7
7
  class Throw extends combi_1.Expression {
8
8
  getRunnable() {
9
- // todo, MESSAGE
10
- return (0, combi_1.seq)("THROW", (0, combi_1.opt)("RESUMABLE"), _1.ClassName, (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenLeftW), (0, combi_1.tok)(tokens_1.ParenLeft)), (0, combi_1.opt)((0, combi_1.alt)(_1.Source, _1.ParameterListS)), (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WParenRightW), (0, combi_1.tok)(tokens_1.ParenRightW)));
9
+ const message = (0, combi_1.seq)("MESSAGE", _1.MessageSource, (0, combi_1.opt)(_1.RaiseWith));
10
+ return (0, combi_1.seq)("THROW", (0, combi_1.opt)("RESUMABLE"), _1.ClassName, (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenLeftW), (0, combi_1.tok)(tokens_1.ParenLeft)), (0, combi_1.opt)((0, combi_1.alt)(_1.Source, _1.ParameterListS, message)), (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WParenRightW), (0, combi_1.tok)(tokens_1.ParenRightW)));
11
11
  }
12
12
  }
13
13
  exports.Throw = Throw;
@@ -22,7 +22,7 @@ class MethodDef {
22
22
  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));
23
23
  // todo, this is only from version something
24
24
  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));
25
- 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)));
25
+ 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)));
26
26
  return ret;
27
27
  }
28
28
  }
@@ -379,6 +379,9 @@ class TypeUtils {
379
379
  return this.isAssignable(source, target);
380
380
  }
381
381
  isAssignable(source, target) {
382
+ if (source === undefined || target === undefined) {
383
+ return true;
384
+ }
382
385
  /*
383
386
  console.dir(source);
384
387
  console.dir(target);
@@ -4,7 +4,7 @@ exports.CDSDetermineTypes = void 0;
4
4
  const basic_1 = require("../abap/types/basic");
5
5
  const ddic_1 = require("../ddic");
6
6
  class CDSDetermineTypes {
7
- parseType(reg, parsedData) {
7
+ parseType(reg, parsedData, ddlsName) {
8
8
  const ddic = new ddic_1.DDIC(reg);
9
9
  if ((parsedData === null || parsedData === void 0 ? void 0 : parsedData.fields.length) === 0) {
10
10
  return new basic_1.VoidType("DDLS:todo");
@@ -30,7 +30,7 @@ class CDSDetermineTypes {
30
30
  if ((source === null || source === void 0 ? void 0 : source.name) === undefined) {
31
31
  components.push({
32
32
  name: f.name,
33
- type: new basic_1.UnknownType("CDS parser error, unknown source"),
33
+ type: new basic_1.UnknownType("CDS parser error, unknown source, " + ddlsName),
34
34
  });
35
35
  continue;
36
36
  }
@@ -75,7 +75,7 @@ class CDSDetermineTypes {
75
75
  else {
76
76
  components.push({
77
77
  name: f.name,
78
- type: new basic_1.VoidType("DDLS:fieldname"),
78
+ type: new basic_1.VoidType("DDLS:fieldname:" + ddlsName),
79
79
  });
80
80
  }
81
81
  }
@@ -38,7 +38,7 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
38
38
  }
39
39
  parseType(reg) {
40
40
  this.parse();
41
- return new cds_determine_types_1.CDSDetermineTypes().parseType(reg, this.parsedData);
41
+ return new cds_determine_types_1.CDSDetermineTypes().parseType(reg, this.parsedData, this.getName());
42
42
  }
43
43
  getParsedData() {
44
44
  return this.parsedData;
@@ -67,7 +67,7 @@ class Registry {
67
67
  }
68
68
  static abaplintVersion() {
69
69
  // magic, see build script "version.sh"
70
- return "2.113.52";
70
+ return "2.113.54";
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.52",
3
+ "version": "2.113.54",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",