summaryrefslogtreecommitdiff
path: root/test/basic/linker.txt
blob: 76b1980c7b8bd6a521c613872fc4c73909f9cfef (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
ast -> linkers = {
    ['g|"X"|"Y"|"Z"'] = {src1, src2, src3},
    ['g|"X"|"Y"']     = {src4, src5, src6},
    ['g|"X"']         = {src7, src8, src9},
    ['l|7']           = {src10},
    ['l|7|"x"']       = {src11},
    ['l|11|"k"']      = {src12},
}

```lua
x.y.<?z?> = <!f!>

<?g?> = x.y.z

t.<!z!> = 1
x.y = t

x = {
    y = {
        <!z!> = 1
    }
}
```

expect:   'l|x|y|z'
forward:  'l|x|y|z' -> f
backward: 'l|x|y|z' -> g
last:     'l|x|y' + 'z'

expect:   'l|x|y' + '|z'
forward:  'l|t' + '|z' -> 'l|t|z' -> t.z
backward: nil
last:     'l|x' + '|y|z'

expect:   'l|x' + '|y|z'
forward:  'l|0' + '|y|z' -> 'l|0|y|z'
backward: nil
last:     nil

expect:   'l|0|y|z'
forward:  nil
backward: nil
last:     'l|0|y' + '|z'

expect:   'l|0|y' + '|z'
forward:  'l|1'+ '|z' -> 'l|1|z' -> field z
backward: nil
last:     'l|0' + '|y|z'


```lua
a = {
    b = {
        <?c?> = 1,
    }
}

print(a.b.<!c!>)
```

expect:   't|3|c'
forward:  nil
backward: nil
last:     't|3' + '|c'

expect:   't|3' + '|c'
forward:  nil
backward: 't|2|b' + '|c'
last:     nil

expect:   't|2|b|c'
forward:  nil
backward: 't|2|b' + '|c'
last:     nil