Booli command
This commit is contained in:
@@ -69,7 +69,7 @@ def generateCode(line: list[str], offset: int) -> str:
|
|||||||
returnval = '>' * (offset + idx) + '[' + '<' * idx + '<+<+>>' + '>' * idx + '-]'
|
returnval = '>' * (offset + idx) + '[' + '<' * idx + '<+<+>>' + '>' * idx + '-]'
|
||||||
returnval += '<' * idx + '<[->' + '>' * idx + '+' + '<' * idx + '<]<'
|
returnval += '<' * idx + '<[->' + '>' * idx + '+' + '<' * idx + '<]<'
|
||||||
|
|
||||||
returnval += '[->>[>]'
|
returnval += '[[-]>>[>]'
|
||||||
for var in variables:
|
for var in variables:
|
||||||
if var.bytes >= 0:
|
if var.bytes >= 0:
|
||||||
returnval += '>' * (var.bytes+1)
|
returnval += '>' * (var.bytes+1)
|
||||||
@@ -87,6 +87,7 @@ def generateCode(line: list[str], offset: int) -> str:
|
|||||||
error()
|
error()
|
||||||
returnval += '<[<]<]'
|
returnval += '<[<]<]'
|
||||||
returnval += '<' * (offset-2)
|
returnval += '<' * (offset-2)
|
||||||
|
variables.append(Variable(line[1], 1, 0))
|
||||||
return returnval
|
return returnval
|
||||||
elif keyword == 'string':
|
elif keyword == 'string':
|
||||||
if len(line) != 4:
|
if len(line) != 4:
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ Create a string: `string name value bytes`
|
|||||||
|
|
||||||
Create a boolean: `bool name value`
|
Create a boolean: `bool name value`
|
||||||
|
|
||||||
|
Create a boolean from input byte: `booli name byte`
|
||||||
|
|
||||||
Create an integer: `int name value`
|
Create an integer: `int name value`
|
||||||
|
|
||||||
**Note**: A string of dynamic length can be created by setting the bytes to -1.
|
**Note**: A string of dynamic length can be created by setting the bytes to -1.
|
||||||
|
|||||||
@@ -1,13 +1,2 @@
|
|||||||
int num1 796
|
booli cond 1
|
||||||
string str1 -1 "Hello, world!"
|
bool cond2 true
|
||||||
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
|
|
||||||
Reference in New Issue
Block a user