From 7094291573dc819e3115950ec3b2316bd5e9ea33 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 16 Aug 2018 12:51:40 +0300 Subject: tt-attrs --- crates/libsyntax2/src/grammar/items/mod.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'crates/libsyntax2/src/grammar/items') 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 } } -pub(super) const ITEM_FIRST: TokenSet = - token_set![EXTERN_KW, MOD_KW, USE_KW, STRUCT_KW, ENUM_KW, FN_KW, PUB_KW, POUND]; - pub(super) enum MaybeItem { None, Item(SyntaxKind), @@ -322,13 +319,14 @@ pub(super) fn macro_call_after_excl(p: &mut Parser) -> BlockLike { flavor } -fn token_tree(p: &mut Parser) { +pub(super) fn token_tree(p: &mut Parser) { let closing_paren_kind = match p.current() { L_CURLY => R_CURLY, L_PAREN => R_PAREN, L_BRACK => R_BRACK, _ => unreachable!(), }; + let m = p.start(); p.bump(); while !p.at(EOF) && !p.at(closing_paren_kind) { match p.current() { @@ -338,4 +336,5 @@ fn token_tree(p: &mut Parser) { } }; p.expect(closing_paren_kind); + m.complete(p, TOKEN_TREE); } -- cgit v1.2.3