Skip to content

Commit

Permalink
LibWeb: Change HTMLTokenizer.{cpp,h} to east const style
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxWipfli authored and awesomekling committed Jul 14, 2021
1 parent 300823c commit 1259829
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -2618,7 +2618,7 @@ Optional<HTMLToken> HTMLTokenizer::next_token()
}
}

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) {
auto code_point = peek_code_point(i);
Expand Down Expand Up @@ -2658,7 +2658,7 @@ void HTMLTokenizer::create_new_token(HTMLToken::Type type)
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);
VERIFY(decoder);
Expand Down Expand Up @@ -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;
}

void HTMLTokenizer::restore_to(const Utf8CodePointIterator& new_iterator)
void HTMLTokenizer::restore_to(Utf8CodePointIterator const& new_iterator)
{
if (new_iterator != m_prev_utf8_iterator) {
auto diff = m_prev_utf8_iterator - new_iterator;
Expand Down
8 changes: 4 additions & 4 deletions Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ namespace Web::HTML {

class HTMLTokenizer {
public:
explicit HTMLTokenizer(const StringView& input, const String& encoding);
explicit HTMLTokenizer(StringView const& input, String const& encoding);

enum class State {
#define __ENUMERATE_TOKENIZER_STATE(state) state,
Expand All @@ -125,12 +125,12 @@ class HTMLTokenizer {
void skip(size_t count);
Optional<u32> next_code_point();
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);
bool current_end_tag_token_is_appropriate() const;
String consume_current_builder();

static const char* state_name(State state)
static char const* state_name(State state)
{
switch (state) {
#define __ENUMERATE_TOKENIZER_STATE(state) \
Expand All @@ -148,7 +148,7 @@ class HTMLTokenizer {

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);

State m_state { State::Data };
Expand Down

0 comments on commit 1259829

Please sign in to comment.