diff options
Diffstat (limited to 'crates/ra_parser/src/grammar')
-rw-r--r-- | crates/ra_parser/src/grammar/expressions.rs | 5 | ||||
-rw-r--r-- | crates/ra_parser/src/grammar/expressions/atom.rs | 4 | ||||
-rw-r--r-- | crates/ra_parser/src/grammar/paths.rs | 2 | ||||
-rw-r--r-- | crates/ra_parser/src/grammar/patterns.rs | 2 | ||||
-rw-r--r-- | crates/ra_parser/src/grammar/types.rs | 2 |
5 files changed, 10 insertions, 5 deletions
diff --git a/crates/ra_parser/src/grammar/expressions.rs b/crates/ra_parser/src/grammar/expressions.rs index 783d6a6f0..ba8386d11 100644 --- a/crates/ra_parser/src/grammar/expressions.rs +++ b/crates/ra_parser/src/grammar/expressions.rs | |||
@@ -40,6 +40,11 @@ pub(crate) fn block(p: &mut Parser) { | |||
40 | p.error("expected a block"); | 40 | p.error("expected a block"); |
41 | return; | 41 | return; |
42 | } | 42 | } |
43 | atom::block_expr(p, None); | ||
44 | } | ||
45 | |||
46 | pub(crate) fn naked_block(p: &mut Parser) { | ||
47 | assert!(p.at(T!['{'])); | ||
43 | let m = p.start(); | 48 | let m = p.start(); |
44 | p.bump(); | 49 | p.bump(); |
45 | expr_block_contents(p); | 50 | expr_block_contents(p); |
diff --git a/crates/ra_parser/src/grammar/expressions/atom.rs b/crates/ra_parser/src/grammar/expressions/atom.rs index bc942ae01..ec7f2441d 100644 --- a/crates/ra_parser/src/grammar/expressions/atom.rs +++ b/crates/ra_parser/src/grammar/expressions/atom.rs | |||
@@ -463,10 +463,10 @@ fn match_guard(p: &mut Parser) -> CompletedMarker { | |||
463 | // unsafe {}; | 463 | // unsafe {}; |
464 | // 'label: {}; | 464 | // 'label: {}; |
465 | // } | 465 | // } |
466 | fn block_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker { | 466 | pub(super) fn block_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker { |
467 | assert!(p.at(T!['{'])); | 467 | assert!(p.at(T!['{'])); |
468 | let m = m.unwrap_or_else(|| p.start()); | 468 | let m = m.unwrap_or_else(|| p.start()); |
469 | block(p); | 469 | naked_block(p); |
470 | m.complete(p, BLOCK_EXPR) | 470 | m.complete(p, BLOCK_EXPR) |
471 | } | 471 | } |
472 | 472 | ||
diff --git a/crates/ra_parser/src/grammar/paths.rs b/crates/ra_parser/src/grammar/paths.rs index 07eb53b0c..28c35a67d 100644 --- a/crates/ra_parser/src/grammar/paths.rs +++ b/crates/ra_parser/src/grammar/paths.rs | |||
@@ -18,7 +18,7 @@ pub(super) fn use_path(p: &mut Parser) { | |||
18 | path(p, Mode::Use) | 18 | path(p, Mode::Use) |
19 | } | 19 | } |
20 | 20 | ||
21 | pub(super) fn type_path(p: &mut Parser) { | 21 | pub(crate) fn type_path(p: &mut Parser) { |
22 | path(p, Mode::Type) | 22 | path(p, Mode::Type) |
23 | } | 23 | } |
24 | 24 | ||
diff --git a/crates/ra_parser/src/grammar/patterns.rs b/crates/ra_parser/src/grammar/patterns.rs index eae70ab85..32cde7de6 100644 --- a/crates/ra_parser/src/grammar/patterns.rs +++ b/crates/ra_parser/src/grammar/patterns.rs | |||
@@ -4,7 +4,7 @@ pub(super) const PATTERN_FIRST: TokenSet = expressions::LITERAL_FIRST | |||
4 | .union(paths::PATH_FIRST) | 4 | .union(paths::PATH_FIRST) |
5 | .union(token_set![BOX_KW, REF_KW, MUT_KW, L_PAREN, L_BRACK, AMP, UNDERSCORE, MINUS]); | 5 | .union(token_set![BOX_KW, REF_KW, MUT_KW, L_PAREN, L_BRACK, AMP, UNDERSCORE, MINUS]); |
6 | 6 | ||
7 | pub(super) fn pattern(p: &mut Parser) { | 7 | pub(crate) fn pattern(p: &mut Parser) { |
8 | pattern_r(p, PAT_RECOVERY_SET); | 8 | pattern_r(p, PAT_RECOVERY_SET); |
9 | } | 9 | } |
10 | 10 | ||
diff --git a/crates/ra_parser/src/grammar/types.rs b/crates/ra_parser/src/grammar/types.rs index 29d173305..9e321b2a6 100644 --- a/crates/ra_parser/src/grammar/types.rs +++ b/crates/ra_parser/src/grammar/types.rs | |||
@@ -7,7 +7,7 @@ pub(super) const TYPE_FIRST: TokenSet = paths::PATH_FIRST.union(token_set![ | |||
7 | 7 | ||
8 | const TYPE_RECOVERY_SET: TokenSet = token_set![R_PAREN, COMMA]; | 8 | const TYPE_RECOVERY_SET: TokenSet = token_set![R_PAREN, COMMA]; |
9 | 9 | ||
10 | pub(super) fn type_(p: &mut Parser) { | 10 | pub(crate) fn type_(p: &mut Parser) { |
11 | type_with_bounds_cond(p, true); | 11 | type_with_bounds_cond(p, true); |
12 | } | 12 | } |
13 | 13 | ||