mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
29 lines
427 B
XML
29 lines
427 B
XML
// Test invalid if syntax.
|
|
|
|
---
|
|
// Error: 4-4 expected expression
|
|
#if
|
|
|
|
// Error: 5-5 expected expression
|
|
{#if}
|
|
|
|
// Error: 6-6 expected body
|
|
#if x
|
|
|
|
// Error: 1-6 unexpected keyword `#else`
|
|
#else {}
|
|
|
|
---
|
|
// Should output `x`.
|
|
// Error: 4-4 expected expression
|
|
#if
|
|
x {}
|
|
|
|
// Should output `something`.
|
|
// Error: 6-6 expected body
|
|
#if x something
|
|
|
|
// Should output `A thing.`
|
|
// Error: 20-20 expected body
|
|
A#if false {} #else thing
|