@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
- this.add();
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
- this.add();
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
- this.add();
366
+ if (AFTER_LITERAL.has(ahead)) {
367
+ this.add();
368
+ }
354
369
  if (ahead === CH_DQUOTE) {
355
370
  this.m = ModeComment;
356
371
  }
@@ -163,6 +163,7 @@ class Source {
163
163
  return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
164
164
  }
165
165
  this.addIfInferred(node, input, foundType);
166
+ this.traverseRemainingChildren(children, input);
166
167
  return foundType;
167
168
  }
168
169
  case "REF":
@@ -75,7 +75,7 @@ class Registry {
75
75
  }
76
76
  static abaplintVersion() {
77
77
  // magic, see build script "version.js"
78
- return "2.120.51";
78
+ return "2.120.52";
79
79
  }
80
80
  getDDICReferences() {
81
81
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.120.51",
3
+ "version": "2.120.52",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",