Closed realazthat closed 8 months ago
FWIW the wave tool gets the right output here with -p 2
It looks like using eat_whitespace
instead of default_preprocessor_hooks
fixes the issue. I can no longer remember why these are different things or why one would produce line directives and the other not.
I think this is arguably "working as designed" so if you don't have a specific complaint I think we should close this.
Closing per above message, please reopen if you think we should pursue further.
When running wave on the following code:
It gets preprocessed into the following:
Note that the line continuations were removed, but no
#line
directive was emitted to fix the line numbers.Note,
ctx.set_language(/*language=*/enable_preserve_comments(ctx.get_language()));
option was set, to preserve the comments.Note, I have not tested if this problem occurs outside a comment, but a comment makes it more complicated, since the line directive would presumably need to be placed outside of the comment.
Minimum reproducible example: