mirror of
https://github.com/kanaka/mal.git
synced 2024-09-19 09:38:28 +03:00
Ada, C: fix step3 error handling.
New step3 tests were added during basic implementation that broke Ada and C.
This commit is contained in:
parent
2bcc46af48
commit
fba3aeb2fb
@ -1,4 +1,5 @@
|
||||
with Ada.Command_Line;
|
||||
with Ada.Exceptions;
|
||||
with Ada.Text_IO;
|
||||
with Envs;
|
||||
with Eval_Callback;
|
||||
@ -254,8 +255,15 @@ begin
|
||||
Init (Repl_Env);
|
||||
|
||||
loop
|
||||
Ada.Text_IO.Put ("user> ");
|
||||
exit when Ada.Text_IO.End_Of_File;
|
||||
Ada.Text_IO.Put_Line (Rep (Ada.Text_IO.Get_Line, Repl_Env));
|
||||
begin
|
||||
Ada.Text_IO.Put ("user> ");
|
||||
exit when Ada.Text_IO.End_Of_File;
|
||||
Ada.Text_IO.Put_Line (Rep (Ada.Text_IO.Get_Line, Repl_Env));
|
||||
exception
|
||||
when E : others =>
|
||||
Ada.Text_IO.Put_Line
|
||||
(Ada.Text_IO.Standard_Error,
|
||||
Ada.Exceptions.Exception_Information (E));
|
||||
end;
|
||||
end loop;
|
||||
end Step3_Env;
|
||||
|
@ -80,6 +80,7 @@ MalVal *EVAL(MalVal *ast, Env *env) {
|
||||
MalVal *a1 = _nth(ast, 1),
|
||||
*a2 = _nth(ast, 2);
|
||||
MalVal *res = EVAL(a2, env);
|
||||
if (mal_error) return NULL;
|
||||
env_set(env, a1, res);
|
||||
return res;
|
||||
} else if (strcmp("let*", a0->val.string) == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user