summaryrefslogtreecommitdiff
path: root/tests/typ/expr/block-invalid.typ
blob: d98bf06bfc4c20f626aecd0a4b2e5b2e48daf357 (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
36
37
// 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
{0 1}

// Should output `2`.
// Error: 2:12 expected semicolon or line break
// Error: 1: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: 3:1 expected closing brace
{

---
// Ref: false
// Error: 1-2 unexpected closing brace
}