Skip to content

Commit 198060c

Browse files
committed
Relax again the braced placeholder tokenizer
1 parent 5d91ad6 commit 198060c

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

src/tokenizer.rs

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -384,22 +384,18 @@ fn get_ident_named_placeholder_token<'i>(input: &mut &'i str) -> Result<Token<'i
384384
}
385385

386386
fn get_braced_named_placeholder_token<'i>(input: &mut &'i str) -> Result<Token<'i>> {
387-
delimited(
388-
'{',
389-
take_while(1.., |c: char| c.is_alphanumeric() || c == '_'),
390-
'}',
391-
)
392-
.with_taken()
393-
.parse_next(input)
394-
.map(|(index, token)| {
395-
let index = Cow::Borrowed(index);
396-
Token {
397-
kind: TokenKind::Placeholder,
398-
value: token,
399-
key: Some(PlaceholderKind::Named(index)),
400-
alias: token,
401-
}
402-
})
387+
delimited('{', take_until(1.., '}'), '}')
388+
.with_taken()
389+
.parse_next(input)
390+
.map(|(index, token)| {
391+
let index = Cow::Borrowed(index);
392+
Token {
393+
kind: TokenKind::Placeholder,
394+
value: token,
395+
key: Some(PlaceholderKind::Named(index)),
396+
alias: token,
397+
}
398+
})
403399
}
404400

405401
fn get_string_named_placeholder_token<'i>(

0 commit comments

Comments
 (0)