mirror of
https://github.com/emptyynes/LIVM.git
synced 2025-01-04 23:52:25 +03:00
9 lines
333 B
Lua
9 lines
333 B
Lua
|
local f = io.open("opcodelist")
|
||
|
local opcodes, reopcodes = {}, {}
|
||
|
for line in f:lines() do if #line > 0 then opcodes[#opcodes + 1] = line end end
|
||
|
f:close()
|
||
|
for k, v in pairs(opcodes) do reopcodes[v] = k end
|
||
|
return {
|
||
|
getName = function(index) return opcodes[index + 1] end,
|
||
|
getIndex = function(name) return reopcodes[name] - 1 end
|
||
|
}
|