File tree 1 file changed +50
-0
lines changed
crates/hir-def/src/macro_expansion_tests
1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,56 @@ struct#10 MyTraitMap2#32 {#13
46
46
) ;
47
47
}
48
48
49
+ #[ test]
50
+ fn token_mapping_floats ( ) {
51
+ check (
52
+ r#"
53
+ // +tokenids
54
+ macro_rules! f {
55
+ ($($tt:tt)*) => {
56
+ $($tt)*
57
+ };
58
+ }
59
+
60
+ // +tokenids
61
+ f! {
62
+ fn main() {
63
+ 1;
64
+ 1.0;
65
+ let x = 1;
66
+ }
67
+ }
68
+
69
+
70
+ "# ,
71
+ expect ! [ [ r##"
72
+ // call ids will be shifted by Shift(18)
73
+ // +tokenids
74
+ macro_rules! f {#0
75
+ (#1$#2(#3$#4tt#5:#6tt#7)#3*#8)#1 =#9>#10 {#11
76
+ $#12(#13$#14tt#15)#13*#16
77
+ }#11;#17
78
+ }#0
79
+
80
+ // // +tokenids
81
+ // f! {
82
+ // fn#1 main#2() {
83
+ // 1#5;#6
84
+ // 1.0#7;#8
85
+ // let#9 x#10 =#11 1#12;#13
86
+ // }
87
+ // }
88
+ fn#19 main#20(#21)#21 {#22
89
+ 1#23;#24
90
+ 1#26.0;
91
+ let x#31 =#22 1;
92
+ }
93
+
94
+
95
+ "## ] ] ,
96
+ ) ;
97
+ }
98
+
49
99
#[ test]
50
100
fn mbe_smoke_test ( ) {
51
101
check (
You can’t perform that action at this time.
0 commit comments