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
|
if not weiter then
|
||||||
return false, "Command " .. befehl .. ": " .. ergebnis
|
return false, "Command " .. befehl .. ": " .. ergebnis
|
||||||
end
|
end
|
||||||
if ergebnis ~= nil then
|
if args
|
||||||
|
and ergebnis ~= nil then
|
||||||
if type(ergebnis) ~= "table" then
|
if type(ergebnis) ~= "table" then
|
||||||
ergebnis = {ergebnis}
|
ergebnis = {ergebnis}
|
||||||
end
|
end
|
||||||
for i,v in pairs(ergebnis) do
|
for i,v in pairs(ergebnis) do
|
||||||
if not ersetzbar[i] then
|
if args[i]
|
||||||
-- message sometimes incorrect
|
and ersetzbar[i] then
|
||||||
return false, "Command " .. befehl .. ": Attempt on changing an immediate"
|
vars[args[i]] = v
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
faden.ip = faden.ip + 1
|
faden.ip = faden.ip + 1
|
||||||
|
|
|
@ -237,7 +237,7 @@ s = {
|
||||||
if type(p) ~= "number" then
|
if type(p) ~= "number" then
|
||||||
return false, UAT
|
return false, UAT
|
||||||
end
|
end
|
||||||
subsucc,msg = s.usleep({p * 1000000}, faden)
|
local subsucc,msg = s.usleep({p * 1000000}, faden)
|
||||||
if not subsucc then
|
if not subsucc then
|
||||||
return false, SE .. msg
|
return false, SE .. msg
|
||||||
end
|
end
|
||||||
|
|
|
@ -62,7 +62,7 @@ o = o .. "\n\nInstructions:\n\n"
|
||||||
for i = 1,#instr do
|
for i = 1,#instr do
|
||||||
i = instr[i]
|
i = instr[i]
|
||||||
o = o .. i[1] .. " " .. i[2] .. "\n"
|
o = o .. i[1] .. " " .. i[2] .. "\n"
|
||||||
.. " " .. i[3] .. "\n\n"
|
.. " " .. i[3] .. "\n\n" -- TODO: max 80 letters each line
|
||||||
end
|
end
|
||||||
|
|
||||||
print(o)
|
print(o)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user