From 6812e31904d8964675f372c7324a264c03da241a Mon Sep 17 00:00:00 2001 From: heavpoot Date: Fri, 29 Jan 2021 23:08:51 +0000 Subject: [PATCH] add path at the top of the file apioforms --- src/xlib/03_heavlisp.lua | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/xlib/03_heavlisp.lua b/src/xlib/03_heavlisp.lua index 63f5185..ef214c2 100644 --- a/src/xlib/03_heavlisp.lua +++ b/src/xlib/03_heavlisp.lua @@ -1,3 +1,11 @@ +local path = { + "", + "/heavlisp_lib/", + "/rom/heavlisp_lib/", + "/lib/", + "/rom/lib/", + "lib/", +} if not unpack then unpack = table.unpack end function deepclone(t) local res={} @@ -463,7 +471,11 @@ function interpret(ast,imports) if y and y.type=="string" then namespace=y.value.."_" end - local f=io.open(x.value,"r") + local f + for _,v in ipairs(path) do + f=io.open(v..x.value,"r") + if f then break end + end if not f then return {type="bool",value=false} end -- 2.47.0