Work on fn regression

This commit is contained in:
Scott Richmond 2023-11-30 15:03:51 -05:00
parent fcf9bd76e0
commit d99a454e36
4 changed files with 8 additions and 12 deletions

View File

@ -10,7 +10,7 @@
[ludus.scanner :as s]
))
(declare expression pattern binding non-binding simple)
(declare expression pattern binding-expr non-binding simple)
(defp separator choice [:comma :newline :break])
@ -234,11 +234,11 @@
(defp compound flat choice [match loop-expr if-expr when-expr do-expr block])
(defp binding flat choice [fn-named fn-compound let-expr ref-expr])
(defp binding-expr flat choice [fn-named let-expr ref-expr])
(defp non-binding flat choice [simple compound])
(defp expression flat choice [binding non-binding])
(defp expression flat choice [binding-expr non-binding])
(defp test-expr group order-1 [(quiet :test) :string non-binding])

View File

@ -797,7 +797,8 @@
:when-expr (interpret-cond ast ctx)
:fn-expr (interpret-fn ast ctx)
:fn-named (interpret-fn ast ctx)
:lambda (interpret-fn ast ctx)
:do-expr (interpret-do ast ctx)
@ -931,7 +932,7 @@
(do
(def source "
two
:foo
")
(def tokens (-> source scanner/scan :tokens))

View File

@ -1,11 +1,6 @@
(ns ludus.prelude)
(def prelude "
let one = 1
let two = :two
ns prelude {
one
two
}
")

View File

@ -4,7 +4,7 @@
[ludus.parser :as p]
[ludus.grammar :as g]
[ludus.interpreter :as interpreter]
[ludus.prelude :as prelude]
[ludus.base :as base]
[ludus.show :as show]
[ludus.data :as data]
;[ludus.process :as process]
@ -22,7 +22,7 @@
(println "\nGoodbye!")
(System/exit 0))
(def base-ctx (merge prelude/prelude ;process/process
(def base-ctx (merge base/base ;process/process
{::repl true
"repl"
{::data/struct true