aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/src/grammar/patterns.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-08-13 16:23:14 +0100
committerAleksey Kladov <[email protected]>2018-08-13 16:24:17 +0100
commit9149fd2c0ca3d23719082852a2cddd8ba5804ce6 (patch)
treef15d90dc80b6fd4d8e1bb966a171cb06a64cf9c0 /crates/libsyntax2/src/grammar/patterns.rs
parentd1eceefeb8b683da3f64b89446f04f01803962e1 (diff)
Fix some parser bugs
Diffstat (limited to 'crates/libsyntax2/src/grammar/patterns.rs')
-rw-r--r--crates/libsyntax2/src/grammar/patterns.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/libsyntax2/src/grammar/patterns.rs b/crates/libsyntax2/src/grammar/patterns.rs
index 436f3b26d..220f36db7 100644
--- a/crates/libsyntax2/src/grammar/patterns.rs
+++ b/crates/libsyntax2/src/grammar/patterns.rs
@@ -60,6 +60,7 @@ fn atom_pat(p: &mut Parser) -> Option<CompletedMarker> {
60// let Bar(..) = (); 60// let Bar(..) = ();
61// } 61// }
62fn path_pat(p: &mut Parser) -> CompletedMarker { 62fn path_pat(p: &mut Parser) -> CompletedMarker {
63 assert!(paths::is_path_start(p));
63 let m = p.start(); 64 let m = p.start();
64 paths::expr_path(p); 65 paths::expr_path(p);
65 let kind = match p.current() { 66 let kind = match p.current() {
@@ -116,8 +117,11 @@ fn struct_pat_fields(p: &mut Parser) {
116 p.bump(); 117 p.bump();
117 pattern(p); 118 pattern(p);
118 } 119 }
119 _ => { 120 REF_KW | MUT_KW | IDENT => {
120 bind_pat(p, false); 121 bind_pat(p, false);
122 },
123 _ => {
124 p.err_and_bump("expected ident");
121 } 125 }
122 } 126 }
123 if !p.at(R_CURLY) { 127 if !p.at(R_CURLY) {