Allow multiple template bodies

This commit is contained in:
Laurenz 2021-10-29 16:04:55 +02:00
parent d1ecb7e52e
commit de6786eb28
3 changed files with 6 additions and 1 deletions

View File

@ -561,7 +561,7 @@ fn call(p: &mut Parser, callee: Expr) -> Option<Expr> {
} }
}; };
if p.peek_direct() == Some(Token::LeftBracket) { while p.peek_direct() == Some(Token::LeftBracket) {
let body = template(p); let body = template(p);
args.items.push(CallArg::Pos(body)); args.items.push(CallArg::Pos(body));
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -20,6 +20,11 @@
#f()[A] #f()[A]
#f([A]) #f([A])
#let g(a, b) = a + b
#g[A][B]
#g([A], [B])
#g()[A][B]
--- ---
// Trailing comma. // Trailing comma.
#test(1 + 1, 2,) #test(1 + 1, 2,)