aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/grammar/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/grammar/mod.rs')
-rw-r--r--crates/ra_syntax/src/grammar/mod.rs31
1 files changed, 11 insertions, 20 deletions
diff --git a/crates/ra_syntax/src/grammar/mod.rs b/crates/ra_syntax/src/grammar/mod.rs
index 1199ba230..c87564073 100644
--- a/crates/ra_syntax/src/grammar/mod.rs
+++ b/crates/ra_syntax/src/grammar/mod.rs
@@ -31,28 +31,18 @@ mod type_args;
31mod type_params; 31mod type_params;
32mod types; 32mod types;
33 33
34use crate::{
35 token_set::TokenSet,
36 parser_api::{Marker, CompletedMarker, Parser},
37 SyntaxKind::{self, *},
38};
39pub(crate) use self::{ 34pub(crate) use self::{
40 expressions::{ 35 expressions::block,
41 block,
42 },
43 items::{ 36 items::{
44 enum_variant_list, 37 enum_variant_list, extern_item_list, impl_item_list, match_arm_list, mod_item_list,
45 extern_item_list, 38 named_field_def_list, named_field_list, token_tree, trait_item_list, use_tree_list,
46 impl_item_list,
47 match_arm_list,
48 mod_item_list,
49 named_field_def_list,
50 named_field_list,
51 token_tree,
52 trait_item_list,
53 use_tree_list,
54 }, 39 },
55}; 40};
41use crate::{
42 parser_api::{CompletedMarker, Marker, Parser},
43 token_set::TokenSet,
44 SyntaxKind::{self, *},
45};
56 46
57pub(crate) fn root(p: &mut Parser) { 47pub(crate) fn root(p: &mut Parser) {
58 let m = p.start(); 48 let m = p.start();
@@ -61,7 +51,6 @@ pub(crate) fn root(p: &mut Parser) {
61 m.complete(p, ROOT); 51 m.complete(p, ROOT);
62} 52}
63 53
64
65#[derive(Clone, Copy, PartialEq, Eq)] 54#[derive(Clone, Copy, PartialEq, Eq)]
66enum BlockLike { 55enum BlockLike {
67 Block, 56 Block,
@@ -69,7 +58,9 @@ enum BlockLike {
69} 58}
70 59
71impl BlockLike { 60impl BlockLike {
72 fn is_block(self) -> bool { self == BlockLike::Block } 61 fn is_block(self) -> bool {
62 self == BlockLike::Block
63 }
73} 64}
74 65
75fn opt_visibility(p: &mut Parser) { 66fn opt_visibility(p: &mut Parser) {