diff options
Diffstat (limited to 'crates/libsyntax2/src/grammar/mod.rs')
-rw-r--r-- | crates/libsyntax2/src/grammar/mod.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crates/libsyntax2/src/grammar/mod.rs b/crates/libsyntax2/src/grammar/mod.rs index 1acecac41..339664af3 100644 --- a/crates/libsyntax2/src/grammar/mod.rs +++ b/crates/libsyntax2/src/grammar/mod.rs | |||
@@ -129,16 +129,20 @@ fn opt_fn_ret_type(p: &mut Parser) -> bool { | |||
129 | } | 129 | } |
130 | } | 130 | } |
131 | 131 | ||
132 | fn name(p: &mut Parser) { | 132 | fn name_r(p: &mut Parser, recovery: TokenSet) { |
133 | if p.at(IDENT) { | 133 | if p.at(IDENT) { |
134 | let m = p.start(); | 134 | let m = p.start(); |
135 | p.bump(); | 135 | p.bump(); |
136 | m.complete(p, NAME); | 136 | m.complete(p, NAME); |
137 | } else { | 137 | } else { |
138 | p.err_and_bump("expected a name"); | 138 | p.err_recover("expected a name", recovery); |
139 | } | 139 | } |
140 | } | 140 | } |
141 | 141 | ||
142 | fn name(p: &mut Parser) { | ||
143 | name_r(p, TokenSet::EMPTY) | ||
144 | } | ||
145 | |||
142 | fn name_ref(p: &mut Parser) { | 146 | fn name_ref(p: &mut Parser) { |
143 | if p.at(IDENT) { | 147 | if p.at(IDENT) { |
144 | let m = p.start(); | 148 | let m = p.start(); |