mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 23:57:44 +00:00
AK: Remove ByteString from GenericLexer
A bunch of users used consume_specific with a constant ByteString literal, which can be replaced by an allocation-free StringView literal. The generic consume_while overload gains a requires clause so that consume_specific("abc") causes a more understandable and actionable error.
This commit is contained in:
parent
7c88ab2836
commit
eada4f2ee8
16 changed files with 89 additions and 86 deletions
|
@ -144,7 +144,7 @@ private:
|
|||
|
||||
GenericLexer lexer(string);
|
||||
while (!lexer.is_eof()) {
|
||||
if (lexer.consume_specific(m_traits.quote)) {
|
||||
if (lexer.consume_specific(m_traits.quote.view())) {
|
||||
switch (m_traits.quote_escape) {
|
||||
case WriterTraits::Repeat:
|
||||
TRY(m_output.write_until_depleted(m_traits.quote.bytes()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue