mirror of
https://github.com/HybridDog/pdisc.git
synced 2025-01-23 15:30:16 +01:00
Fix true and false
This commit is contained in:
parent
adc39aeb7f
commit
2c3f1edd81
@ -8,6 +8,7 @@ true/false: boolean (immediate)
|
|||||||
12.6: number (immediate)
|
12.6: number (immediate)
|
||||||
$hello nwae: string (immediate)
|
$hello nwae: string (immediate)
|
||||||
nodolla: either a label is called so (immediate) or it's a variable
|
nodolla: either a label is called so (immediate) or it's a variable
|
||||||
|
If you want to use : in a string, you need to put it at the beginning of the line to not treat the left part as label
|
||||||
|
|
||||||
```
|
```
|
||||||
Types:
|
Types:
|
||||||
|
@ -37,9 +37,9 @@ local function parse_zeile(marken, imms, z, ip)
|
|||||||
local arg = args[i]:trim()
|
local arg = args[i]:trim()
|
||||||
if #arg == 0
|
if #arg == 0
|
||||||
or arg == "false" then
|
or arg == "false" then
|
||||||
arg = false
|
arg = -1
|
||||||
elseif arg == "true" then
|
elseif arg == "true" then
|
||||||
arg = true
|
arg = -2
|
||||||
elseif arg:sub(1, 1) == "$" then
|
elseif arg:sub(1, 1) == "$" then
|
||||||
imms[immn] = arg:sub(2)
|
imms[immn] = arg:sub(2)
|
||||||
arg = immn
|
arg = immn
|
||||||
@ -74,7 +74,7 @@ local function zeileniter(text)
|
|||||||
end
|
end
|
||||||
|
|
||||||
return function(programm)
|
return function(programm)
|
||||||
local imms = {}
|
local imms = {[-2] = true, [-1] = false}
|
||||||
local marken = {}
|
local marken = {}
|
||||||
|
|
||||||
-- Programm erkennen
|
-- Programm erkennen
|
||||||
|
@ -31,7 +31,7 @@ local instr = {
|
|||||||
{"neg", "<vb var>", "var = not var"},
|
{"neg", "<vb var>", "var = not var"},
|
||||||
{"neg", "<vs str>", "str = str:rev()"},
|
{"neg", "<vs str>", "str = str:rev()"},
|
||||||
{"inv", "<vn num>", "num = 1 / num"},
|
{"inv", "<vn num>", "num = 1 / num"},
|
||||||
{"mod", "<vn num>, <n dv>", "num = num % dv"},
|
{"mod", "<vn num>, <n dv>", "num = num mod dv"},
|
||||||
{"jmp", "<ui p>[, <e c>]", "If c is not false, the instruction pointer is set to p. To disallow infinite loops, the program is interrupted after changing the ip, the mod should then consider restarting it."},
|
{"jmp", "<ui p>[, <e c>]", "If c is not false, the instruction pointer is set to p. To disallow infinite loops, the program is interrupted after changing the ip, the mod should then consider restarting it."},
|
||||||
{"call", "<ui p>[, <e c>]", "push the ip, then jmp p; used to execute subroutines"},
|
{"call", "<ui p>[, <e c>]", "push the ip, then jmp p; used to execute subroutines"},
|
||||||
{"ret", "", "pop something, then jmp there; used to exit subroutines"},
|
{"ret", "", "pop something, then jmp there; used to exit subroutines"},
|
||||||
|
Loading…
Reference in New Issue
Block a user