Skip to content

Commit ecf1e43

Browse files
committed
Fix a problem with character after comment always added to macro definition
This was especially problematic if the line ended with the comment, since then the next line would be added, too, even though the current one didn't end with a '\'
1 parent 4545da5 commit ecf1e43

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

generator/parser/rpp/pp-engine-bits.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,8 +621,13 @@ InputIterator pp::handle_define (InputIterator _first, InputIterator _last)
621621
while (_first != _last && *_first != '\n')
622622
{
623623
if (*_first == '/') {
624+
const InputIterator _before = _first;
624625
_first = skip_comment(_first, _last);
625626
env.current_line += skip_comment.lines;
627+
if (_first != _before) {
628+
// do not indiscriminately add the character after comment
629+
continue;
630+
}
626631
}
627632

628633
if (*_first == '\\')

0 commit comments

Comments
 (0)