iris

small scheme interpreter
git clone git://git.2f30.org/iris
Log | Files | Refs | LICENSE

commit 3c340b8114363a3af2fc8690a00bb4909bb63355
parent 991d52591bbb6827a9ebe07daf994426aada724f
Author: sin <sin@2f30.org>
Date:   Sun, 11 May 2014 16:35:02 +0100

Guard against unexpected EOF

Diffstat:
Mlexer.c | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/lexer.c b/lexer.c @@ -229,6 +229,12 @@ again: tok.e = NULL; return tok; } + if (state != State_Se) { + tok.type = Error; + tok.s = "unexpected EOF encountered"; + tok.e = NULL; + return tok; + } tok.type = Eof; tok.s = "reached the end-of-file"; tok.e = NULL;