[Issue 23883] `#line` is off by one and off by two if a line comment follows

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri May 5 09:01:11 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=23883

RazvanN <razvan.nitu1305 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |razvan.nitu1305 at gmail.com

--- Comment #1 from RazvanN <razvan.nitu1305 at gmail.com> ---
The #line directive needs to be terminated by a newline or EOF. In your example
the newline is commented, therefore whatever comes next after the comment on
the exact following line has to be a newline or EOF so that the directive is
correctly lexed.

I think that the best way to proceed here is to add a spec mention about this
as fixing will add unnecessary complexity (checking for comments before the
directive ends) to support an unlikely corner case.

--


More information about the Digitalmars-d-bugs mailing list