mirror of
https://github.com/samsonjs/lake.git
synced 2026-03-25 08:55:49 +00:00
fix behaviour of parse errors
This commit is contained in:
parent
824f0eb0e2
commit
9161ca8c5d
2 changed files with 3 additions and 1 deletions
|
|
@ -75,6 +75,8 @@ static LakeVal *prompt_read(Env *env, char *prompt)
|
|||
/* try to parse a naked call without parens
|
||||
(makes the repl more palatable) */
|
||||
LakeList *list = parse_naked_list(buf, strlen(buf));
|
||||
if (!list) return NULL;
|
||||
|
||||
LakeVal *result;
|
||||
|
||||
/* naked call */
|
||||
|
|
|
|||
|
|
@ -82,8 +82,8 @@ LakeList *parse_naked_list(char *s, size_t n)
|
|||
LakeVal *val = _parse_expr(&ctx);
|
||||
if (val == VAL(PARSE_ERR)) {
|
||||
list_free(list);
|
||||
list = NULL;
|
||||
ctx.i = ctx.n;
|
||||
return NULL;
|
||||
}
|
||||
list_append(list, val);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue