Don't get stuck in macros

This commit is contained in:
Aleksey Kladov
2018-09-08 10:28:53 +03:00
parent bd3a26493f
commit a0a347eac9
3 changed files with 54 additions and 1 deletions

View File

@@ -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()
}
};