interpreter: removed the outdated tree-walk interpreter
All checks were successful
ci/woodpecker/push/debian Pipeline was successful
ci/woodpecker/push/fedora Pipeline was successful
ci/woodpecker/push/nix Pipeline was successful
ci/woodpecker/push/publish Pipeline was successful

This commit is contained in:
2026-02-15 14:30:41 +03:00
parent 8d301a6fc2
commit 7685ae2e45
7 changed files with 1 additions and 502 deletions

View File

@@ -1,10 +1,4 @@
(executable
(name inter)
(public_name ollisp-inter)
(libraries str unix interpreter)
(package ollisp))
(executable
(name comp)
(public_name ollisp)
(libraries str unix compiler interpreter))
(libraries str unix compiler))

View File

@@ -1,31 +0,0 @@
open Interpreter.Ast;;
open Printf;;
open Interpreter;;
open Env;;
open Eval;;
let () = Stdlib.init_default_env ()
let rec repl env c =
let () = printf ">>> "; Out_channel.flush Out_channel.stdout; in
match In_channel.input_line c with
| None -> ()
| Some "exit" -> ()
| Some l ->
try
let vals = (read_from_str l) in
(* dbg_print_all vals; *)
pretty_print_all (eval_all env vals);
Out_channel.flush Out_channel.stdout;
repl env c
with
| Invalid_argument s ->
printf "%s\nResuming repl\n" s;
repl env c
| Parser.Parse.Error ->
printf "Expression '%s' couldn't be parsed, try again\n" l;
repl env c
;;
let () = repl (make_env ()) (In_channel.stdin)