Properly evaluate the closing loop token

This commit is contained in:
Nick Chambers 2024-04-08 03:49:54 -05:00
parent aff0b34061
commit 27ce3856cf
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ uint16_t compile(const char *prog, uint8_t *tape, uint16_t tape_len, uint8_t **i
traveled = compile(prog + 1, tape, tape_len, idx, should_eval);
} else if(*prog == ']') {
if(**idx > 0) {
if(eval && **idx > 0) {
return 0;
} else {
return elapsed + 1;