@abaplint/runtime 2.2.18 → 2.2.19

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.
@@ -14,15 +14,23 @@ function concatenate(input) {
14
14
  }
15
15
  else {
16
16
  for (const source of input.source) {
17
- if (typeof source === "string" || typeof source === "number") {
18
- list.push(source.toString());
19
- }
20
- else if (source instanceof types_1.Table) {
17
+ let val = "";
18
+ if (source instanceof types_1.Table) {
21
19
  throw new Error("concatenate, error input is table");
22
20
  }
21
+ else if (typeof source === "string" || typeof source === "number") {
22
+ val = source.toString();
23
+ }
24
+ else if (source instanceof types_1.Character) {
25
+ val = source.get().toString();
26
+ if (input.respectingBlanks !== true) {
27
+ val = val.replace(/ +$/, "");
28
+ }
29
+ }
23
30
  else {
24
- list.push(source.get().toString());
31
+ val = source.get().toString();
25
32
  }
33
+ list.push(val);
26
34
  }
27
35
  }
28
36
  let sep = "";
@@ -1,3 +1,3 @@
1
- import { Structure } from "../types";
1
+ import { Character, Structure } from "../types";
2
2
  import { ICharacter } from "../types/_character";
3
- export declare function overlay(value: ICharacter | Structure, _withh: ICharacter, _only?: ICharacter): void;
3
+ export declare function overlay(value: Character | Structure, withh: ICharacter, _only?: ICharacter): void;
@@ -1,11 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.overlay = void 0;
4
+ const offset_length_1 = require("../offset_length");
4
5
  const types_1 = require("../types");
5
- function overlay(value, _withh, _only) {
6
+ function overlay(value, withh, _only) {
6
7
  const set = value instanceof types_1.Structure ? value.getCharacter() : value.get();
7
- console.dir(set.length);
8
- value.set(set);
8
+ const w = withh.get();
9
+ const len = set.length;
10
+ for (let i = 0; i < len; i++) {
11
+ if (set.substring(i, i + 1) === " ") {
12
+ new offset_length_1.OffsetLength(value, { offset: i, length: 1 }).set(w.substring(i, i + 1));
13
+ }
14
+ }
9
15
  }
10
16
  exports.overlay = overlay;
11
17
  //# sourceMappingURL=overlay.js.map
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Character = void 0;
4
4
  const _parse_1 = require("../operators/_parse");
5
5
  // eslint-disable-next-line prefer-const
6
- let featureFixLength = false;
6
+ let featureFixLength = true;
7
7
  class Character {
8
8
  constructor(input) {
9
9
  this.length = (input === null || input === void 0 ? void 0 : input.length) ? input === null || input === void 0 ? void 0 : input.length : 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.2.18",
3
+ "version": "2.2.19",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",