mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-17 11:15:12 -04:00
Small fixes to make besh work again
This commit is contained in:
parent
d5bd34b76d
commit
70faea9516
@ -173,10 +173,11 @@ expand = function(token)
|
||||
table.insert(matchStack, "'")
|
||||
lastEnd = i+1
|
||||
elseif char == "$" and not singleQuote then
|
||||
table.insert(expr, {})
|
||||
if #expr <= 0 then
|
||||
table.insert(endToken, unicode.sub(token, lastEnd, i-1))
|
||||
end
|
||||
table.insert(expr, {})
|
||||
lastEnd = i -1
|
||||
elseif char == '{' and #expr > 0 and #(expr[#expr]) == 0 then
|
||||
table.insert(matchStack, '}')
|
||||
if expr[#expr] == 0 then
|
||||
@ -207,8 +208,9 @@ expand = function(token)
|
||||
while #expr > 0 do
|
||||
local xpr = table.remove(expr)
|
||||
table.insert(expr[#expr] or endToken, os.getenv(table.concat(xpr)))
|
||||
lastEnd = #token + 1
|
||||
end
|
||||
if lastEnd >= #token then
|
||||
if lastEnd <= #token then
|
||||
table.insert(endToken, unicode.sub(token, lastEnd, -1))
|
||||
end
|
||||
return table.concat(endToken)
|
||||
|
Loading…
x
Reference in New Issue
Block a user