summaryrefslogtreecommitdiff
path: root/tests/lang/typ/array.typ
blob: c93835017cf2bd9bbc6b2a4113cede8baa66612a (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
38
39
40
41
42
43
// Test arrays.

---
// Empty.
{()}

// Not an array, just a parenthesized expression.
{(1)}

// One item and trailing comma.
{(-1,)}

// No trailing comma.
{(true, false)}

// Multiple lines and items and trailing comma.
{("1"
     , #002
     ,)}

// Error: 3 expected closing paren
{(}

// Error: 2-3 expected expression, found closing paren
{)}

// Error: 2:4 expected comma
// Error: 1:4-1:6 expected expression, found end of block comment
{(1*/2)}

// Error: 6-8 expected expression, found invalid token
{(1, 1u 2)}

// Error: 3-4 expected expression, found comma
{(,1)}

// Missing expression makes named pair incomplete, making this an empty array.
// Error: 5 expected expression
{(a:)}

// Named pair after this is already identified as an array.
// Error: 6-10 expected expression, found named pair
{(1, b: 2)}