From f3b320adf49ec4a11eaa31fbeda82e7de54586bd Mon Sep 17 00:00:00 2001 From: Dylan MacKenzie Date: Thu, 22 Aug 2019 12:15:39 -0700 Subject: Add BOX_KW to PATTERN_FIRST --- crates/ra_parser/src/grammar/patterns.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_parser/src') diff --git a/crates/ra_parser/src/grammar/patterns.rs b/crates/ra_parser/src/grammar/patterns.rs index df6000707..1f6a6fd48 100644 --- a/crates/ra_parser/src/grammar/patterns.rs +++ b/crates/ra_parser/src/grammar/patterns.rs @@ -2,7 +2,7 @@ use super::*; pub(super) const PATTERN_FIRST: TokenSet = expressions::LITERAL_FIRST .union(paths::PATH_FIRST) - .union(token_set![REF_KW, MUT_KW, L_PAREN, L_BRACK, AMP, UNDERSCORE, MINUS]); + .union(token_set![BOX_KW, REF_KW, MUT_KW, L_PAREN, L_BRACK, AMP, UNDERSCORE, MINUS]); pub(super) fn pattern(p: &mut Parser) { pattern_r(p, PAT_RECOVERY_SET); -- cgit v1.2.3 From 3e14b16c4d67e6a87e21424dd56732b511724e04 Mon Sep 17 00:00:00 2001 From: Dylan MacKenzie Date: Thu, 22 Aug 2019 11:26:13 -0700 Subject: Add test for nested box pattern --- crates/ra_parser/src/grammar/expressions/atom.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'crates/ra_parser/src') diff --git a/crates/ra_parser/src/grammar/expressions/atom.rs b/crates/ra_parser/src/grammar/expressions/atom.rs index bc942ae01..ab8fb9f6e 100644 --- a/crates/ra_parser/src/grammar/expressions/atom.rs +++ b/crates/ra_parser/src/grammar/expressions/atom.rs @@ -414,6 +414,8 @@ pub(crate) fn match_arm_list(p: &mut Parser) { // X | Y if Z => (), // | X | Y if Z => (), // | X => (), +// box X => (), +// Some(box X) => (), // }; // } fn match_arm(p: &mut Parser) -> BlockLike { -- cgit v1.2.3