Baby repl stub

This commit is contained in:
Scott Richmond 2022-05-26 18:59:28 -04:00
parent a3c60e0196
commit ef97cf16e4
2 changed files with 14 additions and 4 deletions

View File

@ -6,7 +6,8 @@
[ludus.interpreter :as interpreter] [ludus.interpreter :as interpreter]
[ludus.show :as show] [ludus.show :as show]
[clojure.pprint :as pp] [clojure.pprint :as pp]
[ludus.loader :as loader]) [ludus.loader :as loader]
[ludus.repl :as repl])
(:gen-class)) (:gen-class))
(defn- run [file source] (defn- run [file source]
@ -33,6 +34,4 @@
source (loader/load-import file)] source (loader/load-import file)]
(run file source)) (run file source))
:else (do :else (repl/launch)))
(println "Usage: ludus [script]")
(System/exit 64))))

11
src/ludus/repl.clj Normal file
View File

@ -0,0 +1,11 @@
(ns ludus.repl
(:require
[ludus.scanner :as scanner]
[ludus.parser :as parser]
[ludus.interpreter :as interpreter]
[ludus.show :as show]))
(defn launch []
(println "Welcome to Ludus (v. 0.1.0-alpha)")
(println "ludus=>")
(System/exit 0))