mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 18:19:03 +00:00
LibWeb: Allow creating a TokenStream from a single token
This is quite niche, but lets us convert parsing methods to accepting TokenStream, while still being able to call them when we just have a lone token. Specifically we'll use this in the next commit, but it's likely to also be useful as a stop-gap measure when converting more parsing methods.
This commit is contained in:
parent
2f5379bc9b
commit
a76f29e56b
Notes:
sideshowbarker
2024-07-18 08:59:31 +09:00
Author: https://github.com/AtkinsSJ
Commit: a76f29e56b
Pull-request: https://github.com/SerenityOS/serenity/pull/22476
Reviewed-by: https://github.com/Lubrsi
1 changed files with 5 additions and 0 deletions
|
@ -66,6 +66,11 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
static TokenStream<T> of_single_token(T const& token)
|
||||
{
|
||||
return TokenStream(Span<T const> { &token, 1 });
|
||||
}
|
||||
|
||||
TokenStream(TokenStream<T> const&) = delete;
|
||||
TokenStream(TokenStream<T>&&) = default;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue