mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-24 02:03:06 -05:00
LibWeb: Change HTMLTokenizer.{cpp,h} to east const style
This commit is contained in:
parent
300823c314
commit
125982943a
Notes:
sideshowbarker
2024-07-18 09:01:30 +09:00
Author: https://github.com/MaxWipfli Commit: https://github.com/SerenityOS/serenity/commit/125982943af Pull-request: https://github.com/SerenityOS/serenity/pull/8687 Reviewed-by: https://github.com/alimpfard
2 changed files with 8 additions and 8 deletions
|
@ -175,7 +175,7 @@ namespace Web::HTML {
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void log_parse_error(const SourceLocation& location = SourceLocation::current())
|
static inline void log_parse_error(SourceLocation const& location = SourceLocation::current())
|
||||||
{
|
{
|
||||||
dbgln_if(TOKENIZER_TRACE_DEBUG, "Parse error (tokenization) {}", location);
|
dbgln_if(TOKENIZER_TRACE_DEBUG, "Parse error (tokenization) {}", location);
|
||||||
}
|
}
|
||||||
|
@ -2618,7 +2618,7 @@ _StartOfFunction:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HTMLTokenizer::consume_next_if_match(const StringView& string, CaseSensitivity case_sensitivity)
|
bool HTMLTokenizer::consume_next_if_match(StringView const& string, CaseSensitivity case_sensitivity)
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < string.length(); ++i) {
|
for (size_t i = 0; i < string.length(); ++i) {
|
||||||
auto code_point = peek_code_point(i);
|
auto code_point = peek_code_point(i);
|
||||||
|
@ -2658,7 +2658,7 @@ void HTMLTokenizer::create_new_token(HTMLToken::Type type)
|
||||||
m_current_token.m_start_position = nth_last_position(offset);
|
m_current_token.m_start_position = nth_last_position(offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
HTMLTokenizer::HTMLTokenizer(const StringView& input, const String& encoding)
|
HTMLTokenizer::HTMLTokenizer(StringView const& input, String const& encoding)
|
||||||
{
|
{
|
||||||
auto* decoder = TextCodec::decoder_for(encoding);
|
auto* decoder = TextCodec::decoder_for(encoding);
|
||||||
VERIFY(decoder);
|
VERIFY(decoder);
|
||||||
|
@ -2704,7 +2704,7 @@ bool HTMLTokenizer::consumed_as_part_of_an_attribute() const
|
||||||
return m_return_state == State::AttributeValueUnquoted || m_return_state == State::AttributeValueSingleQuoted || m_return_state == State::AttributeValueDoubleQuoted;
|
return m_return_state == State::AttributeValueUnquoted || m_return_state == State::AttributeValueSingleQuoted || m_return_state == State::AttributeValueDoubleQuoted;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HTMLTokenizer::restore_to(const Utf8CodePointIterator& new_iterator)
|
void HTMLTokenizer::restore_to(Utf8CodePointIterator const& new_iterator)
|
||||||
{
|
{
|
||||||
if (new_iterator != m_prev_utf8_iterator) {
|
if (new_iterator != m_prev_utf8_iterator) {
|
||||||
auto diff = m_prev_utf8_iterator - new_iterator;
|
auto diff = m_prev_utf8_iterator - new_iterator;
|
||||||
|
|
|
@ -100,7 +100,7 @@ namespace Web::HTML {
|
||||||
|
|
||||||
class HTMLTokenizer {
|
class HTMLTokenizer {
|
||||||
public:
|
public:
|
||||||
explicit HTMLTokenizer(const StringView& input, const String& encoding);
|
explicit HTMLTokenizer(StringView const& input, String const& encoding);
|
||||||
|
|
||||||
enum class State {
|
enum class State {
|
||||||
#define __ENUMERATE_TOKENIZER_STATE(state) state,
|
#define __ENUMERATE_TOKENIZER_STATE(state) state,
|
||||||
|
@ -125,12 +125,12 @@ private:
|
||||||
void skip(size_t count);
|
void skip(size_t count);
|
||||||
Optional<u32> next_code_point();
|
Optional<u32> next_code_point();
|
||||||
Optional<u32> peek_code_point(size_t offset) const;
|
Optional<u32> peek_code_point(size_t offset) const;
|
||||||
bool consume_next_if_match(const StringView&, CaseSensitivity = CaseSensitivity::CaseSensitive);
|
bool consume_next_if_match(StringView const&, CaseSensitivity = CaseSensitivity::CaseSensitive);
|
||||||
void create_new_token(HTMLToken::Type);
|
void create_new_token(HTMLToken::Type);
|
||||||
bool current_end_tag_token_is_appropriate() const;
|
bool current_end_tag_token_is_appropriate() const;
|
||||||
String consume_current_builder();
|
String consume_current_builder();
|
||||||
|
|
||||||
static const char* state_name(State state)
|
static char const* state_name(State state)
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (state) {
|
||||||
#define __ENUMERATE_TOKENIZER_STATE(state) \
|
#define __ENUMERATE_TOKENIZER_STATE(state) \
|
||||||
|
@ -148,7 +148,7 @@ private:
|
||||||
|
|
||||||
bool consumed_as_part_of_an_attribute() const;
|
bool consumed_as_part_of_an_attribute() const;
|
||||||
|
|
||||||
void restore_to(const Utf8CodePointIterator& new_iterator);
|
void restore_to(Utf8CodePointIterator const& new_iterator);
|
||||||
HTMLToken::Position nth_last_position(size_t n = 0);
|
HTMLToken::Position nth_last_position(size_t n = 0);
|
||||||
|
|
||||||
State m_state { State::Data };
|
State m_state { State::Data };
|
||||||
|
|
Loading…
Add table
Reference in a new issue