From 36b90075afd1cb56dd714ef4ce7b97ec9f8129e7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Kochma=C5=84ski?= Date: Fri, 18 Sep 2015 11:51:21 +0200 Subject: [PATCH] reader: fix backquote reader if the input is incomplete MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This makes behaviour consistent with single-quote reader. Fixes #159. Signed-off-by: Daniel Kochmański --- src/c/read.d | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/c/read.d b/src/c/read.d index 474f3b7..886f28c 100644 --- a/src/c/read.d +++ b/src/c/read.d @@ -483,12 +483,14 @@ cl_object backquote_reader(cl_object in, cl_object c) const cl_env_ptr the_env = ecl_process_env(); cl_fixnum backq_level = ecl_fixnum(ECL_SYM_VAL(the_env, @'si::*backq-level*')); ECL_SETQ(the_env, @'si::*backq-level*', ecl_make_fixnum(backq_level+1)); - in = ecl_read_object(in); + c = ecl_read_object(in); ECL_SETQ(the_env, @'si::*backq-level*', ecl_make_fixnum(backq_level)); + unlikely_if (c == OBJNULL) + FEend_of_file(in); #if 0 @(return cl_macroexpand_1(2, cl_list(2, @'si::quasiquote', in), ECL_NIL)); #else - @(return cl_list(2,@'si::quasiquote',in)) + @(return cl_list(2,@'si::quasiquote',c)) #endif } -- 2.9.0