mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-28 00:59:31 +00:00
LuaJIT compatibility
Spoiler alert: Anselme run ~1.5x slower in LuaJIT than Lua 5.3/5.4. I didn't expected LuaJIT to be able to optimize anything with my super performant and cache friendly AST walker interpreter, but being this much slower is kinda impressive.
This commit is contained in:
parent
82ce53be83
commit
809613ef8b
8 changed files with 27 additions and 6 deletions
|
|
@ -1,4 +1,5 @@
|
|||
local class = require("class")
|
||||
local utf8 = utf8 or require("lua-utf8")
|
||||
|
||||
local Source
|
||||
Source = class {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
--- transform raw code string into a nested tree of lines
|
||||
|
||||
local utf8 = utf8 or require("lua-utf8")
|
||||
|
||||
local Source = require("parser.Source")
|
||||
|
||||
local function indented_to_tree(indented)
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ comment = primary {
|
|||
subcomment, rem = comment:parse(source, rem, limit_pattern)
|
||||
|
||||
table.insert(content_list, "((")
|
||||
for _, c in ipairs(subcomment) do table.insert(content_list, c) end
|
||||
table.insert(content_list, subcomment)
|
||||
table.insert(content_list, "))")
|
||||
-- no end token after the comment
|
||||
elseif not rem:match("^%)%)") then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue