commit 2c03e51a3f90198a4432228d3b1958adca43ea01
parent 748a1a9e59a4a46546f8a37f95e7d3a547a39ffe
Author: Andres Navarro <canavarro82@gmail.com>
Date: Mon, 14 Nov 2011 20:45:57 -0300
Added extra error msg for unmatched '|#'.
Diffstat:
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/ktoken.c b/src/ktoken.c
@@ -346,9 +346,18 @@ TValue ktok_read_token(klisp_State *K)
case '|':
/* TODO put special error msg if it was an unpaired '|#'
comment close */
+ ktok_getc(K);
+ chi = ktok_peekc(K);
+ if (chi == EOF || chi != '#')
+ goto unrecognized_error;
+ ktok_getc(K);
+ ktok_error(K, "unmatched |# found");
+ /* avoid warning */
+ return KINERT;
default:
ktok_getc(K);
/* TODO add char to error */
+ unrecognized_error:
ktok_error(K, "unrecognized token starting char");
/* avoid warning */
return KINERT;