diff --git a/src/codegen.py b/src/codegen.py index 1121301..8f04631 100644 --- a/src/codegen.py +++ b/src/codegen.py @@ -173,7 +173,6 @@ def generateCode(line: list[str], offset: int) -> str: return returnval elif keyword == 'inc': - warn('Increment not correctly implemented yet, do not use this command.') returnval = '>' * offset + '[>]' idx = getIndex(line[1]) for var in variables[:idx]: @@ -228,7 +227,6 @@ def generateCode(line: list[str], offset: int) -> str: # Return to start returnval += '<<<<<' for var in reversed(variables[:idx]): - print(var.bytes) if var.bytes >= 0: returnval += '<' * (var.bytes+1) elif var.bytes == -1: diff --git a/syntax.md b/syntax.md index 44df2f4..4c8cd52 100644 --- a/syntax.md +++ b/syntax.md @@ -12,8 +12,10 @@ Create an integer: `int name value` Print a string: `print name` +Increment an int: `inc name` + Example program (prints "Hello, World"): -```cpp -string var 13 "Hello, world!" +```py +string var 13 "Hello, world!" # Or -1 bytes for a dynamic string print var ``` \ No newline at end of file diff --git a/tests/create.basm b/tests/create.basm index 1cd210c..cd900a7 100644 --- a/tests/create.basm +++ b/tests/create.basm @@ -1,11 +1,5 @@ string str1 13 "Hello, world!" -<<<<<<< HEAD string str2 -1 "Testing dynamic string!" int var -1 inc var -inc var -======= -int var 100000 -inc str1 -print var ->>>>>>> 89065711cea711879e4f0bfc53b3da3974590b8c +inc var \ No newline at end of file