mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Add block matcher
This commit is contained in:
parent
ab0a96586f
commit
8092b6487f
6 changed files with 35 additions and 0 deletions
|
@ -731,4 +731,16 @@ MACRO_ITEMS@[0; 40)
|
|||
}
|
||||
"#, r#"extern crate a ; mod b ; mod c {} use d ; const E : i32 = 0 ; static F : i32 = 0 ; impl G {} struct H ; enum I {Foo} trait J {} fn h () {} extern {} type T = u8 ;"#);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_block() {
|
||||
let rules = create_rules(
|
||||
r#"
|
||||
macro_rules! foo {
|
||||
($ i:block) => { fn foo() $ i }
|
||||
}
|
||||
"#,
|
||||
);
|
||||
assert_expansion(&rules, "foo! { { 1; } }", "fn foo () {1 ;}");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue