@abaplint/cli 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.
Files changed (2) hide show
  1. package/build/cli.js +20 -4
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -53,6 +53,13 @@ const BUFS = new Set([
53
53
  CH_DOT, CH_COMMA, CH_COLON, 40 /* ( */, 41 /* ) */, 91 /* [ */,
54
54
  93 /* ] */, 43 /* + */, CH_AT
55
55
  ]);
56
+ // characters that may follow the closing "'", "`" or "|" of a literal, anything else
57
+ // is a syntax error, "There must be a space or equivalent character after ...",
58
+ // note that "(" is allowed, ie. text elements like 'text'(001)
59
+ const AFTER_LITERAL = new Set([
60
+ EOF, CH_SPACE, CH_TAB, CH_NL, CH_DOT, CH_COMMA, CH_COLON, CH_DQUOTE,
61
+ 40 /* ( */, 41 /* ) */, 91 /* [ */, 93 /* ] */
62
+ ]);
56
63
  class Lexer {
57
64
  run(file, virtual) {
58
65
  this.virtual = virtual;
@@ -332,7 +339,11 @@ class Lexer {
332
339
  && ahead !== CH_BACKTICK
333
340
  && this.buffer.countIsEven(CH_BACKTICK)) {
334
341
  // end of ping
335
- this.add();
342
+ if (AFTER_LITERAL.has(ahead)) {
343
+ this.add();
344
+ }
345
+ // else: no separator after the literal, keep the buffer so the following
346
+ // characters are glued onto the token, the parser will report the error
336
347
  if (ahead === CH_DQUOTE) {
337
348
  this.m = ModeComment;
338
349
  }
@@ -345,7 +356,9 @@ class Lexer {
345
356
  && (current === CH_PIPE || current === CH_LBRACE)
346
357
  && (stream.prevChar() !== CH_BACKSLASH || (stream.prevPrevChar() === CH_BACKSLASH && stream.prevChar() === CH_BACKSLASH))) {
347
358
  // end of template
348
- this.add();
359
+ if (current === CH_LBRACE || AFTER_LITERAL.has(ahead)) {
360
+ this.add();
361
+ }
349
362
  this.m = ModeNormal;
350
363
  }
351
364
  else if (this.m === ModeTemplate
@@ -360,7 +373,9 @@ class Lexer {
360
373
  && ahead !== CH_QUOTE
361
374
  && this.buffer.countIsEven(CH_QUOTE)) {
362
375
  // end of string
363
- this.add();
376
+ if (AFTER_LITERAL.has(ahead)) {
377
+ this.add();
378
+ }
364
379
  if (ahead === CH_DQUOTE) {
365
380
  this.m = ModeComment;
366
381
  }
@@ -34725,6 +34740,7 @@ class Source {
34725
34740
  return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
34726
34741
  }
34727
34742
  this.addIfInferred(node, input, foundType);
34743
+ this.traverseRemainingChildren(children, input);
34728
34744
  return foundType;
34729
34745
  }
34730
34746
  case "REF":
@@ -70563,7 +70579,7 @@ class Registry {
70563
70579
  }
70564
70580
  static abaplintVersion() {
70565
70581
  // magic, see build script "version.js"
70566
- return "2.120.51";
70582
+ return "2.120.52";
70567
70583
  }
70568
70584
  getDDICReferences() {
70569
70585
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.120.51",
3
+ "version": "2.120.52",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "homepage": "https://abaplint.org",
41
41
  "devDependencies": {
42
- "@abaplint/core": "^2.120.51",
42
+ "@abaplint/core": "^2.120.52",
43
43
  "@types/chai": "^4.3.20",
44
44
  "@types/minimist": "^1.2.5",
45
45
  "@types/mocha": "^10.0.10",