@@ -38,7 +38,7 @@ struct ParserAnyMacro<'a> {
38
38
impl < ' a > ParserAnyMacro < ' a > {
39
39
/// Make sure we don't have any tokens left to parse, so we don't
40
40
/// silently drop anything. `allow_semi` is so that "optional"
41
- /// semilons at the end of normal expressions aren't complained
41
+ /// semicolons at the end of normal expressions aren't complained
42
42
/// about e.g. the semicolon in `macro_rules! kapow( () => {
43
43
/// fail!(); } )` doesn't get picked up by .parse_expr(), but it's
44
44
/// allowed to be there.
@@ -73,6 +73,9 @@ impl<'a> MacResult for ParserAnyMacro<'a> {
73
73
let mut ret = SmallVector :: zero ( ) ;
74
74
loop {
75
75
let mut parser = self . parser . borrow_mut ( ) ;
76
+ // so... do outer attributes attached to the macro invocation
77
+ // just disappear? This question applies to make_methods, as
78
+ // well.
76
79
match parser. parse_item_with_outer_attributes ( ) {
77
80
Some ( item) => ret. push ( item) ,
78
81
None => break
@@ -81,6 +84,20 @@ impl<'a> MacResult for ParserAnyMacro<'a> {
81
84
self . ensure_complete_parse ( false ) ;
82
85
Some ( ret)
83
86
}
87
+
88
+ fn make_methods ( & self ) -> Option < SmallVector < Gc < ast:: Method > > > {
89
+ let mut ret = SmallVector :: zero ( ) ;
90
+ loop {
91
+ let mut parser = self . parser . borrow_mut ( ) ;
92
+ match parser. token {
93
+ EOF => break ,
94
+ _ => ret. push ( parser. parse_method ( None ) )
95
+ }
96
+ }
97
+ self . ensure_complete_parse ( false ) ;
98
+ Some ( ret)
99
+ }
100
+
84
101
fn make_stmt ( & self ) -> Option < Gc < ast:: Stmt > > {
85
102
let attrs = self . parser . borrow_mut ( ) . parse_outer_attributes ( ) ;
86
103
let ret = self . parser . borrow_mut ( ) . parse_stmt ( attrs) ;
0 commit comments