This is a minor bug: the lexer misses the fact that after a single line comment, we are at the beginning of a line. Therefore # directives are missed after a single line comment.
One could argue that a proper preprocessor would have removed comments, and therefore either you have comments or you have line directives... But the lexer already tries to handle some of these situations, so this is a "best effort" attempt.
Here is a sample file that fails with "Lexer error" without the patch:
This is a minor bug: the lexer misses the fact that after a single line comment, we are at the beginning of a line. Therefore
#
directives are missed after a single line comment.One could argue that a proper preprocessor would have removed comments, and therefore either you have comments or you have line directives... But the lexer already tries to handle some of these situations, so this is a "best effort" attempt.
Here is a sample file that fails with "Lexer error" without the patch: