From a0a347eac941e93165c5b2728010bfbcb6ae9549 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 8 Sep 2018 10:28:53 +0300 Subject: Don't get stuck in macros --- crates/libsyntax2/src/grammar/items/mod.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'crates/libsyntax2/src') diff --git a/crates/libsyntax2/src/grammar/items/mod.rs b/crates/libsyntax2/src/grammar/items/mod.rs index 5466146b4..57742ecb9 100644 --- a/crates/libsyntax2/src/grammar/items/mod.rs +++ b/crates/libsyntax2/src/grammar/items/mod.rs @@ -355,7 +355,12 @@ pub(super) fn token_tree(p: &mut Parser) { while !p.at(EOF) && !p.at(closing_paren_kind) { match p.current() { L_CURLY | L_PAREN | L_BRACK => token_tree(p), - R_CURLY | R_PAREN | R_BRACK => p.err_and_bump("unmatched brace"), + R_CURLY => { + p.error("unmatched `}`"); + m.complete(p, TOKEN_TREE); + return; + } + R_PAREN | R_BRACK => p.err_and_bump("unmatched brace"), _ => p.bump() } }; -- cgit v1.2.3