This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- stable sorting routines for lua | |
-- | |
-- modifies the global table namespace so you don't have | |
-- to re-require it everywhere. | |
-- | |
-- table.stable_sort | |
-- a fast stable sort | |
-- table.unstable_sort | |
-- alias for the builtin unstable table.sort | |
-- table.insertion_sort |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setmetatable(_ENV, { __index=lpeg }) | |
VARS = {} | |
function eval(...) | |
local args = {...} | |
local accum = args[1] | |
for i = 2, #args, 2 do | |
local operator = args[i] | |
local num2 = args[i+1] |