diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2025-01-26 20:33:20 -0500 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2025-01-26 20:33:20 -0500 |
commit | eb3ea1994428e25e4866afb0ca6ad4edfce5ae8c (patch) | |
tree | ad1145464172ae38398d7aa77d49a950dac27c98 /main.c | |
parent | 9307097160390b384907c193aca0d6703ab63516 (diff) |
interpret entirely in foci
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 23 |
1 files changed, 2 insertions, 21 deletions
@@ -33,30 +33,11 @@ int foci_getchar(void) int main() { - char buf[128]; - init(); for (;;) { - char c; - do c = getchar(); - while (!isgraph(c)); - - char *s = buf; - do { - *s++ = c; - c = getchar(); - } while (isgraph(c)); - bool eol = c == '\n' || c == '\r'; - *s = '\0'; - - if (strcmp(buf, "bye") == 0) - break; - - parse_word(buf, s); - - if (eol) - printf(compiling() ? "compiled <%d>\n" : "ok <%d>\n", depth()); + interpret(); + printf(compiling() ? "compiled <%d>\n" : "ok <%d>\n", depth()); } return 0; |