1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:27:45 +00:00

LibCpp: Add preprocessor option to ignore unsupported keywords

Under some circumstances we need to ignore unsupported preprocessor
keywords instead of crashing the processing, for example during live
parsing in HackStudio.
This commit is contained in:
Vyacheslav Pukhanov 2021-03-17 21:18:08 +03:00 committed by Andreas Kling
parent 711a47b784
commit 0b5d414eba
2 changed files with 11 additions and 2 deletions

View file

@ -184,8 +184,11 @@ void Preprocessor::handle_preprocessor_line(const StringView& line)
lexer.consume_all();
return;
}
dbgln("Unsupported preprocessor keyword: {}", keyword);
VERIFY_NOT_REACHED();
if (!m_options.ignore_unsupported_keywords) {
dbgln("Unsupported preprocessor keyword: {}", keyword);
VERIFY_NOT_REACHED();
}
}
const String& Preprocessor::processed_text()