diff --git a/compiler.lua b/compiler.lua index 8258a53..dcd0e9d 100644 --- a/compiler.lua +++ b/compiler.lua @@ -39,7 +39,7 @@ function compiler.next(self) return self.input:next() end -function compiler.emit_string(self, token) +function compiler.emit_lit(self, token) self:emit_line("ops.lit(" .. token .. ")") end @@ -51,10 +51,6 @@ function compiler.emit_word(self, word) end end -function compiler.emit_number(self, num) - self:emit_line("ops.lit(" .. num .. ")") -end - function compiler.emit_lua_call(self, name, arity, vararg) if vararg then error(name .. " has variable number of arguments." .. @@ -73,7 +69,7 @@ end function compiler.compile_token(self, token, kind) if kind == "string" then - self:emit_string(token) + self:emit_lit(token) else local word = dict.find(token) if word then @@ -81,7 +77,7 @@ function compiler.compile_token(self, token, kind) else local num = tonumber(token) if num then - self:emit_number(num) + self:emit_lit(num) else local res = interop.resolve_lua_func_with_arity(token) if res then