Properly evaluate the closing loop token
This commit is contained in:
parent
aff0b34061
commit
27ce3856cf
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue