From b6017106abe754c596efe208554e98efc0248662 Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Wed, 27 Oct 2010 19:23:35 +0100 Subject: [PATCH] Make (read-elisp) handle EOF * module/language/elisp/parser.scm (get-expression): Handle the case where a top level lex returns *eoi*. --- module/language/elisp/parser.scm | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/module/language/elisp/parser.scm b/module/language/elisp/parser.scm index 4d9b0c3..bb495ea 100644 --- a/module/language/elisp/parser.scm +++ b/module/language/elisp/parser.scm @@ -171,7 +171,7 @@ (define (get-expression lex) (let* ((token (lex 'get)) - (type (car token)) + (type (if (pair? token) (car token) token)) (return (lambda (result) (if (pair? result) (set-source-properties! result (source-properties token))) @@ -194,6 +194,8 @@ (setter expr) (force-promises! expr) expr)) + ((*eoi*) + (return token)) (else (parse-error token "expected expression, got" token))))) -- 1.7.1