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. = = x.y.z t. = 1 x.y = t x = { y = { = 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 = { = 1, } } print(a.b.) ``` 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 ```lua ---@return local function f() end local = f() ``` 'd|A' 'f|1|#1' 'f|1' + '|#1' 'l|1' + '|#1' 's|1' + '|#1' ```lua ---@generic T ---@param a T ---@return T local function f(a) end local local = f(c) ``` 'l1' 'l2|@1' 'f|1|@1' 'f|1|#1' ``` ---@generic T ---@param p T ---@return T local function f(p) end local = f() ``` l:r s:1#1 call l:f#1 call f:1#1 call -> f:1&T = l:k l:f@1 --> 从保存的call信息里找到 f:1&T = l:k l:k ``` ---@generic T, V ---@param p T ---@return fun(V):T, V local function f(p) end local f2 = f() local = f2() ``` l:r s:2|#1 call1 l:f2|#1 call1 f:2|#1 call1 s:1#1|#1 call2 f:1#1|#1 call2 -> f:1&T = l:k dfun:1|#1 dn:V -> f:1&T = l:k