projects
/
vvhitespace
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Changed jump-if-tos-is-zero and jump-if-tos-is-negative to consume the test
[vvhitespace]
/
vv_interpreter.c
diff --git
a/vv_interpreter.c
b/vv_interpreter.c
index
dd72781
..
7705319
100644
(file)
--- a/
vv_interpreter.c
+++ b/
vv_interpreter.c
@@
-286,13
+286,11
@@
process_imp_flowcontrol(uint8_t * code, size_t * pc, int32_t ** sp, uint32_t * l
switch (next_code_byte(code,pc)) {
case ' ':
/* Jump to a label if TOS == 0 */
switch (next_code_byte(code,pc)) {
case ' ':
/* Jump to a label if TOS == 0 */
- /* TODO: Does WS pop or peek the TOS? */
- if (stack_peek(sp,0) == 0) *pc = labels[parse_label(code, pc)];
+ if (stack_pop(sp) == 0) *pc = labels[parse_label(code, pc)];
break;
case '\t':
/* Jump to a label if TOS < 0. */
break;
case '\t':
/* Jump to a label if TOS < 0. */
- /* TODO: Does WS pop or peek the TOS? */
- if (stack_peek(sp,0) < 0) *pc = labels[parse_label(code, pc)];
+ if (stack_pop(sp) < 0) *pc = labels[parse_label(code, pc)];
break;
case '\n':
/* Return from subroutine. */
break;
case '\n':
/* Return from subroutine. */