aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/src/grammar
diff options
context:
space:
mode:
Diffstat (limited to 'crates/libsyntax2/src/grammar')
-rw-r--r--crates/libsyntax2/src/grammar/patterns.rs2
-rw-r--r--crates/libsyntax2/src/grammar/types.rs5
2 files changed, 5 insertions, 2 deletions
diff --git a/crates/libsyntax2/src/grammar/patterns.rs b/crates/libsyntax2/src/grammar/patterns.rs
index 065570b99..aa20ae8e4 100644
--- a/crates/libsyntax2/src/grammar/patterns.rs
+++ b/crates/libsyntax2/src/grammar/patterns.rs
@@ -23,7 +23,7 @@ pub(super) fn pattern(p: &mut Parser) {
23} 23}
24 24
25const PAT_RECOVERY_SET: TokenSet = 25const PAT_RECOVERY_SET: TokenSet =
26 token_set![LET_KW, IF_KW, WHILE_KW, LOOP_KW, MATCH_KW]; 26 token_set![LET_KW, IF_KW, WHILE_KW, LOOP_KW, MATCH_KW, R_PAREN, COMMA];
27 27
28 28
29fn atom_pat(p: &mut Parser) -> Option<CompletedMarker> { 29fn atom_pat(p: &mut Parser) -> Option<CompletedMarker> {
diff --git a/crates/libsyntax2/src/grammar/types.rs b/crates/libsyntax2/src/grammar/types.rs
index 89030e66c..a52355b50 100644
--- a/crates/libsyntax2/src/grammar/types.rs
+++ b/crates/libsyntax2/src/grammar/types.rs
@@ -8,6 +8,9 @@ pub(super) const TYPE_FIRST: TokenSet =
8 paths::PATH_FIRST, 8 paths::PATH_FIRST,
9 ]; 9 ];
10 10
11const TYPE_RECOVERY_SET: TokenSet =
12 token_set![R_PAREN, COMMA];
13
11pub(super) fn type_(p: &mut Parser) { 14pub(super) fn type_(p: &mut Parser) {
12 match p.current() { 15 match p.current() {
13 L_PAREN => paren_or_tuple_type(p), 16 L_PAREN => paren_or_tuple_type(p),
@@ -23,7 +26,7 @@ pub(super) fn type_(p: &mut Parser) {
23 L_ANGLE => path_type(p), 26 L_ANGLE => path_type(p),
24 _ if paths::is_path_start(p) => path_type(p), 27 _ if paths::is_path_start(p) => path_type(p),
25 _ => { 28 _ => {
26 p.err_and_bump("expected type"); 29 p.err_recover("expected type", TYPE_RECOVERY_SET);
27 } 30 }
28 } 31 }
29} 32}