1
0
mirror of https://github.com/HybridDog/pdisc.git synced 2025-07-02 16:20:41 +02:00

add getvar instruction, fix call (untested), make less work with strings and update documentation

M  README.md
M  standardbefehlssatz.lua
A  util/standartbefehlssatz_doc.lua
This commit is contained in:
Hybrid Dog
2016-12-31 17:16:16 +01:00
parent 5b1549498b
commit 1c9ed9a133
3 changed files with 132 additions and 5 deletions

View File

@ -12,6 +12,15 @@ s = {
return true, params[2]
end,
getvar = function(params, faden)
local p = params[1]
if type(p) ~= "string" then
return false, UAT
end
p = faden.vars[p]
return true, {p, params[2] and p ~= nil}
end,
add = function(params, faden)
if #params ~= 2 then
return false, WNOA
@ -144,7 +153,7 @@ s = {
if not subsucc then
return false, SE .. msg
end
subsucc,msg = s.jmp({msg}, faden)
subsucc,msg = s.jmp(msg, faden)
if not subsucc then
return false, SE .. msg
end
@ -194,8 +203,14 @@ s = {
return false, WNOA
end
local p1,p2 = unpack(params)
if type(p1) ~= "number"
or type(p2) ~= "number" then
local t1 = type(p1)
local t2 = type(p2)
if t1 ~= t2 then
return false, "different argument types"
end
if t1 ~= "number"
and t1 ~= "string" then
return false, UAT
end
return true, p1 < p2