@abaplint/core 2.113.202 → 2.113.203
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.
|
@@ -6,19 +6,17 @@ const virtual_position_1 = require("../../virtual_position");
|
|
|
6
6
|
const tokens_1 = require("./tokens");
|
|
7
7
|
const lexer_buffer_1 = require("./lexer_buffer");
|
|
8
8
|
const lexer_stream_1 = require("./lexer_stream");
|
|
9
|
+
const ModeNormal = 1;
|
|
10
|
+
const ModePing = 2;
|
|
11
|
+
const ModeStr = 3;
|
|
12
|
+
const ModeTemplate = 4;
|
|
13
|
+
const ModeComment = 5;
|
|
14
|
+
const ModePragma = 6;
|
|
9
15
|
class Lexer {
|
|
10
|
-
constructor() {
|
|
11
|
-
this.ModeNormal = 1;
|
|
12
|
-
this.ModePing = 2;
|
|
13
|
-
this.ModeStr = 3;
|
|
14
|
-
this.ModeTemplate = 4;
|
|
15
|
-
this.ModeComment = 5;
|
|
16
|
-
this.ModePragma = 6;
|
|
17
|
-
}
|
|
18
16
|
run(file, virtual) {
|
|
19
17
|
this.virtual = virtual;
|
|
20
18
|
this.tokens = [];
|
|
21
|
-
this.m =
|
|
19
|
+
this.m = ModeNormal;
|
|
22
20
|
this.process(file.getRaw());
|
|
23
21
|
return { file, tokens: this.tokens };
|
|
24
22
|
}
|
|
@@ -44,13 +42,13 @@ class Lexer {
|
|
|
44
42
|
pos = new virtual_position_1.VirtualPosition(this.virtual, pos.getRow(), pos.getCol());
|
|
45
43
|
}
|
|
46
44
|
let tok = undefined;
|
|
47
|
-
if (this.m ===
|
|
45
|
+
if (this.m === ModeComment) {
|
|
48
46
|
tok = new tokens_1.Comment(pos, s);
|
|
49
47
|
}
|
|
50
|
-
else if (this.m ===
|
|
48
|
+
else if (this.m === ModePing || this.m === ModeStr) {
|
|
51
49
|
tok = new tokens_1.StringToken(pos, s);
|
|
52
50
|
}
|
|
53
|
-
else if (this.m ===
|
|
51
|
+
else if (this.m === ModeTemplate) {
|
|
54
52
|
const first = s.charAt(0);
|
|
55
53
|
const last = s.charAt(s.length - 1);
|
|
56
54
|
if (first === "|" && last === "|") {
|
|
@@ -243,35 +241,35 @@ class Lexer {
|
|
|
243
241
|
const buf = this.buffer.add(current);
|
|
244
242
|
const ahead = this.stream.nextChar();
|
|
245
243
|
const aahead = this.stream.nextNextChar();
|
|
246
|
-
if (this.m ===
|
|
244
|
+
if (this.m === ModeNormal) {
|
|
247
245
|
if (splits[ahead]) {
|
|
248
246
|
this.add();
|
|
249
247
|
}
|
|
250
248
|
else if (ahead === "'") {
|
|
251
249
|
// start string
|
|
252
250
|
this.add();
|
|
253
|
-
this.m =
|
|
251
|
+
this.m = ModeStr;
|
|
254
252
|
}
|
|
255
253
|
else if (ahead === "|" || ahead === "}") {
|
|
256
254
|
// start template
|
|
257
255
|
this.add();
|
|
258
|
-
this.m =
|
|
256
|
+
this.m = ModeTemplate;
|
|
259
257
|
}
|
|
260
258
|
else if (ahead === "`") {
|
|
261
259
|
// start ping
|
|
262
260
|
this.add();
|
|
263
|
-
this.m =
|
|
261
|
+
this.m = ModePing;
|
|
264
262
|
}
|
|
265
263
|
else if (aahead === "##") {
|
|
266
264
|
// start pragma
|
|
267
265
|
this.add();
|
|
268
|
-
this.m =
|
|
266
|
+
this.m = ModePragma;
|
|
269
267
|
}
|
|
270
268
|
else if (ahead === "\""
|
|
271
269
|
|| (ahead === "*" && current === "\n")) {
|
|
272
270
|
// start comment
|
|
273
271
|
this.add();
|
|
274
|
-
this.m =
|
|
272
|
+
this.m = ModeComment;
|
|
275
273
|
}
|
|
276
274
|
else if (ahead === "@" && buf.trim().length === 0) {
|
|
277
275
|
this.add();
|
|
@@ -292,12 +290,12 @@ class Lexer {
|
|
|
292
290
|
this.add();
|
|
293
291
|
}
|
|
294
292
|
}
|
|
295
|
-
else if (this.m ===
|
|
293
|
+
else if (this.m === ModePragma && (ahead === "," || ahead === ":" || ahead === "." || ahead === " " || ahead === "\n")) {
|
|
296
294
|
// end of pragma
|
|
297
295
|
this.add();
|
|
298
|
-
this.m =
|
|
296
|
+
this.m = ModeNormal;
|
|
299
297
|
}
|
|
300
|
-
else if (this.m ===
|
|
298
|
+
else if (this.m === ModePing
|
|
301
299
|
&& buf.length > 1
|
|
302
300
|
&& current === "`"
|
|
303
301
|
&& aahead !== "``"
|
|
@@ -306,26 +304,26 @@ class Lexer {
|
|
|
306
304
|
// end of ping
|
|
307
305
|
this.add();
|
|
308
306
|
if (ahead === `"`) {
|
|
309
|
-
this.m =
|
|
307
|
+
this.m = ModeComment;
|
|
310
308
|
}
|
|
311
309
|
else {
|
|
312
|
-
this.m =
|
|
310
|
+
this.m = ModeNormal;
|
|
313
311
|
}
|
|
314
312
|
}
|
|
315
|
-
else if (this.m ===
|
|
313
|
+
else if (this.m === ModeTemplate
|
|
316
314
|
&& buf.length > 1
|
|
317
315
|
&& (current === "|" || current === "{")
|
|
318
316
|
&& (this.stream.prevChar() !== "\\" || this.stream.prevPrevChar() === "\\\\")) {
|
|
319
317
|
// end of template
|
|
320
318
|
this.add();
|
|
321
|
-
this.m =
|
|
319
|
+
this.m = ModeNormal;
|
|
322
320
|
}
|
|
323
|
-
else if (this.m ===
|
|
321
|
+
else if (this.m === ModeTemplate
|
|
324
322
|
&& ahead === "}"
|
|
325
323
|
&& current !== "\\") {
|
|
326
324
|
this.add();
|
|
327
325
|
}
|
|
328
|
-
else if (this.m ===
|
|
326
|
+
else if (this.m === ModeStr
|
|
329
327
|
&& current === "'"
|
|
330
328
|
&& buf.length > 1
|
|
331
329
|
&& aahead !== "''"
|
|
@@ -334,17 +332,17 @@ class Lexer {
|
|
|
334
332
|
// end of string
|
|
335
333
|
this.add();
|
|
336
334
|
if (ahead === "\"") {
|
|
337
|
-
this.m =
|
|
335
|
+
this.m = ModeComment;
|
|
338
336
|
}
|
|
339
337
|
else {
|
|
340
|
-
this.m =
|
|
338
|
+
this.m = ModeNormal;
|
|
341
339
|
}
|
|
342
340
|
}
|
|
343
|
-
else if (ahead === "\n" && this.m !==
|
|
341
|
+
else if (ahead === "\n" && this.m !== ModeTemplate) {
|
|
344
342
|
this.add();
|
|
345
|
-
this.m =
|
|
343
|
+
this.m = ModeNormal;
|
|
346
344
|
}
|
|
347
|
-
else if (this.m ===
|
|
345
|
+
else if (this.m === ModeTemplate && current === "\n") {
|
|
348
346
|
this.add();
|
|
349
347
|
}
|
|
350
348
|
if (!this.stream.advance()) {
|
|
@@ -42,7 +42,7 @@ class Table extends _abstract_object_1.AbstractObject {
|
|
|
42
42
|
}
|
|
43
43
|
getAllowedNaming() {
|
|
44
44
|
let length = 30;
|
|
45
|
-
const regex = /^((\/[A-Z_\d]{3,8}\/)|[a-zA-Z0-9]{3})\w+$/;
|
|
45
|
+
const regex = /^((\/[A-Z_\d]{3,8}\/)|[a-zA-Z0-9]{3}|CI_)\w+$/;
|
|
46
46
|
if (this.getTableCategory() === TableCategory.Transparent) {
|
|
47
47
|
length = 16;
|
|
48
48
|
}
|
package/build/src/registry.js
CHANGED