#if
#else
is not supported.
From the source code of parserthrerad.cpp
void ParserThread::HandlePreprocessorBlocks(const wxString& preproc)
{
if (preproc.StartsWith(ParserConsts::kw_if)) // #if, #ifdef, #ifndef
{
wxString token = preproc;
++m_PreprocessorIfCount;
token = m_Tokenizer.GetToken();
if (token.IsSameAs(_T("0")))
{
// TODO: handle special case "#if 0"
TRACE(_T("HandlePreprocessorBlocks() : Special case \"#if 0\" not skipped."));
}
m_Tokenizer.SkipToEOL();
}
else if (preproc==ParserConsts::kw_else || preproc==ParserConsts::kw_elif) // #else, #elif
{
TRACE(_T("HandlePreprocessorBlocks() : Saving nesting level: %d"), m_Tokenizer.GetNestingLevel());
m_Tokenizer.SaveNestingLevel();
wxString token = preproc;
while (!token.IsEmpty() && token != ParserConsts::kw_endif)
token = m_Tokenizer.GetToken();
--m_PreprocessorIfCount;
#if PARSERTHREAD_DEBUG_OUTPUT
int l = m_Tokenizer.GetNestingLevel();
#endif
m_Tokenizer.RestoreNestingLevel();
TRACE(_T("HandlePreprocessorBlocks() : Restoring nesting level: %d (was %d)"), m_Tokenizer.GetNestingLevel(), l);
}
else if (preproc==ParserConsts::kw_endif) // #endif
--m_PreprocessorIfCount;
}
only #if is treated, and #else is omitted.