@abaplint/core 2.120.14 → 2.120.16

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.
@@ -9,7 +9,7 @@ class FieldChain extends combi_1.Expression {
9
9
  getRunnable() {
10
10
  const attr = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.InstanceArrow), _1.AttributeName);
11
11
  const comp = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.Dash), (0, combi_1.optPrio)(_1.ComponentName));
12
- const chain = (0, combi_1.star)((0, combi_1.altPrio)(_1.Dereference, (0, _dynamic_access_1.dynAttr)(), attr, (0, _dynamic_access_1.dynComp)((0, combi_1.optPrio)(_1.FieldOffset), (0, combi_1.optPrio)(_1.FieldLength)), comp, _1.TableExpression));
12
+ const chain = (0, combi_1.star)((0, combi_1.altPrio)(_1.Dereference, (0, _dynamic_access_1.dynAttr)(), attr, (0, _dynamic_access_1.dynComp)((0, combi_1.optPrio)(_1.FieldOffset), (0, combi_1.optPrio)(_1.FieldLength)), comp, (0, combi_1.tok)(tokens_1.AssociationName), _1.TableExpression));
13
13
  const clas = (0, combi_1.seq)(_1.ClassName, (0, combi_1.tok)(tokens_1.StaticArrow), _1.AttributeName);
14
14
  const start = (0, combi_1.altPrio)(clas, _1.SourceField, _1.SourceFieldSymbol);
15
15
  const after = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.DashW), (0, combi_1.seq)((0, combi_1.optPrio)(_1.TableBody), (0, combi_1.optPrio)(_1.FieldOffset), (0, combi_1.optPrio)(_1.FieldLength)));
@@ -10,7 +10,7 @@ class TableExpression extends combi_1.Expression {
10
10
  const fields = (0, combi_1.plus)((0, combi_1.seq)((0, combi_1.altPrio)(_1.ComponentChainSimple, _1.Dynamic), "=", _1.Source));
11
11
  const key = (0, combi_1.seq)("KEY", _1.SimpleName);
12
12
  const index = (0, combi_1.seq)("INDEX", _1.Source);
13
- const ret = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.BracketLeftW), (0, combi_1.alt)(_1.Source, (0, combi_1.seq)((0, combi_1.optPrio)(key), (0, combi_1.opt)("COMPONENTS"), (0, combi_1.altPrio)(fields, index))), (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WBracketRight), (0, combi_1.tok)(tokens_1.WBracketRightW)));
13
+ const ret = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.BracketLeftW), (0, combi_1.alt)((0, combi_1.seq)(_1.Source, fields), _1.Source, (0, combi_1.seq)((0, combi_1.optPrio)(key), (0, combi_1.opt)("COMPONENTS"), (0, combi_1.altPrio)(fields, index))), (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WBracketRight), (0, combi_1.tok)(tokens_1.WBracketRightW)));
14
14
  return (0, combi_1.ver)(version_1.Release.v740sp02, ret, { also: combi_1.AlsoIn.OpenABAP });
15
15
  }
16
16
  }
@@ -80,10 +80,15 @@ class TypeUtils {
80
80
  return false;
81
81
  }
82
82
  isCharLikeField(type) {
83
+ if (type instanceof basic_1.StructureType
84
+ || (type instanceof basic_1.TableType && type.isWithHeader())) {
85
+ return this.isCharLikeStrict(type);
86
+ }
83
87
  return type instanceof basic_1.CharacterType
84
88
  || type instanceof basic_1.NumericType
85
89
  || type instanceof basic_1.DateType
86
90
  || type instanceof basic_1.TimeType
91
+ || type instanceof cgeneric_type_1.CGenericType
87
92
  || type instanceof basic_1.CLikeType
88
93
  || type instanceof basic_1.AnyType
89
94
  || type instanceof basic_1.UnknownType
@@ -63,9 +63,13 @@ class InsertInternal {
63
63
  && node.findDirectTokenByText("LINES") === undefined) {
64
64
  targetType = targetType.getRowType();
65
65
  }
66
- let source = node.findDirectExpression(Expressions.SimpleSource4);
67
- if (source === undefined) {
68
- source = node.findDirectExpression(Expressions.Source);
66
+ const initial = node.findDirectTokenByText("INITIAL") !== undefined;
67
+ let source;
68
+ if (initial === false) {
69
+ source = node.findDirectExpression(Expressions.SimpleSource4);
70
+ if (source === undefined) {
71
+ source = node.findDirectExpression(Expressions.Source);
72
+ }
69
73
  }
70
74
  const sourceType = source ? source_1.Source.runSyntax(source, input, targetType) : targetType;
71
75
  if (targetType === undefined
@@ -87,7 +91,7 @@ class InsertInternal {
87
91
  fstarget_1.FSTarget.runSyntax(afterAssigning, input, sourceType);
88
92
  }
89
93
  }
90
- if (node.findDirectTokenByText("INITIAL") === undefined) {
94
+ if (initial === false) {
91
95
  let error = false;
92
96
  if (sourceType instanceof basic_1.IntegerType && targetType instanceof basic_1.Integer8Type) {
93
97
  error = true;
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.ClassData = void 0;
37
37
  const Expressions = __importStar(require("../../2_statements/expressions"));
38
38
  const Statements = __importStar(require("../../2_statements/statements"));
39
+ const Structures = __importStar(require("../../3_structures/structures"));
39
40
  const nodes_1 = require("../../nodes");
40
41
  const _typed_identifier_1 = require("../../types/_typed_identifier");
41
42
  const Basic = __importStar(require("../../types/basic"));
@@ -54,7 +55,14 @@ class ClassData {
54
55
  values[found.getName()] = found.getValue();
55
56
  }
56
57
  }
57
- // todo, nested structures and INCLUDES
58
+ else if (c instanceof nodes_1.StructureNode && ctyp instanceof Structures.ClassData) {
59
+ const found = new ClassData().runSyntax(c, input);
60
+ if (found) {
61
+ components.push({ name: found.getName(), type: found.getType() });
62
+ values[found.getName()] = found.getValue();
63
+ }
64
+ }
65
+ // todo, INCLUDES
58
66
  }
59
67
  return new _typed_identifier_1.TypedIdentifier(name, input.filename, new Basic.StructureType(components), ["static" /* IdentifierMeta.Static */], values);
60
68
  }
@@ -75,7 +75,7 @@ class Registry {
75
75
  }
76
76
  static abaplintVersion() {
77
77
  // magic, see build script "version.js"
78
- return "2.120.14";
78
+ return "2.120.16";
79
79
  }
80
80
  getDDICReferences() {
81
81
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.120.14",
3
+ "version": "2.120.16",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",