Booli command

This commit is contained in:
2025-11-06 16:56:21 +11:00
parent bb635f1e94
commit 6105f8080d
3 changed files with 6 additions and 14 deletions

View File

@@ -69,7 +69,7 @@ def generateCode(line: list[str], offset: int) -> str:
returnval = '>' * (offset + idx) + '[' + '<' * idx + '<+<+>>' + '>' * idx + '-]'
returnval += '<' * idx + '<[->' + '>' * idx + '+' + '<' * idx + '<]<'
returnval += '[->>[>]'
returnval += '[[-]>>[>]'
for var in variables:
if var.bytes >= 0:
returnval += '>' * (var.bytes+1)
@@ -87,6 +87,7 @@ def generateCode(line: list[str], offset: int) -> str:
error()
returnval += '<[<]<]'
returnval += '<' * (offset-2)
variables.append(Variable(line[1], 1, 0))
return returnval
elif keyword == 'string':
if len(line) != 4:

View File

@@ -6,6 +6,8 @@ Create a string: `string name value bytes`
Create a boolean: `bool name value`
Create a boolean from input byte: `booli name byte`
Create an integer: `int name value`
**Note**: A string of dynamic length can be created by setting the bytes to -1.

View File

@@ -1,13 +1,2 @@
int num1 796
string str1 -1 "Hello, world!"
int num2 795
string str2 -1 "World, hello?"
equal num1 num2 cond
if cond
print str1
end if
inc num2
equal num1 num2 cond2
if cond2
print str2
end if
booli cond 1
bool cond2 true