diff options
Diffstat (limited to 'crates/libsyntax2/src/grammar')
-rw-r--r-- | crates/libsyntax2/src/grammar/mod.rs | 4 | ||||
-rw-r--r-- | crates/libsyntax2/src/grammar/patterns.rs | 5 |
2 files changed, 3 insertions, 6 deletions
diff --git a/crates/libsyntax2/src/grammar/mod.rs b/crates/libsyntax2/src/grammar/mod.rs index e1329044d..d9443f24f 100644 --- a/crates/libsyntax2/src/grammar/mod.rs +++ b/crates/libsyntax2/src/grammar/mod.rs | |||
@@ -129,7 +129,7 @@ fn name(p: &mut Parser) { | |||
129 | p.bump(); | 129 | p.bump(); |
130 | m.complete(p, NAME); | 130 | m.complete(p, NAME); |
131 | } else { | 131 | } else { |
132 | p.error("expected a name"); | 132 | p.err_and_bump("expected a name"); |
133 | } | 133 | } |
134 | } | 134 | } |
135 | 135 | ||
@@ -139,7 +139,7 @@ fn name_ref(p: &mut Parser) { | |||
139 | p.bump(); | 139 | p.bump(); |
140 | m.complete(p, NAME_REF); | 140 | m.complete(p, NAME_REF); |
141 | } else { | 141 | } else { |
142 | p.error("expected identifier"); | 142 | p.err_and_bump("expected identifier"); |
143 | } | 143 | } |
144 | } | 144 | } |
145 | 145 | ||
diff --git a/crates/libsyntax2/src/grammar/patterns.rs b/crates/libsyntax2/src/grammar/patterns.rs index 220f36db7..71a1d5445 100644 --- a/crates/libsyntax2/src/grammar/patterns.rs +++ b/crates/libsyntax2/src/grammar/patterns.rs | |||
@@ -117,11 +117,8 @@ fn struct_pat_fields(p: &mut Parser) { | |||
117 | p.bump(); | 117 | p.bump(); |
118 | pattern(p); | 118 | pattern(p); |
119 | } | 119 | } |
120 | REF_KW | MUT_KW | IDENT => { | ||
121 | bind_pat(p, false); | ||
122 | }, | ||
123 | _ => { | 120 | _ => { |
124 | p.err_and_bump("expected ident"); | 121 | bind_pat(p, false); |
125 | } | 122 | } |
126 | } | 123 | } |
127 | if !p.at(R_CURLY) { | 124 | if !p.at(R_CURLY) { |