diff --git a/Makefile b/Makefile index 8398415..4edeb02 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,3 @@ -LUA_LIB=/usr/lib/liblua.so.5.4 -LUA_INCLUDE_DIR=/usr/include/lua5.4 FENNEL=./fennel EXE=fennel-ls @@ -11,10 +9,13 @@ SRC+=$(wildcard src/fennel-ls/*.fnl) all: $(EXE) $(EXE): $(SRC) - LUA_PATH="./src/?.lua;./src/?/init.lua" FENNEL_PATH="./src/?.fnl;./src/?/init.fnl" $(FENNEL) --compile-binary src/fennel-ls.fnl fennel-ls $(LUA_LIB) $(LUA_INCLUDE_DIR) + echo "#!/usr/bin/env lua" > $@ + LUA_PATH="./src/?.lua;./src/?/init.lua" FENNEL_PATH="./src/?.fnl;./src/?/init.fnl" \ + $(FENNEL) --require-as-include --compile src/fennel-ls.fnl >> $@ + chmod 755 $@ clean: - rm -f fennel-ls + rm -f $(EXE) test: # requires busted to be installed diff --git a/src/fennel-ls/language.fnl b/src/fennel-ls/language.fnl index 88ad0e5..ef5ebe5 100644 --- a/src/fennel-ls/language.fnl +++ b/src/fennel-ls/language.fnl @@ -2,8 +2,7 @@ The high level analysis system that does deep searches following the data provided by compiler.fnl." -(local {: sym? : list? : sequence? : sym : view} (require :fennel)) -(local {: table?} (require :fennel.utils)) +(local {: sym? : list? : sequence? : varg? : sym : view} (require :fennel)) (local utils (require :fennel-ls.utils)) (local state (require :fennel-ls.state)) @@ -147,7 +146,7 @@ the data provided by compiler.fnl." &until result] (if (contains? child byte) (recurse child byte))) - (table? ast) + (and (not (sym? ast)) (not (varg? ast))) (accumulate [(result done) nil key value (pairs ast) &until done]