diff options
author | Keith Packard <keithp@keithp.com> | 2016-11-10 23:25:56 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2017-02-20 11:16:50 -0800 |
commit | 92cdc0cf0e80c1ff3f31cce20fc2b9bda86e3638 (patch) | |
tree | 2480c8bc3baba89873aea4061796a91522a7f5fb /src/lisp/ao_lisp_rep.c | |
parent | fb710f7f4f24f74ac3d45fcc423803384d986bb2 (diff) |
altos/lisp: Make read() return eof atom on end of file
Also make it an exception to hit eof in the middle of an sexpr.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/lisp/ao_lisp_rep.c')
-rw-r--r-- | src/lisp/ao_lisp_rep.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lisp/ao_lisp_rep.c b/src/lisp/ao_lisp_rep.c index d780186a..ef7dbaf2 100644 --- a/src/lisp/ao_lisp_rep.c +++ b/src/lisp/ao_lisp_rep.c @@ -20,9 +20,8 @@ ao_lisp_read_eval_print(void) ao_poly in, out = AO_LISP_NIL; for(;;) { in = ao_lisp_read(); - if (!in) + if (in == _ao_lisp_atom_eof) break; -// printf ("in: "); ao_lisp_poly_print(in); printf("\n"); out = ao_lisp_eval(in); if (ao_lisp_exception) { ao_lisp_exception = 0; |