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
ca2f772
..
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. */
@@
-440,8
+438,6
@@
main(int argc, char ** argv)
exit(EXIT_FAILURE);
unset_terminal_mode();
}
exit(EXIT_FAILURE);
unset_terminal_mode();
}
-// TODO: Have the SIGTERM signal handler and normal term point return the value
-// on TOS so I can do rudimentary automated tests.
/* Decode the IMPs */
switch (ws_code_space[pc++]) {
/* Decode the IMPs */
switch (ws_code_space[pc++]) {