summaryrefslogtreecommitdiff
path: root/tests/typ/spacing.typ
blob: ccaf084a2c653e3f3d703dafaf09ee9846c03f2f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Test spacing around control flow structures.

---
// Spacing around let.

// Error: 6 expected identifier
A#let;B \
A#let x = 1;B  #test(x, 1) \
A #let x = 2;B #test(x, 2) \
A#let x = 3; B #test(x, 3) \

---
// Spacing around if-else.

A#if true [B]C \
A#if true [B] C \
A #if true{"B"}C \
A #if true{"B"} C \
A#if false [] #else [B]C \
A#if true [B] #else [] C \

---
// Spacing around while loop.

#let c = true; A#while c [{c = false}B]C \
#let c = true; A#while c [{c = false}B] C \
#let c = true; A #while c { c = false; "B" }C \
#let c = true; A #while c { c = false; "B" } C \

---
// Spacing around for loop.

A#for _ in (none,) [B]C  \
A#for _ in (none,) [B] C \
A #for _ in (none,) {"B"}C \