From ede808fe32a66ac828762818bf43d18fc343c159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 14 Apr 2021 20:13:00 +0800 Subject: stash --- test/basic/linker.lua | 16 +++++++++++----- test/basic/linker.txt | 16 ++++++++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 test/basic/linker.txt (limited to 'test/basic') diff --git a/test/basic/linker.lua b/test/basic/linker.lua index bf4e50bb..0be93e8d 100644 --- a/test/basic/linker.lua +++ b/test/basic/linker.lua @@ -37,24 +37,28 @@ local function TEST(script) end CARE['id'] = true +CARE['loc'] = true TEST [[ local ]] { - id = '9', + id = '9', + loc = true, } TEST [[ local x print() ]] { - id = '7', + id = '7', + loc = true, } TEST [[ local x = 1 ]] { - id = '7', + id = '7', + loc = true, } CARE['global'] = true @@ -76,14 +80,16 @@ TEST [[ local x print(x.y.) ]] { - id = '7|"y"|"z"', + id = '7|"y"|"z"', + loc = true, } TEST [[ local x function x:() end ]] { - id = '7|"f"', + id = '7|"f"', + loc = true, } TEST [[ diff --git a/test/basic/linker.txt b/test/basic/linker.txt new file mode 100644 index 00000000..18176369 --- /dev/null +++ b/test/basic/linker.txt @@ -0,0 +1,16 @@ +ast -> linkers = { + globals = { + ['"X"|"Y"|"Z"'] = {src1, src2, src3}, + ['"X"|"Y"'] = {src4, src5, src6}, + ['"X"'] = {src7, src8, src9}, + }, + locals = { + ['7'] = {src10}, + ['7|"x"'] = {src11}, + }, + tfield = { + ['11|"k"'] = {src12}, + }, +} + + -- cgit v1.2.3