aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-09-08 08:28:53 +0100
committerAleksey Kladov <[email protected]>2018-09-08 08:28:53 +0100
commita0a347eac941e93165c5b2728010bfbcb6ae9549 (patch)
tree110c64cbbe047968408a392c4b6aab5570aca629 /crates/libsyntax2/src
parentbd3a26493f101039fb6fe97561a15bcfffea82f0 (diff)
Don't get stuck in macros
Diffstat (limited to 'crates/libsyntax2/src')
-rw-r--r--crates/libsyntax2/src/grammar/items/mod.rs7
1 files changed, 6 insertions, 1 deletions
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) {
355 while !p.at(EOF) && !p.at(closing_paren_kind) { 355 while !p.at(EOF) && !p.at(closing_paren_kind) {
356 match p.current() { 356 match p.current() {
357 L_CURLY | L_PAREN | L_BRACK => token_tree(p), 357 L_CURLY | L_PAREN | L_BRACK => token_tree(p),
358 R_CURLY | R_PAREN | R_BRACK => p.err_and_bump("unmatched brace"), 358 R_CURLY => {
359 p.error("unmatched `}`");
360 m.complete(p, TOKEN_TREE);
361 return;
362 }
363 R_PAREN | R_BRACK => p.err_and_bump("unmatched brace"),
359 _ => p.bump() 364 _ => p.bump()
360 } 365 }
361 }; 366 };