I'm extremely confused about this error. All I'm trying to do is use the match function but I keep getting a syntax error even though I believe there's nothing wrong with this.
Here's my code:
def compile(code):
code_ptr = 0;
mem_ptr = 0;
memory = [0] * 1000
loop = []
while code_ptr > len(code):
command = code[code_ptr]
match command:
case '>':
mem_ptr += 1
case '<':
mem_ptr -= 1
case: '+':
memory[mem_ptr] + 1
case '-':
memory[mem_ptr] - 1
code_ptr += 1
print(memory)
Here's the error:
match command:
^
SyntaxError: invalid syntax
I'm running Python 3.8.5