aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/src/grammar/items/mod.rs
diff options
context:
space:
mode:
authordarksv <[email protected]>2018-09-10 19:14:09 +0100
committerdarksv <[email protected]>2018-09-10 19:14:09 +0100
commit64d07c1bd475c4945db8d7cd1fa1a61e467b079b (patch)
tree3184113f1d146e887eae6d667ff9c16b2138160b /crates/libsyntax2/src/grammar/items/mod.rs
parent4f647096665b2ca3725ba1f7415a21fbc46044bb (diff)
Implement reparsing for remaining blocks
Diffstat (limited to 'crates/libsyntax2/src/grammar/items/mod.rs')
-rw-r--r--crates/libsyntax2/src/grammar/items/mod.rs15
1 files changed, 10 insertions, 5 deletions
diff --git a/crates/libsyntax2/src/grammar/items/mod.rs b/crates/libsyntax2/src/grammar/items/mod.rs
index 85d7fe770..8c19aa179 100644
--- a/crates/libsyntax2/src/grammar/items/mod.rs
+++ b/crates/libsyntax2/src/grammar/items/mod.rs
@@ -5,7 +5,12 @@ mod traits;
5mod use_item; 5mod use_item;
6 6
7use super::*; 7use super::*;
8pub(crate) use self::nominal::named_field_def_list; 8pub(crate) use self::{
9 expressions::{named_field_list, match_arm_list},
10 nominal::{enum_variant_list, named_field_def_list},
11 traits::{trait_item_list, impl_item_list},
12 use_item::use_tree_list,
13};
9 14
10// test mod_contents 15// test mod_contents
11// fn foo() {} 16// fn foo() {}
@@ -223,7 +228,7 @@ fn extern_crate_item(p: &mut Parser) {
223 p.expect(SEMI); 228 p.expect(SEMI);
224} 229}
225 230
226fn extern_item_list(p: &mut Parser) { 231pub(crate) fn extern_item_list(p: &mut Parser) {
227 assert!(p.at(L_CURLY)); 232 assert!(p.at(L_CURLY));
228 let m = p.start(); 233 let m = p.start();
229 p.bump(); 234 p.bump();
@@ -295,7 +300,7 @@ fn type_def(p: &mut Parser) {
295 p.expect(SEMI); 300 p.expect(SEMI);
296} 301}
297 302
298fn mod_item(p: &mut Parser) { 303pub(crate) fn mod_item(p: &mut Parser) {
299 assert!(p.at(MOD_KW)); 304 assert!(p.at(MOD_KW));
300 p.bump(); 305 p.bump();
301 306
@@ -307,7 +312,7 @@ fn mod_item(p: &mut Parser) {
307 } 312 }
308} 313}
309 314
310fn mod_item_list(p: &mut Parser) { 315pub(crate) fn mod_item_list(p: &mut Parser) {
311 assert!(p.at(L_CURLY)); 316 assert!(p.at(L_CURLY));
312 let m = p.start(); 317 let m = p.start();
313 p.bump(); 318 p.bump();
@@ -343,7 +348,7 @@ pub(super) fn macro_call_after_excl(p: &mut Parser) -> BlockLike {
343 flavor 348 flavor
344} 349}
345 350
346pub(super) fn token_tree(p: &mut Parser) { 351pub(crate) fn token_tree(p: &mut Parser) {
347 let closing_paren_kind = match p.current() { 352 let closing_paren_kind = match p.current() {
348 L_CURLY => R_CURLY, 353 L_CURLY => R_CURLY,
349 L_PAREN => R_PAREN, 354 L_PAREN => R_PAREN,