Skip to content

Commit

Permalink
running tests with luajit
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroflag committed Feb 3, 2025
1 parent de8c2fe commit 3d4cabf
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
LUA54 = lua5.4
LUA51 = lua5.1
LUA_VERSIONS := $(LUA54) $(LUA51) lua
LUA_VERSIONS := $(LUA54) $(LUA51) luajit lua
SRC_DIR = src
TEST_DIR = tests
TEST_LUA_FILES = $(wildcard $(TEST_DIR)/test_*.lua)
Expand Down
14 changes: 7 additions & 7 deletions src/codegen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ function CodeGen:gen(ast)
return "a" .. ast.op .. "()"
end
if "push" == ast.name then
--if ast.item.name == "literal" or
-- lit_bin_op(ast.item) or
-- lit_unary_op(ast.item)
--then
-- return inline_push(self:gen(ast.item)) -- bypass NIL check
--else
if ast.item.name == "literal" or
lit_bin_op(ast.item) or
lit_unary_op(ast.item)
then
return inline_push(self:gen(ast.item)) -- bypass NIL check
else
return string.format("push(%s)", self:gen(ast.item))
--end
end
end
if "push_many" == ast.name then
return string.format("push_many(%s)", self:gen(ast.func_call))
Expand Down
17 changes: 9 additions & 8 deletions src/equinox_bundle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -644,14 +644,15 @@ function CodeGen:gen(ast)
return "a" .. ast.op .. "()"
end
if "push" == ast.name then
--if ast.item.name == "literal" or
-- lit_bin_op(ast.item) or
-- lit_unary_op(ast.item)
--then
-- return inline_push(self:gen(ast.item)) -- bypass NIL check
--else
-- TODO breaks red alert, might be a jit problem
if ast.item.name == "literal" or
lit_bin_op(ast.item) or
lit_unary_op(ast.item)
then
return inline_push(self:gen(ast.item)) -- bypass NIL check
else
return string.format("push(%s)", self:gen(ast.item))
--end
end
end
if "push_many" == ast.name then
return string.format("push_many(%s)", self:gen(ast.func_call))
Expand Down Expand Up @@ -3081,7 +3082,7 @@ return utils
end
end

__VERSION__="0.1-99"
__VERSION__="0.1-106"

local Compiler = require("compiler")
local Optimizer = require("ast_optimizer")
Expand Down
2 changes: 1 addition & 1 deletion src/version/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1-99
0.1-106

0 comments on commit 3d4cabf

Please sign in to comment.