From 2ed769dae3f003951924be9e3a392fd6024a8d5e Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 10 Nov 2016 23:25:56 -0800 Subject: 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 --- src/lisp/ao_lisp.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/lisp/ao_lisp.h') diff --git a/src/lisp/ao_lisp.h b/src/lisp/ao_lisp.h index d265ea7b..6122a2ed 100644 --- a/src/lisp/ao_lisp.h +++ b/src/lisp/ao_lisp.h @@ -42,6 +42,7 @@ extern uint8_t ao_lisp_const[AO_LISP_POOL_CONST]; #define _ao_lisp_atom_delay _atom("delay") #define _ao_lisp_atom_eval _atom("eval") #define _ao_lisp_atom_read _atom("read") +#define _ao_lisp_atom_eof _atom("eof") #else #include "ao_lisp_const.h" #ifndef AO_LISP_POOL @@ -76,6 +77,7 @@ extern uint16_t ao_lisp_top; #define AO_LISP_DIVIDE_BY_ZERO 0x02 #define AO_LISP_INVALID 0x04 #define AO_LISP_UNDEFINED 0x08 +#define AO_LISP_EOF 0x10 extern uint8_t ao_lisp_exception; -- cgit v1.2.3