@abaplint/runtime 2.0.64 → 2.0.67

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.
@@ -16,6 +16,9 @@ function initial(val) {
16
16
  else if (val instanceof types_1.Numc) {
17
17
  return val.get().match(/^0+$/) !== null;
18
18
  }
19
+ else if (val instanceof types_1.Hex) {
20
+ return val.get().match(/^0+$/) !== null;
21
+ }
19
22
  else if (val instanceof types_1.Time) {
20
23
  return val.get() === "000000";
21
24
  }
@@ -4,10 +4,20 @@ exports.assign = void 0;
4
4
  const types_1 = require("../types");
5
5
  function assign(input) {
6
6
  if (input.dynamicText) {
7
- if (input.dynamicText.includes("->") && input.dynamicSource instanceof types_1.ABAPObject) {
8
- const split = input.dynamicText.split("->");
9
- // @ts-ignore
10
- input.dynamicSource = input.dynamicSource.get()[split[1].toLowerCase()];
7
+ if (input.dynamicSource instanceof types_1.FieldSymbol) {
8
+ input.dynamicSource = input.dynamicSource.getPointer();
9
+ }
10
+ if (input.dynamicText.includes("->")) {
11
+ if (input.dynamicSource instanceof types_1.ABAPObject) {
12
+ const split = input.dynamicText.split("->");
13
+ // @ts-ignore
14
+ input.dynamicSource = input.dynamicSource.get()[split[1].toLowerCase()];
15
+ }
16
+ else {
17
+ // @ts-ignore
18
+ abap.builtin.sy.get().subrc.set(4);
19
+ return;
20
+ }
11
21
  }
12
22
  if (input.dynamicSource) {
13
23
  input.target.assign(input.dynamicSource);
@@ -8,6 +8,7 @@ export interface ICreateDataOptions {
8
8
  type?: PointerType;
9
9
  typeHandle?: ABAPObject;
10
10
  likeLineOf?: FieldSymbol | Table;
11
+ like?: any;
11
12
  }
12
13
  export declare function createData(target: DataReference, options?: ICreateDataOptions): void;
13
14
  export {};
@@ -56,6 +56,12 @@ function createData(target, options) {
56
56
  }
57
57
  target.assign((0, clone_1.clone)(options.likeLineOf.getRowType()));
58
58
  }
59
+ else if (options === null || options === void 0 ? void 0 : options.like) {
60
+ if (options.like instanceof types_1.FieldSymbol) {
61
+ options.like = options.like.getPointer();
62
+ }
63
+ target.assign((0, clone_1.clone)(options.like));
64
+ }
59
65
  else {
60
66
  target.assign((0, clone_1.clone)(target.getType()));
61
67
  }
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.describe = void 0;
4
4
  const types_1 = require("../types");
5
5
  function describe(input) {
6
+ // console.dir(input);
6
7
  if (input.type) {
7
8
  if (input.field instanceof types_1.FieldSymbol) {
8
9
  describe({ field: input.field.getPointer(), type: input.type, length: input.length, mode: input.mode });
@@ -19,7 +19,7 @@ export declare class FieldSymbol {
19
19
  get(): any;
20
20
  appendInitial(): import("./table").TableRowType | undefined;
21
21
  array(): any;
22
- set(value: any): void | Structure | undefined;
22
+ set(value: any): this;
23
23
  getOffset(input: {
24
24
  offset: number;
25
25
  length: number;
@@ -66,7 +66,8 @@ class FieldSymbol {
66
66
  }
67
67
  set(value) {
68
68
  var _a;
69
- return (_a = this.pointer) === null || _a === void 0 ? void 0 : _a.set(value);
69
+ (_a = this.pointer) === null || _a === void 0 ? void 0 : _a.set(value);
70
+ return this;
70
71
  }
71
72
  getOffset(input) {
72
73
  // Assuming we're interested in Strings here, for now...
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.0.64",
3
+ "version": "2.0.67",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",