mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-18 13:44:50 +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:
committed by
Andrew Kaster
parent
7c88ab2836
commit
eada4f2ee8
@@ -28,7 +28,7 @@ static void consume_whitespace(GenericLexer& lexer)
|
||||
while (consumed) {
|
||||
consumed = lexer.consume_while(is_ascii_space).length() > 0;
|
||||
|
||||
if (lexer.consume_specific("//")) {
|
||||
if (lexer.consume_specific("//"sv)) {
|
||||
lexer.consume_until('\n');
|
||||
lexer.ignore();
|
||||
consumed = true;
|
||||
|
||||
Reference in New Issue
Block a user