@abaplint/core 2.120.51 → 2.120.52
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.
|
@@ -43,6 +43,13 @@ const BUFS = new Set([
|
|
|
43
43
|
CH_DOT, CH_COMMA, CH_COLON, 40 /* ( */, 41 /* ) */, 91 /* [ */,
|
|
44
44
|
93 /* ] */, 43 /* + */, CH_AT
|
|
45
45
|
]);
|
|
46
|
+
// characters that may follow the closing "'", "`" or "|" of a literal, anything else
|
|
47
|
+
// is a syntax error, "There must be a space or equivalent character after ...",
|
|
48
|
+
// note that "(" is allowed, ie. text elements like 'text'(001)
|
|
49
|
+
const AFTER_LITERAL = new Set([
|
|
50
|
+
EOF, CH_SPACE, CH_TAB, CH_NL, CH_DOT, CH_COMMA, CH_COLON, CH_DQUOTE,
|
|
51
|
+
40 /* ( */, 41 /* ) */, 91 /* [ */, 93 /* ] */
|
|
52
|
+
]);
|
|
46
53
|
class Lexer {
|
|
47
54
|
run(file, virtual) {
|
|
48
55
|
this.virtual = virtual;
|
|
@@ -322,7 +329,11 @@ class Lexer {
|
|
|
322
329
|
&& ahead !== CH_BACKTICK
|
|
323
330
|
&& this.buffer.countIsEven(CH_BACKTICK)) {
|
|
324
331
|
// end of ping
|
|
325
|
-
|
|
332
|
+
if (AFTER_LITERAL.has(ahead)) {
|
|
333
|
+
this.add();
|
|
334
|
+
}
|
|
335
|
+
// else: no separator after the literal, keep the buffer so the following
|
|
336
|
+
// characters are glued onto the token, the parser will report the error
|
|
326
337
|
if (ahead === CH_DQUOTE) {
|
|
327
338
|
this.m = ModeComment;
|
|
328
339
|
}
|
|
@@ -335,7 +346,9 @@ class Lexer {
|
|
|
335
346
|
&& (current === CH_PIPE || current === CH_LBRACE)
|
|
336
347
|
&& (stream.prevChar() !== CH_BACKSLASH || (stream.prevPrevChar() === CH_BACKSLASH && stream.prevChar() === CH_BACKSLASH))) {
|
|
337
348
|
// end of template
|
|
338
|
-
|
|
349
|
+
if (current === CH_LBRACE || AFTER_LITERAL.has(ahead)) {
|
|
350
|
+
this.add();
|
|
351
|
+
}
|
|
339
352
|
this.m = ModeNormal;
|
|
340
353
|
}
|
|
341
354
|
else if (this.m === ModeTemplate
|
|
@@ -350,7 +363,9 @@ class Lexer {
|
|
|
350
363
|
&& ahead !== CH_QUOTE
|
|
351
364
|
&& this.buffer.countIsEven(CH_QUOTE)) {
|
|
352
365
|
// end of string
|
|
353
|
-
|
|
366
|
+
if (AFTER_LITERAL.has(ahead)) {
|
|
367
|
+
this.add();
|
|
368
|
+
}
|
|
354
369
|
if (ahead === CH_DQUOTE) {
|
|
355
370
|
this.m = ModeComment;
|
|
356
371
|
}
|
package/build/src/registry.js
CHANGED