-
+ 040A9F08A31A01C5506C1609493F3E55833F5A0092144FA4A084739CC5EF75FBE8E2124C6C386607E9295A96D1BDD3B1F660D81C91668F481987E29B84EB7B14
adalisp/src/test_repl.adb
(0 . 0)(1 . 36)
2447 -- A test REPL putting all our Ada Lisp components together.
2448 with Ada.Text_IO; use Ada.Text_IO;
2449
2450 with Parser; use Parser;
2451 with Evaler; use Evaler;
2452 with LispM; use LispM;
2453
2454 procedure Test_Repl is
2455 P : MemPtr;
2456 TID : TokenID;
2457 begin
2458 -- Init builtin bindings
2459 Init_Builtin_Bindings;
2460
2461 loop
2462 Put("> ");
2463
2464 -- Read
2465 Parse(P, TID);
2466
2467 -- Eval
2468 case TID is
2469 when Error_Token =>
2470 Put("Parse error.");
2471 exit;
2472 when ListE_Token =>
2473 Put("Unexpected end of list.");
2474 exit;
2475 when others =>
2476 Eval(P, 0, P);
2477 end case;
2478
2479 -- Print
2480 Dump_Cell(P); Put_Line("");
2481 end loop;
2482 end Test_Repl;