C++: Handle multi-line if/elif directives

Task-number: QTCREATORBUG-5843

Change-Id: Ie32ed9daadf70f3b972a96fb53edcde9b1debb6c
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
This commit is contained in:
Leandro Melo
2011-10-31 10:55:06 +01:00
committed by Leandro T. C. Melo
parent 494fbdb0d2
commit 19b1a06ec8

View File

@@ -180,6 +180,17 @@ const char *MacroExpander::expand(const char *__first, const char *__last,
__result->append(__first, next_pos - __first);
__first = next_pos;
}
else if (*__first == '\\')
{
++__first;
if (__first != __last && *__first == '\n')
{
++lines;
++__first;
} else {
__result->append('\\');
}
}
else if (comment_p (__first, __last))
{
__first = skip_comment_or_divop (__first, __last);