diff --git a/src/main.py b/src/main.py index 0b84ae4..c530bdf 100644 --- a/src/main.py +++ b/src/main.py @@ -3,7 +3,7 @@ from sys import argv file = open(argv[1]).readlines(); bfcode = "" def removeChar(str, char): - ans = 0 + ans = "" for i in str: if (i != char): ans += i @@ -23,10 +23,11 @@ def ord2(char): for i in file: if (i.split(" ")[0] == "create"): - i = removeEnd(i, 2) + if (i[len(i)-1] == "\n"): + i = removeEnd(i, 1) bfcode += ">>>>>>>>>>>>[[>>]>>]" - bytes = int(i.split("*", 1)[1].split("=", 1)[0]) + bytes = int(removeChar(i.split("*", 1)[1].split("=", 1)[0], " ")) a = i.split("=", 1)[1] if (a[0] == " "): diff --git a/tests/main.basm b/tests/main.basm index 58df710..50056d5 100644 --- a/tests/main.basm +++ b/tests/main.basm @@ -1,3 +1,3 @@ -create str *5= "Hello, world!" -create str *5= "World, hello!" -create str *6= "Sigma!" +create str *5 = "Hello, world!" +create str *5 = "World, hello!" +create str *6 = "Sigma!" \ No newline at end of file