diff options
author | Eduardo Julian | 2015-04-19 19:50:10 -0400 |
---|---|---|
committer | Eduardo Julian | 2015-04-19 19:50:10 -0400 |
commit | e1df2642c538293f1dfd0faffad72b48a626148a (patch) | |
tree | ba62cd4c50b193a8c147957f7ca6339f16dd1ff3 /src/lux/analyser/base.clj | |
parent | 6676e1bb8e79ed4336b113b573f3b9f9dd8399af (diff) |
- Fixed several bugs in lux.lux
- Fixed an error in lux.base/analyse-2
- Modified the analyser so the symbols that identify all of the special forms must mandatorily have "" as their prefix.
- Fixed a bug in the binary operations at lux.analyser.host wherein the types where being omitted.
- Fixed a bug when closing-over variables inside lambda bodies wherein the names of bindings where being stores as (incomparable) arrays, instead of as (comparable) strings.
Diffstat (limited to 'src/lux/analyser/base.clj')
-rw-r--r-- | src/lux/analyser/base.clj | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/lux/analyser/base.clj b/src/lux/analyser/base.clj index 9acd37028..4b23f9460 100644 --- a/src/lux/analyser/base.clj +++ b/src/lux/analyser/base.clj @@ -4,7 +4,7 @@ (lux [base :as & :refer [|let |do return fail]] [type :as &type]))) -;; [Resources] +;; [Exports] (defn expr-type [syntax+] ;; (prn 'expr-type syntax+) ;; (prn 'expr-type (aget syntax+ 0)) @@ -26,14 +26,16 @@ [_] (fail "[Analyser Error] Can't expand to other than 1 element."))))) -(defn analyse-2 [analyse el1 el2] - (|do [output (&/flat-map% analyse (&/|list el1 el2))] +(defn analyse-2 [analyse exo-type1 el1 exo-type2 el2] + (|do [output1 (analyse exo-type1 el1) + output2 (analyse exo-type2 el2)] (do ;; (prn 'analyse-2 (aget output 0)) - (matchv ::M/objects [output] - [["lux;Cons" [x ["lux;Cons" [y ["lux;Nil" _]]]]]] - (return [x y]) + (matchv ::M/objects [output1 output2] + [["lux;Cons" [x ["lux;Nil" _]]] + ["lux;Cons" [y ["lux;Nil" _]]]] + (return (&/T x y)) - [_] + [_ _] (fail "[Analyser Error] Can't expand to other than 2 elements."))))) (defn resolved-ident [ident] @@ -42,3 +44,10 @@ &/get-module-name (return ?module))] (return (&/ident->text (&/T module* ?name)))))) + +(defn resolved-ident* [ident] + (|let [[?module ?name] ident] + (|do [module* (if (= "" ?module) + &/get-module-name + (return ?module))] + (return (&/T module* ?name))))) |