Skip to content

Commit 6c5450c

Browse files
committed
Use a more precise check
1 parent 198060c commit 6c5450c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ debug = ["dep:anstream", "dep:anstyle", "dep:okhsl"]
1919
anstream = { version = "0.6.21", optional = true }
2020
anstyle = { version = "1.0.13", optional = true }
2121
okhsl = { version = "1.0.1", optional = true }
22+
unicode-ident = "1.0.19"
2223
unicode_categories = "0.1.1"
2324
winnow = { version = "0.7.0", features = ["simd"] }
2425

src/tokenizer.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::borrow::Cow;
22
use unicode_categories::UnicodeCategories;
3+
use unicode_ident::is_xid_continue;
34
use winnow::ascii::{digit0, digit1, till_line_ending, Caseless};
45
use winnow::combinator::{alt, delimited, dispatch, eof, fail, opt, peek, terminated};
56
use winnow::error::ContextError;
@@ -384,7 +385,7 @@ fn get_ident_named_placeholder_token<'i>(input: &mut &'i str) -> Result<Token<'i
384385
}
385386

386387
fn get_braced_named_placeholder_token<'i>(input: &mut &'i str) -> Result<Token<'i>> {
387-
delimited('{', take_until(1.., '}'), '}')
388+
delimited('{', take_while(1.., is_xid_continue), '}')
388389
.with_taken()
389390
.parse_next(input)
390391
.map(|(index, token)| {

0 commit comments

Comments
 (0)