Skip to content

Commit fa7a2a5

Browse files
committed
Switch identifier crate from unic-ucd-ident to unicode-id-start
1 parent 2ba16e7 commit fa7a2a5

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ license = "MIT"
1111
url = "2.4.1"
1212
regex = "1.10.5"
1313
serde = { version = "1.0.127", features = ["derive"] }
14-
unic-ucd-ident = { version = "0.9.0", features = ["id"] }
14+
unicode-id-start = "1.0"
1515

1616
[dev-dependencies]
1717
serde_json = "1.0.66"

src/lib.rs

+13
Original file line numberDiff line numberDiff line change
@@ -1047,4 +1047,17 @@ mod tests {
10471047
.unwrap();
10481048
assert!(pattern.has_regexp_groups());
10491049
}
1050+
1051+
#[test]
1052+
fn unicode_middle_dot() {
1053+
let pattern = <UrlPattern>::parse(
1054+
UrlPatternInit {
1055+
pathname: Some("/:a\u{30FB}b.".to_owned()),
1056+
..Default::default()
1057+
},
1058+
Default::default(),
1059+
)
1060+
.unwrap();
1061+
assert_eq!(pattern.pathname.group_name_list, vec!["a\u{30FB}b"]);
1062+
}
10501063
}

src/tokenizer.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,9 @@ pub fn tokenize(
319319
#[inline]
320320
pub(crate) fn is_valid_name_codepoint(code_point: char, first: bool) -> bool {
321321
if first {
322-
unic_ucd_ident::is_id_start(code_point) || matches!(code_point, '$' | '_')
322+
unicode_id_start::is_id_start(code_point) || matches!(code_point, '$' | '_')
323323
} else {
324-
unic_ucd_ident::is_id_continue(code_point)
324+
unicode_id_start::is_id_continue(code_point)
325325
|| matches!(code_point, '$' | '\u{200C}' | '\u{200D}')
326326
}
327327
}

0 commit comments

Comments
 (0)