Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir_def/src/macro_expansion_tests/mbe.rs')
| -rw-r--r-- | crates/hir_def/src/macro_expansion_tests/mbe.rs | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/crates/hir_def/src/macro_expansion_tests/mbe.rs b/crates/hir_def/src/macro_expansion_tests/mbe.rs index a06e433ed2..213474c169 100644 --- a/crates/hir_def/src/macro_expansion_tests/mbe.rs +++ b/crates/hir_def/src/macro_expansion_tests/mbe.rs @@ -496,3 +496,69 @@ fn foo() { "#]], ); } + +#[test] +fn test_tt_to_stmts() { + check( + r#" +macro_rules! m { + () => { + let a = 0; + a = 10 + 1; + a + } +} + +fn f() -> i32 { + // +tree + m!{} +} +"#, + expect![[r#" +macro_rules! m { + () => { + let a = 0; + a = 10 + 1; + a + } +} + +fn f() -> i32 { + let a = 0; + a = 10+1; + a +// [email protected] "let" +// [email protected] "a" +// [email protected] "=" +// [email protected] "0" +// [email protected] ";" +// [email protected] "a" +// [email protected] "=" +// [email protected] "10" +// [email protected] "+" +// [email protected] "1" +// [email protected] ";" +// [email protected] "a" + +} +"#]], + ); +} |