diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-10-29 16:04:55 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-10-29 16:04:55 +0200 |
| commit | de6786eb28c3034dfef654da73b09358fbd8cd90 (patch) | |
| tree | 9e1569ea0bc0672aca8ad43b9b7f4d72fda94512 | |
| parent | d1ecb7e52eb2ab7ac4fde89bdc1c615d92ae3c7b (diff) | |
Allow multiple template bodies
| -rw-r--r-- | src/parse/mod.rs | 2 | ||||
| -rw-r--r-- | tests/ref/code/call.png | bin | 1865 -> 2397 bytes | |||
| -rw-r--r-- | tests/typ/code/call.typ | 5 |
3 files changed, 6 insertions, 1 deletions
diff --git a/src/parse/mod.rs b/src/parse/mod.rs index cc710201..8466d99f 100644 --- a/src/parse/mod.rs +++ b/src/parse/mod.rs @@ -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); args.items.push(CallArg::Pos(body)); } diff --git a/tests/ref/code/call.png b/tests/ref/code/call.png Binary files differindex f5e19783..bd6f22f3 100644 --- a/tests/ref/code/call.png +++ b/tests/ref/code/call.png diff --git a/tests/typ/code/call.typ b/tests/typ/code/call.typ index ffd91769..5ab0252c 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,) |
