diff options
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibCpp/Preprocessor.cpp | 13 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/MimeSniff/MimeType.cpp | 5 |
2 files changed, 9 insertions, 9 deletions
diff --git a/Userland/Libraries/LibCpp/Preprocessor.cpp b/Userland/Libraries/LibCpp/Preprocessor.cpp index a5b3815e56..128b215b15 100644 --- a/Userland/Libraries/LibCpp/Preprocessor.cpp +++ b/Userland/Libraries/LibCpp/Preprocessor.cpp @@ -72,21 +72,24 @@ static void consume_whitespace(GenericLexer& lexer) lexer.ignore(2); } else { lexer.ignore_until('\n'); + lexer.ignore(); break; } } }; for (;;) { - if (lexer.consume_specific("//"sv)) + if (lexer.consume_specific("//"sv)) { ignore_line(); - else if (lexer.consume_specific("/*"sv)) + } else if (lexer.consume_specific("/*"sv)) { lexer.ignore_until("*/"); - else if (lexer.next_is("\\\n"sv)) lexer.ignore(2); - else if (lexer.is_eof() || !lexer.next_is(isspace)) + } else if (lexer.next_is("\\\n"sv)) { + lexer.ignore(2); + } else if (lexer.is_eof() || !lexer.next_is(isspace)) { break; - else + } else { lexer.ignore(); + } } } diff --git a/Userland/Libraries/LibWeb/MimeSniff/MimeType.cpp b/Userland/Libraries/LibWeb/MimeSniff/MimeType.cpp index b138a6e412..3b4a3ae1ca 100644 --- a/Userland/Libraries/LibWeb/MimeSniff/MimeType.cpp +++ b/Userland/Libraries/LibWeb/MimeSniff/MimeType.cpp @@ -139,10 +139,7 @@ Optional<MimeType> MimeType::from_string(StringView string) parameter_value = Fetch::Infrastructure::collect_an_http_quoted_string(lexer, Fetch::Infrastructure::HttpQuotedStringExtractValue::Yes); // 2. Collect a sequence of code points that are not U+003B (;) from input, given position. - // NOTE: This uses the predicate version as the ignore_until(char) version will also ignore the ';'. - lexer.ignore_until([](char ch) { - return ch == ';'; - }); + lexer.ignore_until(';'); } // 9. Otherwise: |