Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Dec 12, 2024
1 parent 8618f04 commit 380d57e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions include/ada/url_pattern-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ inline std::string_view constructor_string_parser::make_component_string() {
const auto end_index = token.index;
// Return the code point substring from component start input index to end
// index within parser’s input.
return input.substr(component_start_input_index, end_index);
return std::string_view(input).substr(component_start_input_index, end_index);
}

inline bool constructor_string_parser::is_an_identity_terminator() {
Expand Down Expand Up @@ -360,9 +360,9 @@ inline void Tokenizer::get_next_code_point() {
next_index++;
}

inline void Tokenizer::seek_and_get_next_code_point(size_t index) {
inline void Tokenizer::seek_and_get_next_code_point(size_t new_index) {
// Set tokenizer’s next index to index.
next_index = index;
next_index = new_index;
// Run get the next code point given tokenizer.
get_next_code_point();
}
Expand Down Expand Up @@ -405,13 +405,13 @@ Tokenizer::process_tokenizing_error(size_t next_position,
}

// @see https://urlpattern.spec.whatwg.org/#is-a-valid-name-code-point
inline bool Tokenizer::is_valid_name_code_point(char code_point, bool first) {
inline bool Tokenizer::is_valid_name_code_point(char cp, bool first) {
// If first is true return the result of checking if code point is contained
// in the IdentifierStart set of code points. Otherwise return the result of
// checking if code point is contained in the IdentifierPart set of code
// points.
// TODO: Implement this
(void)code_point;
(void)cp;
(void)first;
return true;
}
Expand Down
8 changes: 4 additions & 4 deletions include/ada/url_pattern.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ struct url_pattern_part {
struct url_pattern_compile_component_options {
url_pattern_compile_component_options() = default;
explicit url_pattern_compile_component_options(
std::optional<char> delimiter = std::nullopt,
std::optional<char> prefix = std::nullopt)
: delimiter(delimiter), prefix(prefix){};
std::optional<char> new_delimiter = std::nullopt,
std::optional<char> new_prefix = std::nullopt)
: delimiter(new_delimiter), prefix(new_prefix){};

// @see https://urlpattern.spec.whatwg.org/#options-delimiter-code-point
std::optional<char> delimiter{};
Expand Down Expand Up @@ -338,7 +338,7 @@ struct Token {

// @see https://urlpattern.spec.whatwg.org/#tokenizer
class Tokenizer {
public:
public:
explicit Tokenizer(std::string_view input, token_policy policy)
: input(input), policy(policy) {}

Expand Down

0 comments on commit 380d57e

Please sign in to comment.