mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-18 03:36:47 -04:00
more local
This commit is contained in:
parent
2dac42303e
commit
65e7707df0
@ -11,7 +11,7 @@ local term = require("term")
|
|||||||
local text = require("text")
|
local text = require("text")
|
||||||
local unicode = require("unicode")
|
local unicode = require("unicode")
|
||||||
|
|
||||||
function expandParam(param)
|
local function expandParam(param)
|
||||||
local par, word, op = nil, nil, nil
|
local par, word, op = nil, nil, nil
|
||||||
for _, oper in ipairs{':%-', '%-', ':=', '=', ':%?','%?', ':%+', '%+'} do
|
for _, oper in ipairs{':%-', '%-', ':=', '=', ':%?','%?', ':%+', '%+'} do
|
||||||
par, word = param:match("(.-)"..oper.."(.*)")
|
par, word = param:match("(.-)"..oper.."(.*)")
|
||||||
@ -86,11 +86,11 @@ function expandParam(param)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function expandCmd(cmd)
|
local function expandCmd(cmd)
|
||||||
return cmd
|
return cmd
|
||||||
end
|
end
|
||||||
|
|
||||||
function expandMath(expr)
|
local function expandMath(expr)
|
||||||
local success, reason = load("return "..expr, os.getenv("SHELL"), 't', {})
|
local success, reason = load("return "..expr, os.getenv("SHELL"), 't', {})
|
||||||
if success then
|
if success then
|
||||||
return success()
|
return success()
|
||||||
@ -99,7 +99,7 @@ function expandMath(expr)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function expand(token)
|
local function expand(token)
|
||||||
local expr = {}
|
local expr = {}
|
||||||
local matchStack = {}
|
local matchStack = {}
|
||||||
local escaped = false
|
local escaped = false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user