summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorSudipto Mallick <smlckz.dev@gmail.com>2021-03-13 14:06:10 +0000
committerSudipto Mallick <smlckz.dev@gmail.com>2021-03-13 14:06:10 +0000
commit5cf9c90f53b79ed147eb28377a5a94e2abdc5df8 (patch)
treed2b66c5fb9999727c634777d67b9a1d9a6acb27f
parent2cf00dc4ccfbb6bf1de8c4e6894cfb7908601685 (diff)
downloadlith-main.tar.gz
add error for unclosed lists HEAD main
-rw-r--r--lith.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lith.c b/lith.c
index 400149c..8d2947c 100644
--- a/lith.c
+++ b/lith.c
@@ -190,7 +190,12 @@ static lith_value *read_list_expr(lith_st *L, char *start, char **end)
     list = p = L->nil;
     for (;;) {
         lex(L, *end, &t, end);
-        if (LITH_IS_ERR(L)) return NULL;
+        if (LITH_IS_ERR(L)) {
+            if (LITH_AT_END_NO_ERR(L))
+                lith_simple_error(L, LITH_ERR_EOF,
+                    "while reading a list");
+            return NULL;
+        }
         if (*t == ')') return list;
         if (*t == '.' && (*end - t == 1)) {
             if (LITH_IS_NIL(p)) {
ti/profani-tty/commit/src/chat_session.h?id=d339004f55b4620b611a668b4fad0703999f8a54'>d339004f ^
bee708c9 ^
d2be6929 ^
3c82fb28 ^


f8de2823 ^
5ce97728 ^






f8de2823 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47