diff options
Diffstat (limited to 'foci.c')
-rw-r--r-- | foci.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -16,7 +16,6 @@ #include "foci.h" -#include <stdio.h> // puts #include <stdlib.h> // strtol #include <string.h> // strncmp @@ -48,8 +47,7 @@ NAKED void compname(void) STASH; for (;;) { - extern int getchar(void); - ch = getchar(); + ch = foci_getchar(); if (ch <= 0x20) break; @@ -105,8 +103,7 @@ N(b, "_b", &w_literal) { ++pp; pp = (intptr_t **)*pp; NEXT; } N(bz, "_bz", &w_literal) { ++pp; if (!*sp++) { pp = (intptr_t **)*pp; } NEXT; } I(fif, "if", &w_b) LIT(bz), comma, FTH(here), LIT(0), comma, END I(then, "then", &w_fif) FTH(here), LIT(sizeof(intptr_t)), sub, swap, poke, END -I(felse, "else", &w_then) LIT(b), comma, FTH(here), LIT(0), comma, swap, - FTH(here), LIT(sizeof(intptr_t)), sub, swap, poke, END +I(felse, "else", &w_then) LIT(b), comma, FTH(here), LIT(0), comma, swap, FTH(then), END #define LATEST &w_felse void call(void *ptr) @@ -141,7 +138,9 @@ void parse_word(const char *buf, const char *s) *--sp = n; } } else { - puts("word not found"); + const char *err = "word not found"; + while (*err) + foci_putchar(*err++); } } else { if (state && !(l->attr & ATTR_IMMEDIATE)) { |