aboutsummaryrefslogtreecommitdiff
path: root/old-tests/variable/type-pattern-append/buildfile
blob: 348f70f9075c5f0f4f5b7308a5805530f7ad5c4b (plain)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Typed append/prepend.
#
#dir{a*}: x += [bool] true
#dir{p*}: x =+ [bool] true

[string] typed = [null]
dir{a*}: typed += abc    # ok
dir{p*}: typed =+ abc    # ok

# Prepend/append before/after assignment.
#
[string] x1 = [null]
dir{*}: x1 += A
dir{*}: x1 = b
dir{*}: x1 += c
dir{*}: x1 =+ a
print $(dir{./}:x1)

# Without stem, mixed prepend/append.
#
dir{*}: x2 += b
dir{*}: x2 += c
#dir{*}: x2 =+ a     # error
print $(dir{./}:x2)

dir{*}: x3 =+ b
dir{*}: x3 =+ a
#dir{*}: x3 += c     # error
print $(dir{./}:x3)

# With stem, typing.
#
x4 = a
dir{*}: x4 += b
dir{*}: x4 += c
print $(dir{./}:x4)

[string] x5 = b
dir{*}: x5 =+ a
x = $(dir{./}:x5)
print $(dir{./}:x5)

x6 = [string] a
sub/
{
  dir{*}: x6 += b
  dir{*}: x6 += [null]
  print $(dir{./}:x6)
}

x7 = [string] b
dir{*}: x7 =+ a
sub/
{
  dir{*}: x7 += c
  print $(dir{./}:x7)
}

./: