Unwire the things for parser refactor

This commit is contained in:
Scott Richmond 2023-05-02 19:15:05 -04:00
parent 197f4772ba
commit 963c63aed3
3 changed files with 7 additions and 11 deletions

View File

@ -11,7 +11,7 @@
(:gen-class)) (:gen-class))
(defn- run [file source] (defn- run [file source]
(let [scanned (scanner/scan source)] (comment (let [scanned (scanner/scan source)]
(if (not-empty (:errors scanned)) (if (not-empty (:errors scanned))
(do (do
(println "I found some scanning errors!") (println "I found some scanning errors!")
@ -25,13 +25,13 @@
(System/exit 66)) (System/exit 66))
(let [interpreted (interpreter/interpret parsed file)] (let [interpreted (interpreter/interpret parsed file)]
(println (show/show interpreted)) (println (show/show interpreted))
(System/exit 0))))))) (System/exit 0))))))))
(defn -main [& args] (defn -main [& args]
(cond (comment (cond
(= (count args) 1) (= (count args) 1)
(let [file (first args) (let [file (first args)
source (loader/load-import file)] source (loader/load-import file)]
(run file source)) (run file source))
:else (repl/launch))) :else (repl/launch))))

View File

@ -1224,7 +1224,7 @@
(parser) (parser)
(parse-script))) (parse-script)))
(do (comment (do
(def my-source " (def my-source "
data Foo {foo, bar} data Foo {foo, bar}
data Bar as { data Bar as {
@ -1234,7 +1234,7 @@ data Bar as {
") ")
(::ast (parse (scanner/scan my-source)))) (::ast (parse (scanner/scan my-source)))))
(comment " (comment "
Further thoughts/still to do: Further thoughts/still to do:

View File

@ -96,11 +96,7 @@
(def draw {:name "draw" (def draw {:name "draw"
::data/type ::data/clj ::data/type ::data/clj
:body draw/ludus-draw}) :body d/ludus-draw})
(def draw {:name "draw"
::data/type ::data/clj
:body d/draw})
(def prelude {"eq" eq (def prelude {"eq" eq
"add" add "add" add