@abaplint/core 2.120.15 → 2.120.17

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.
@@ -6774,6 +6774,9 @@ declare class SimpleTarget extends Expression {
6774
6774
  }
6775
6775
 
6776
6776
  declare class SimpleType extends AbstractType {
6777
+ private static readonly singleton;
6778
+ static get(): SimpleType;
6779
+ private constructor();
6777
6780
  toText(): string;
6778
6781
  toABAP(): string;
6779
6782
  isGeneric(): boolean;
@@ -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
  }
@@ -674,7 +674,7 @@ BuiltIn.methods = {
674
674
  counter: BuiltIn.counter++,
675
675
  mandatory: {
676
676
  "val": basic_1.CLikeType.get(),
677
- "format": basic_1.CLikeType.get(),
677
+ "format": basic_1.SimpleType.get(),
678
678
  },
679
679
  return: basic_1.StringType.get(),
680
680
  release: version_1.Release.v702,
@@ -866,17 +866,17 @@ BuiltIn.methods = {
866
866
  "NMAX": {
867
867
  counter: BuiltIn.counter++,
868
868
  mandatory: {
869
- "val1": basic_1.CLikeType.get(),
870
- "val2": basic_1.CLikeType.get(),
869
+ "val1": basic_1.SimpleType.get(),
870
+ "val2": basic_1.SimpleType.get(),
871
871
  },
872
872
  optional: {
873
- "val3": basic_1.CLikeType.get(),
874
- "val4": basic_1.CLikeType.get(),
875
- "val5": basic_1.CLikeType.get(),
876
- "val6": basic_1.CLikeType.get(),
877
- "val7": basic_1.CLikeType.get(),
878
- "val8": basic_1.CLikeType.get(),
879
- "val9": basic_1.CLikeType.get(),
873
+ "val3": basic_1.SimpleType.get(),
874
+ "val4": basic_1.SimpleType.get(),
875
+ "val5": basic_1.SimpleType.get(),
876
+ "val6": basic_1.SimpleType.get(),
877
+ "val7": basic_1.SimpleType.get(),
878
+ "val8": basic_1.SimpleType.get(),
879
+ "val9": basic_1.SimpleType.get(),
880
880
  },
881
881
  return: basic_1.IntegerType.get(),
882
882
  release: version_1.Release.v702,
@@ -884,17 +884,17 @@ BuiltIn.methods = {
884
884
  "NMIN": {
885
885
  counter: BuiltIn.counter++,
886
886
  mandatory: {
887
- "val1": basic_1.CLikeType.get(),
888
- "val2": basic_1.CLikeType.get(),
887
+ "val1": basic_1.SimpleType.get(),
888
+ "val2": basic_1.SimpleType.get(),
889
889
  },
890
890
  optional: {
891
- "val3": basic_1.CLikeType.get(),
892
- "val4": basic_1.CLikeType.get(),
893
- "val5": basic_1.CLikeType.get(),
894
- "val6": basic_1.CLikeType.get(),
895
- "val7": basic_1.CLikeType.get(),
896
- "val8": basic_1.CLikeType.get(),
897
- "val9": basic_1.CLikeType.get(),
891
+ "val3": basic_1.SimpleType.get(),
892
+ "val4": basic_1.SimpleType.get(),
893
+ "val5": basic_1.SimpleType.get(),
894
+ "val6": basic_1.SimpleType.get(),
895
+ "val7": basic_1.SimpleType.get(),
896
+ "val8": basic_1.SimpleType.get(),
897
+ "val9": basic_1.SimpleType.get(),
898
898
  },
899
899
  return: basic_1.IntegerType.get(),
900
900
  release: version_1.Release.v702,
@@ -910,7 +910,7 @@ BuiltIn.methods = {
910
910
  counter: BuiltIn.counter++,
911
911
  mandatory: {
912
912
  "val": basic_1.CLikeType.get(),
913
- "occ": basic_1.CLikeType.get(),
913
+ "occ": basic_1.SimpleType.get(),
914
914
  },
915
915
  return: basic_1.StringType.get(),
916
916
  release: version_1.Release.v702,
@@ -88,6 +88,7 @@ class TypeUtils {
88
88
  || type instanceof basic_1.NumericType
89
89
  || type instanceof basic_1.DateType
90
90
  || type instanceof basic_1.TimeType
91
+ || type instanceof cgeneric_type_1.CGenericType
91
92
  || type instanceof basic_1.CLikeType
92
93
  || type instanceof basic_1.AnyType
93
94
  || type instanceof basic_1.UnknownType
@@ -345,6 +346,9 @@ class TypeUtils {
345
346
  if (calculated) {
346
347
  return this.isAssignable(source, target);
347
348
  }
349
+ if (target instanceof basic_1.CLikeType) {
350
+ return this.isCharLikeStrict(source);
351
+ }
348
352
  if (target instanceof basic_1.PGenericType) {
349
353
  return source instanceof basic_1.PackedType
350
354
  || source instanceof basic_1.PGenericType
@@ -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
  }
@@ -3,6 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SimpleType = void 0;
4
4
  const _abstract_type_1 = require("./_abstract_type");
5
5
  class SimpleType extends _abstract_type_1.AbstractType {
6
+ static get() {
7
+ return this.singleton;
8
+ }
9
+ constructor() {
10
+ super();
11
+ }
6
12
  toText() {
7
13
  return "```simple```";
8
14
  }
@@ -20,4 +26,5 @@ class SimpleType extends _abstract_type_1.AbstractType {
20
26
  }
21
27
  }
22
28
  exports.SimpleType = SimpleType;
29
+ SimpleType.singleton = new SimpleType();
23
30
  //# sourceMappingURL=simple_type.js.map
package/build/src/ddic.js CHANGED
@@ -109,7 +109,7 @@ class DDIC {
109
109
  case "ANY":
110
110
  return Types.AnyType.get({ qualifiedName: qualifiedName });
111
111
  case "SIMPLE":
112
- return new Types.SimpleType({ qualifiedName: qualifiedName });
112
+ return Types.SimpleType.get();
113
113
  case "%_C_POINTER":
114
114
  return new Types.HexType(8, qualifiedName);
115
115
  case "TABLE":
@@ -75,7 +75,7 @@ class Registry {
75
75
  }
76
76
  static abaplintVersion() {
77
77
  // magic, see build script "version.js"
78
- return "2.120.15";
78
+ return "2.120.17";
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.15",
3
+ "version": "2.120.17",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",