@abaplint/core 2.93.98 → 2.93.99
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.
|
@@ -61,21 +61,36 @@ class Stream {
|
|
|
61
61
|
return this.row;
|
|
62
62
|
}
|
|
63
63
|
prevChar() {
|
|
64
|
+
if (this.offset - 1 < 0) {
|
|
65
|
+
return "";
|
|
66
|
+
}
|
|
64
67
|
return this.raw.substr(this.offset - 1, 1);
|
|
65
68
|
}
|
|
66
69
|
prevPrevChar() {
|
|
70
|
+
if (this.offset - 2 < 0) {
|
|
71
|
+
return "";
|
|
72
|
+
}
|
|
67
73
|
return this.raw.substr(this.offset - 2, 2);
|
|
68
74
|
}
|
|
69
75
|
currentChar() {
|
|
70
76
|
if (this.offset < 0) {
|
|
71
77
|
return "\n"; // simulate newline at start of file to handle star(*) comments
|
|
72
78
|
}
|
|
79
|
+
else if (this.offset >= this.raw.length) {
|
|
80
|
+
return "";
|
|
81
|
+
}
|
|
73
82
|
return this.raw.substr(this.offset, 1);
|
|
74
83
|
}
|
|
75
84
|
nextChar() {
|
|
85
|
+
if (this.offset + 2 > this.raw.length) {
|
|
86
|
+
return "";
|
|
87
|
+
}
|
|
76
88
|
return this.raw.substr(this.offset + 1, 1);
|
|
77
89
|
}
|
|
78
90
|
nextNextChar() {
|
|
91
|
+
if (this.offset + 3 > this.raw.length) {
|
|
92
|
+
return this.nextChar();
|
|
93
|
+
}
|
|
79
94
|
return this.raw.substr(this.offset + 1, 2);
|
|
80
95
|
}
|
|
81
96
|
getRaw() {
|
|
@@ -99,9 +114,11 @@ class Lexer {
|
|
|
99
114
|
const col = this.stream.getCol();
|
|
100
115
|
const row = this.stream.getRow();
|
|
101
116
|
let whiteBefore = false;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
117
|
+
if (this.stream.getOffset() - s.length >= 0) {
|
|
118
|
+
const prev = this.stream.getRaw().substr(this.stream.getOffset() - s.length, 1);
|
|
119
|
+
if (prev === " " || prev === "\n" || prev === "\t" || prev === ":") {
|
|
120
|
+
whiteBefore = true;
|
|
121
|
+
}
|
|
105
122
|
}
|
|
106
123
|
let whiteAfter = false;
|
|
107
124
|
const next = this.stream.nextChar();
|
|
@@ -138,7 +155,7 @@ class Lexer {
|
|
|
138
155
|
tok = new tokens_1.Identifier(pos, s);
|
|
139
156
|
}
|
|
140
157
|
}
|
|
141
|
-
else if (s.substr(0, 2) === "##") {
|
|
158
|
+
else if (s.length > 2 && s.substr(0, 2) === "##") {
|
|
142
159
|
tok = new tokens_1.Pragma(pos, s);
|
|
143
160
|
}
|
|
144
161
|
else if (s.length === 1) {
|
|
@@ -10,7 +10,7 @@ class Compare extends combi_1.Expression {
|
|
|
10
10
|
const val = (0, combi_1.altPrio)(_1.FieldSub, _1.Constant);
|
|
11
11
|
const list = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeft), val, (0, combi_1.plus)((0, combi_1.seq)(",", val)), (0, combi_1.tok)(tokens_1.ParenRightW));
|
|
12
12
|
const inn = (0, combi_1.seq)((0, combi_1.optPrio)("NOT"), "IN", (0, combi_1.altPrio)(_1.Source, list));
|
|
13
|
-
const sopt = (0, combi_1.seq)("IS", (0, combi_1.optPrio)("NOT"), (0, combi_1.altPrio)("SUPPLIED", "BOUND", (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("INSTANCE OF", _1.ClassName)), "REQUESTED", "INITIAL"));
|
|
13
|
+
const sopt = (0, combi_1.seq)("IS", (0, combi_1.optPrio)("NOT"), (0, combi_1.altPrio)("SUPPLIED", "BOUND", (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("INSTANCE OF", _1.ClassName), version_1.Version.OpenABAP), "REQUESTED", "INITIAL"));
|
|
14
14
|
const between = (0, combi_1.seq)((0, combi_1.optPrio)("NOT"), "BETWEEN", _1.Source, "AND", _1.Source);
|
|
15
15
|
const predicate = (0, combi_1.ver)(version_1.Version.v740sp08, _1.MethodCallChain);
|
|
16
16
|
const rett = (0, combi_1.seq)(_1.Source, (0, combi_1.altPrio)((0, combi_1.seq)(_1.CompareOperator, _1.Source), inn, between, sopt));
|
package/build/src/registry.js
CHANGED