~technomancy/antifennel

883f18a38f85838e23ca4c16e7ca1b92648d2e91 — Phil Hagelberg 1 year, 16 days ago 00a9735
Add a test for a global function.
2 files changed, 4 insertions(+), 0 deletions(-)

M test.lua
M test_expected.fnl
M test.lua => test.lua +2 -0
@@ 8,6 8,8 @@ local function _()
   ids[k] = ast:var_declare(vlist[k])
end

function abc(x) return x+9 end

local function noprint() end

SCREAMING_SNAKE = true

M test_expected.fnl => test_expected.fnl +2 -0
@@ 7,6 7,8 @@
    (global foo bar)
    (tset ids k (ast:var_declare (. vlist k)))))

(fn _G.abc [x] (+ x 9))

(fn noprint [])

(global SCREAMING_SNAKE true)