diff options
| author | Aleksey Kladov <[email protected]> | 2018-08-16 10:51:40 +0100 |
|---|---|---|
| committer | Aleksey Kladov <[email protected]> | 2018-08-16 10:51:40 +0100 |
| commit | 7094291573dc819e3115950ec3b2316bd5e9ea33 (patch) | |
| tree | be18ef6c5baab68acac484d00277125484d15820 /crates/libsyntax2/src/grammar/items | |
| parent | 1193c5f829dc96683132c12d5395d7805787af2a (diff) | |
tt-attrs
Diffstat (limited to 'crates/libsyntax2/src/grammar/items')
| -rw-r--r-- | crates/libsyntax2/src/grammar/items/mod.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/libsyntax2/src/grammar/items/mod.rs b/crates/libsyntax2/src/grammar/items/mod.rs index fc02f0c5c..84cb47748 100644 --- a/crates/libsyntax2/src/grammar/items/mod.rs +++ b/crates/libsyntax2/src/grammar/items/mod.rs | |||
| @@ -55,9 +55,6 @@ pub(super) fn item_or_macro(p: &mut Parser, stop_on_r_curly: bool, flavor: ItemF | |||
| 55 | } | 55 | } |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | pub(super) const ITEM_FIRST: TokenSet = | ||
| 59 | token_set![EXTERN_KW, MOD_KW, USE_KW, STRUCT_KW, ENUM_KW, FN_KW, PUB_KW, POUND]; | ||
| 60 | |||
| 61 | pub(super) enum MaybeItem { | 58 | pub(super) enum MaybeItem { |
| 62 | None, | 59 | None, |
| 63 | Item(SyntaxKind), | 60 | Item(SyntaxKind), |
| @@ -322,13 +319,14 @@ pub(super) fn macro_call_after_excl(p: &mut Parser) -> BlockLike { | |||
| 322 | flavor | 319 | flavor |
| 323 | } | 320 | } |
| 324 | 321 | ||
| 325 | fn token_tree(p: &mut Parser) { | 322 | pub(super) fn token_tree(p: &mut Parser) { |
| 326 | let closing_paren_kind = match p.current() { | 323 | let closing_paren_kind = match p.current() { |
| 327 | L_CURLY => R_CURLY, | 324 | L_CURLY => R_CURLY, |
| 328 | L_PAREN => R_PAREN, | 325 | L_PAREN => R_PAREN, |
| 329 | L_BRACK => R_BRACK, | 326 | L_BRACK => R_BRACK, |
| 330 | _ => unreachable!(), | 327 | _ => unreachable!(), |
| 331 | }; | 328 | }; |
| 329 | let m = p.start(); | ||
| 332 | p.bump(); | 330 | p.bump(); |
| 333 | while !p.at(EOF) && !p.at(closing_paren_kind) { | 331 | while !p.at(EOF) && !p.at(closing_paren_kind) { |
| 334 | match p.current() { | 332 | match p.current() { |
| @@ -338,4 +336,5 @@ fn token_tree(p: &mut Parser) { | |||
| 338 | } | 336 | } |
| 339 | }; | 337 | }; |
| 340 | p.expect(closing_paren_kind); | 338 | p.expect(closing_paren_kind); |
| 339 | m.complete(p, TOKEN_TREE); | ||
| 341 | } | 340 | } |
