1
0
mirror of https://github.com/HybridDog/pdisc.git synced 2025-07-01 07:40:39 +02:00

allow discarding the return values of instructions

M  faden.lua
M  standardbefehlssatz.lua
M  util/standartbefehlssatz_doc.lua
This commit is contained in:
Hybrid Dog
2017-01-03 14:44:06 +01:00
parent fd15773adb
commit e70f51aa32
3 changed files with 7 additions and 11 deletions

View File

@ -27,20 +27,16 @@ local function befehl_ausfuhren(faden)
if not weiter then
return false, "Command " .. befehl .. ": " .. ergebnis
end
if ergebnis ~= nil then
if args
and ergebnis ~= nil then
if type(ergebnis) ~= "table" then
ergebnis = {ergebnis}
end
for i,v in pairs(ergebnis) do
if not ersetzbar[i] then
-- message sometimes incorrect
return false, "Command " .. befehl .. ": Attempt on changing an immediate"
if args[i]
and ersetzbar[i] then
vars[args[i]] = v
end
if not args[i] then
-- can this happen? Is it a mistake in instruction set? bef ,b,,d
return false, "Command " .. befehl .. ": Missing target argument"
end
vars[args[i]] = v
end
end
faden.ip = faden.ip + 1