@abaplint/runtime 2.5.78 → 2.6.0
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.
package/build/src/compare/eq.js
CHANGED
|
@@ -27,6 +27,16 @@ function eq(left, right) {
|
|
|
27
27
|
else if (left instanceof types_1.FieldSymbol) {
|
|
28
28
|
return eq(left.getPointer(), right);
|
|
29
29
|
}
|
|
30
|
+
// for performance, do the typicaly/easy cases first
|
|
31
|
+
if (right instanceof types_1.Character && left instanceof types_1.Character && right.getLength() === left.getLength()) {
|
|
32
|
+
return right.get() === left.get();
|
|
33
|
+
}
|
|
34
|
+
else if (right instanceof types_1.Numc && left instanceof types_1.Numc && right.getLength() === left.getLength()) {
|
|
35
|
+
return right.get() === left.get();
|
|
36
|
+
}
|
|
37
|
+
else if (right instanceof types_1.Integer && left instanceof types_1.Integer) {
|
|
38
|
+
return right.get() === left.get();
|
|
39
|
+
}
|
|
30
40
|
if (left instanceof types_1.Table || right instanceof types_1.Table || left instanceof types_1.HashedTable || right instanceof types_1.HashedTable) {
|
|
31
41
|
if ((left instanceof types_1.Table || left instanceof types_1.HashedTable)
|
|
32
42
|
&& (right instanceof types_1.Table || right instanceof types_1.HashedTable)) {
|
|
@@ -5,6 +5,7 @@ const _parse_1 = require("../operators/_parse");
|
|
|
5
5
|
const throw_error_1 = require("../throw_error");
|
|
6
6
|
const field_symbol_1 = require("./field_symbol");
|
|
7
7
|
const structure_1 = require("./structure");
|
|
8
|
+
const TRIMREGEX = / *$/;
|
|
8
9
|
class Character {
|
|
9
10
|
constructor(length, extra) {
|
|
10
11
|
this.constant = false;
|
|
@@ -47,7 +48,7 @@ class Character {
|
|
|
47
48
|
this.value = this.value.substr(0, this.length);
|
|
48
49
|
}
|
|
49
50
|
else if (this.value.length < this.length) {
|
|
50
|
-
this.value.padEnd(this.length, " ");
|
|
51
|
+
this.value = this.value.padEnd(this.length, " ");
|
|
51
52
|
}
|
|
52
53
|
return this;
|
|
53
54
|
}
|
|
@@ -73,7 +74,12 @@ class Character {
|
|
|
73
74
|
return this.value;
|
|
74
75
|
}
|
|
75
76
|
getTrimEnd() {
|
|
76
|
-
|
|
77
|
+
if (this.value.endsWith(" ") === true) {
|
|
78
|
+
return this.value.replace(TRIMREGEX, "");
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
return this.value;
|
|
82
|
+
}
|
|
77
83
|
}
|
|
78
84
|
getOffset(input) {
|
|
79
85
|
let offset = input === null || input === void 0 ? void 0 : input.offset;
|