~technomancy/antifennel

c4b26dd126b05e786a58a5dec8a58b401f0acee7 — Phil Hagelberg 5 months ago 21537dd
Support multiple values in local declaration.
2 files changed, 6 insertions(+), 5 deletions(-)

M Makefile
M anticompiler.fnl
M Makefile => Makefile +3 -2
@@ 1,4 1,5 @@
LUA_FILES=$(glob lang/*.lua)
LUA_FILES=lang/id_generator.lua lang/lua_ast.lua lang/operator.lua \
		lang/reader.lua lang/lexer.lua lang/parser.lua

test:
	luajit antifennel.lua antifennel.lua


@@ 6,4 7,4 @@ test:
lang/%.fnl: lang/%.lua
	luajit antifennel.lua $< > $@

.PHONY: test
.PHONY: test all

M anticompiler.fnl => anticompiler.fnl +3 -3
@@ 29,9 29,9 @@
        (if (= 1 (# names))
            (sym (. names 1 :name))
            (list (unpack (map names compile))))
        ;; TODO: support multiple values
        (and (. expressions 1)
             (compile (. expressions 1)))))
        (if (= 1 (# expressions))
            (compile (. expressions 1))
            (list (sym :values) (unpack (map expressions compile))))))

(fn vals [compile {: arguments}]
  (if (= 1 (# arguments))