1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 08:54:58 +00:00

AK: Exclude GenericLexer String APIs from the Kernel

These APIs are only used by userland, and String is OOM-infallible,
so let's just ifdef it out of the Kernel.
This commit is contained in:
Idan Horowitz 2022-02-15 23:32:59 +02:00 committed by Andreas Kling
parent 410183a7b0
commit b22cb40565
2 changed files with 15 additions and 2 deletions

View file

@ -7,9 +7,12 @@
#include <AK/Assertions.h>
#include <AK/CharacterTypes.h>
#include <AK/GenericLexer.h>
#include <AK/String.h>
#include <AK/StringBuilder.h>
#include <AK/Utf16View.h>
#ifndef KERNEL
# include <AK/String.h>
# include <AK/Utf16View.h>
#endif
namespace AK {
// Consume a number of characters
@ -125,6 +128,7 @@ StringView GenericLexer::consume_quoted_string(char escape_char)
return m_input.substring_view(start, length);
}
#ifndef KERNEL
String GenericLexer::consume_and_unescape_string(char escape_char)
{
auto view = consume_quoted_string(escape_char);
@ -206,5 +210,6 @@ auto GenericLexer::decode_single_or_paired_surrogate(bool combine_surrogate_pair
retreat(6);
return *high_surrogate;
}
#endif
}