diff --git a/src/parse/mod.rs b/src/parse/mod.rs index cc7102019..8466d99f6 100644 --- a/src/parse/mod.rs +++ b/src/parse/mod.rs @@ -561,7 +561,7 @@ fn call(p: &mut Parser, callee: Expr) -> Option { } }; - if p.peek_direct() == Some(Token::LeftBracket) { + while p.peek_direct() == Some(Token::LeftBracket) { let body = template(p); args.items.push(CallArg::Pos(body)); } diff --git a/tests/ref/code/call.png b/tests/ref/code/call.png index f5e197838..bd6f22f32 100644 Binary files a/tests/ref/code/call.png and b/tests/ref/code/call.png differ diff --git a/tests/typ/code/call.typ b/tests/typ/code/call.typ index ffd917696..5ab0252c0 100644 --- a/tests/typ/code/call.typ +++ b/tests/typ/code/call.typ @@ -20,6 +20,11 @@ #f()[A] #f([A]) +#let g(a, b) = a + b +#g[A][B] +#g([A], [B]) +#g()[A][B] + --- // Trailing comma. #test(1 + 1, 2,)