Browse Source

LibCpp: Ignore the #error preprocessor directive

Ali Mohammad Pur 2 years ago
parent
commit
12a900b97c
1 changed files with 4 additions and 0 deletions
  1. 4 0
      Userland/Libraries/LibCpp/Preprocessor.cpp

+ 4 - 0
Userland/Libraries/LibCpp/Preprocessor.cpp

@@ -230,6 +230,10 @@ void Preprocessor::handle_preprocessor_keyword(StringView keyword, GenericLexer&
         line_lexer.consume_all();
         line_lexer.consume_all();
         return;
         return;
     }
     }
+    if (keyword == "error") {
+        line_lexer.consume_all();
+        return;
+    }
 
 
     if (!m_options.ignore_unsupported_keywords) {
     if (!m_options.ignore_unsupported_keywords) {
         dbgln("Unsupported preprocessor keyword: {}", keyword);
         dbgln("Unsupported preprocessor keyword: {}", keyword);