logos icon indicating copy to clipboard operation
logos copied to clipboard

Line comments are incorrectly handled within block comments

Open MarSoft opened this issue 3 years ago • 1 comments

In current master version (a733c99) there is a bug. Here is the minimal .xm file reproducing it:

%ctor {
  // ...
}

/* Multiline comment including a // line comment */

// These lines are incorrectly ignored:

void func() {
  int a = 3;
  /* Another multiline comment; its closing sequence will be noticed */
  // The line below will cause an error
}

When fed to logos.pl, this file will cause the following error:

test.xm:13: error: fell off the face of the planet when we found a '}'

If you include a // sequence within a multiline comment (e.g. as a part of https:// URL prefix), everything until the end of line is not checked for */ sequence.

Alas I don't speak Perl and hence cannot find the actual place where the error was introduced. I can tell though that the error did not happen in commit 886885b.

MarSoft avatar Nov 26 '20 14:11 MarSoft

Performed git bisect. The bug was introduced in ed22e75.

MarSoft avatar Nov 26 '20 14:11 MarSoft

Fixed in #96

uroboro avatar Apr 09 '23 14:04 uroboro