diff options
author | Aleksey Kladov <[email protected]> | 2018-08-31 11:35:48 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-31 11:35:48 +0100 |
commit | 8fc7f438c4347e027deda5cda4bcd5e560610bb7 (patch) | |
tree | fea53412ee0462dbecc6071a85164c18bd5f9fa6 /crates/libsyntax2/src/grammar/mod.rs | |
parent | faebae74e48e3e7e0d3dfddc5b5cf0b18535cc6b (diff) |
start item recovery
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(); |