M Makefile => Makefile +4 -1
@@ 73,4 73,7 @@ install: antifennel
uninstall:
rm -f $(DESTDIR)$(BIN_DIR)/antifennel
-.PHONY: test self clean ci update update-fennel update-tests install
+check:
+ fennel-ls --check anticompiler.fnl letter.fnl
+
+.PHONY: test self clean ci update update-fennel update-tests install check
M antifennel.lua => antifennel.lua +2 -1
@@ 51,7 51,7 @@ local function compile(rdr, filename, comments)
local ls = lex_setup(rdr, filename, comments)
local ast_builder = lua_ast.New(mangle)
local ast_tree = parse(ast_builder, ls)
- return letter(compiler(nil, ast_tree))
+ return letter.compile(compiler(nil, ast_tree))
end
if debug and debug.getinfo and debug.getinfo(3) == nil then -- run as a script
@@ 71,6 71,7 @@ if debug and debug.getinfo and debug.getinfo(3) == nil then -- run as a script
print(fnlfmt.fnlfmt(code) .. "\n")
end
else
+ print("Antifennel version 0.3.0-dev.")
print(("Usage: %s [--comments] LUA_FILENAME"):format(arg[0]))
print("Compiles LUA_FILENAME to Fennel and prints output.")
os.exit(1)
M antifennel_expected.fnl => antifennel_expected.fnl +2 -1
@@ 54,7 54,7 @@
(let [ls (lex-setup rdr filename comments)
ast-builder (lua-ast.New mangle)
ast-tree (parse ast-builder ls)]
- (letter (compiler nil ast-tree))))
+ (letter.compile (compiler nil ast-tree))))
(if (and (and debug debug.getinfo) (= (debug.getinfo 3) nil))
(let [;; run as a script
@@ 69,6 69,7 @@
comments))]
(print (.. (fnlfmt.fnlfmt code) "\n"))))
(do
+ (print "Antifennel version 0.3.0-dev.")
(print (: "Usage: %s [--comments] LUA_FILENAME" :format (. arg 0)))
(print "Compiles LUA_FILENAME to Fennel and prints output.")
(os.exit 1))))
M letter.fnl => letter.fnl +1 -2
@@ 82,5 82,4 @@ When f returns a truthy value, recursively walks the children."
(values i v))))
(values iter t (+ (# t) 1)))
-(fn compile [ast]
- (walk-tree ast letter reverse-ipairs))
+{:compile (fn [ast] (walk-tree ast letter reverse-ipairs))}