mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Fix missing last token in mbe $repeat parsing
This commit is contained in:
parent
403cd78bae
commit
e8ddeb869d
2 changed files with 24 additions and 1 deletions
|
@ -553,6 +553,30 @@ SOURCE_FILE@[0; 40)
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_last_expr() {
|
||||
let rules = create_rules(
|
||||
r#"
|
||||
macro_rules! vec {
|
||||
($($item:expr),*) => {
|
||||
{
|
||||
let mut v = Vec::new();
|
||||
$(
|
||||
v.push($item);
|
||||
)*
|
||||
v
|
||||
}
|
||||
};
|
||||
}
|
||||
"#,
|
||||
);
|
||||
assert_expansion(
|
||||
&rules,
|
||||
"vec!(1,2,3)",
|
||||
"{let mut v = Vec :: new () ; v . push (1) ; v . push (2) ; v . push (3) ; v}",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_ty() {
|
||||
let rules = create_rules(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue