diff options
author | Keith Packard <keithp@keithp.com> | 2016-11-10 23:25:56 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2016-11-17 22:18:39 -0800 |
commit | 2ed769dae3f003951924be9e3a392fd6024a8d5e (patch) | |
tree | 1dcbf9833baeeb5a6d809e6505d1eea1e702e5e4 /src/lisp/ao_lisp_rep.c | |
parent | dd2382eb2185735822a0036ba0ef436869a71922 (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; |