@@ -55,14 +55,14 @@ template <url_pattern_regex::regex_concept regex_provider>
55
55
bool constructor_string_parser<regex_provider>::is_hash_prefix() {
56
56
// Return the result of running is a non-special pattern char given parser,
57
57
// parser’s token index and "#".
58
- return is_non_special_pattern_char (token_index, " # " );
58
+ return is_non_special_pattern_char (token_index, ' # ' );
59
59
}
60
60
61
61
template <url_pattern_regex::regex_concept regex_provider>
62
62
bool constructor_string_parser<regex_provider>::is_search_prefix() {
63
63
// If result of running is a non-special pattern char given parser, parser’s
64
64
// token index and "?" is true, then return true.
65
- if (is_non_special_pattern_char (token_index, " ? " )) {
65
+ if (is_non_special_pattern_char (token_index, ' ? ' )) {
66
66
return true ;
67
67
}
68
68
@@ -93,13 +93,15 @@ bool constructor_string_parser<regex_provider>::is_search_prefix() {
93
93
94
94
template <url_pattern_regex::regex_concept regex_provider>
95
95
bool constructor_string_parser<regex_provider>::is_non_special_pattern_char(
96
- size_t index, std::string_view value) const {
96
+ size_t index, uint32_t value) const {
97
97
// Let token be the result of running get a safe token given parser and index.
98
98
auto token = get_safe_token (index );
99
99
ADA_ASSERT_TRUE (token);
100
100
101
101
// If token’s value is not value, then return false.
102
- if (token->value != value) {
102
+ // TODO: Remove this once we make sure get_safe_token returns a non-empty
103
+ // string.
104
+ if (!token->value .empty () && token->value [0 ] != value) {
103
105
return false ;
104
106
}
105
107
@@ -152,12 +154,12 @@ bool constructor_string_parser<regex_provider>::next_is_authority_slashes()
152
154
const {
153
155
// If the result of running is a non-special pattern char given parser,
154
156
// parser’s token index + 1, and "/" is false, then return false.
155
- if (!is_non_special_pattern_char (token_index + 1 , " / " )) {
157
+ if (!is_non_special_pattern_char (token_index + 1 , ' / ' )) {
156
158
return false ;
157
159
}
158
160
// If the result of running is a non-special pattern char given parser,
159
161
// parser’s token index + 2, and "/" is false, then return false.
160
- if (!is_non_special_pattern_char (token_index + 2 , " / " )) {
162
+ if (!is_non_special_pattern_char (token_index + 2 , ' / ' )) {
161
163
return false ;
162
164
}
163
165
return true ;
@@ -167,7 +169,7 @@ template <url_pattern_regex::regex_concept regex_provider>
167
169
bool constructor_string_parser<regex_provider>::is_protocol_suffix() const {
168
170
// Return the result of running is a non-special pattern char given parser,
169
171
// parser’s token index, and ":".
170
- return is_non_special_pattern_char (token_index, " : " );
172
+ return is_non_special_pattern_char (token_index, ' : ' );
171
173
}
172
174
173
175
template <url_pattern_regex::regex_concept regex_provider>
@@ -295,42 +297,42 @@ bool constructor_string_parser<regex_provider>::is_an_identity_terminator()
295
297
const {
296
298
// Return the result of running is a non-special pattern char given parser,
297
299
// parser’s token index, and "@".
298
- return is_non_special_pattern_char (token_index, " @ " );
300
+ return is_non_special_pattern_char (token_index, ' @ ' );
299
301
}
300
302
301
303
template <url_pattern_regex::regex_concept regex_provider>
302
304
bool constructor_string_parser<regex_provider>::is_pathname_start() const {
303
305
// Return the result of running is a non-special pattern char given parser,
304
306
// parser’s token index, and "/".
305
- return is_non_special_pattern_char (token_index, " / " );
307
+ return is_non_special_pattern_char (token_index, ' / ' );
306
308
}
307
309
308
310
template <url_pattern_regex::regex_concept regex_provider>
309
311
bool constructor_string_parser<regex_provider>::is_password_prefix() const {
310
312
// Return the result of running is a non-special pattern char given parser,
311
313
// parser’s token index, and ":".
312
- return is_non_special_pattern_char (token_index, " : " );
314
+ return is_non_special_pattern_char (token_index, ' : ' );
313
315
}
314
316
315
317
template <url_pattern_regex::regex_concept regex_provider>
316
318
bool constructor_string_parser<regex_provider>::is_an_ipv6_open() const {
317
319
// Return the result of running is a non-special pattern char given parser,
318
320
// parser’s token index, and "[".
319
- return is_non_special_pattern_char (token_index, " [ " );
321
+ return is_non_special_pattern_char (token_index, ' [ ' );
320
322
}
321
323
322
324
template <url_pattern_regex::regex_concept regex_provider>
323
325
bool constructor_string_parser<regex_provider>::is_an_ipv6_close() const {
324
326
// Return the result of running is a non-special pattern char given parser,
325
327
// parser’s token index, and "]".
326
- return is_non_special_pattern_char (token_index, " ] " );
328
+ return is_non_special_pattern_char (token_index, ' ] ' );
327
329
}
328
330
329
331
template <url_pattern_regex::regex_concept regex_provider>
330
332
bool constructor_string_parser<regex_provider>::is_port_prefix() const {
331
333
// Return the result of running is a non-special pattern char given parser,
332
334
// parser’s token index, and ":".
333
- return is_non_special_pattern_char (token_index, " : " );
335
+ return is_non_special_pattern_char (token_index, ' : ' );
334
336
}
335
337
336
338
inline void Tokenizer::get_next_code_point () {
0 commit comments