summaryrefslogtreecommitdiff
path: root/src/lisp/ao_lisp.h
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-11-10 23:25:56 -0800
committerKeith Packard <keithp@keithp.com>2016-11-17 22:18:39 -0800
commit2ed769dae3f003951924be9e3a392fd6024a8d5e (patch)
tree1dcbf9833baeeb5a6d809e6505d1eea1e702e5e4 /src/lisp/ao_lisp.h
parentdd2382eb2185735822a0036ba0ef436869a71922 (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.h')
-rw-r--r--src/lisp/ao_lisp.h2
1 files changed, 2 insertions, 0 deletions
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;