typst/tests/typ/code/block-invalid.typ
Laurenz 9950627789 Even shorter error annotations
Error annotations are now relative to the first following non-comment line.
2021-07-09 10:50:25 +02:00

39 lines
696 B
XML

// Test invalid code block syntax.
---
// Multiple unseparated expressions in one line.
// Error: 2-4 expected expression, found invalid token
{1u}
// Should output `1`.
// Error: 3 expected semicolon or line break
// Error: 4-5 cannot join integer with integer
{1 2}
// Should output `2`.
// Error: 12 expected semicolon or line break
// Error: 22 expected semicolon or line break
{let x = -1 let y = 3 x + y}
// Should output `3`.
{
// Error: 9-12 expected identifier, found string
for "v"
// Error: 10 expected keyword `in`
for v let z = 1 + 2
z
}
---
// Ref: false
// Error: 2:1 expected closing brace
{
---
// Ref: false
// Error: 1-2 unexpected closing brace
}