mirror of
https://github.com/typst/typst
synced 2025-05-20 20:15:29 +08:00
35 lines
526 B
XML
35 lines
526 B
XML
// Test function call arguments.
|
|
|
|
---
|
|
// One argument.
|
|
#f(bold)
|
|
|
|
// One argument and trailing comma.
|
|
#f(1,)
|
|
|
|
// One named argument.
|
|
#f(a:2)
|
|
|
|
// Mixed arguments.
|
|
{f(1, a: (3, 4), 2, b: "5")}
|
|
|
|
---
|
|
// Error: 4-5 expected expression, found colon
|
|
#f(:)
|
|
|
|
// Error: 7-9 expected expression, found end of block comment
|
|
#f(a:1*/)
|
|
|
|
// Error: 5 expected comma
|
|
#f(1 2)
|
|
|
|
// Error: 2:4-2:5 expected identifier
|
|
// Error: 1:6 expected expression
|
|
#f(1:)
|
|
|
|
// Error: 4-5 expected identifier
|
|
#f(1:2)
|
|
|
|
// Error: 4-7 expected identifier
|
|
{f((x):1)}
|