forked from mtcontrib/pdisc
allow discarding the return values of instructions
M faden.lua M standardbefehlssatz.lua M util/standartbefehlssatz_doc.lua
This commit is contained in:
parent
fd15773adb
commit
e70f51aa32
14
faden.lua
14
faden.lua
|
@ -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
|
||||
|
|
|
@ -237,7 +237,7 @@ s = {
|
|||
if type(p) ~= "number" then
|
||||
return false, UAT
|
||||
end
|
||||
subsucc,msg = s.usleep({p * 1000000}, faden)
|
||||
local subsucc,msg = s.usleep({p * 1000000}, faden)
|
||||
if not subsucc then
|
||||
return false, SE .. msg
|
||||
end
|
||||
|
|
|
@ -62,7 +62,7 @@ o = o .. "\n\nInstructions:\n\n"
|
|||
for i = 1,#instr do
|
||||
i = instr[i]
|
||||
o = o .. i[1] .. " " .. i[2] .. "\n"
|
||||
.. " " .. i[3] .. "\n\n"
|
||||
.. " " .. i[3] .. "\n\n" -- TODO: max 80 letters each line
|
||||
end
|
||||
|
||||
print(o)
|
||||
|
|
Loading…
Reference in New Issue
Block a user