diff options
Diffstat (limited to '')
-rw-r--r-- | src/lux/analyser/base.clj | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/lux/analyser/base.clj b/src/lux/analyser/base.clj index b287b545f..0d2d8304a 100644 --- a/src/lux/analyser/base.clj +++ b/src/lux/analyser/base.clj @@ -11,7 +11,7 @@ (matchv ::M/objects [syntax+] [["Expression" [_ type]]] (do ;; (prn 'expr-type (&type/show-type type)) - (return type)) + (return type)) [["Statement" _]] (fail (str "[Analyser Error] Can't retrieve the type of a statement: " (pr-str syntax+))))) @@ -19,26 +19,26 @@ (defn analyse-1 [analyse exo-type elem] (|do [output (analyse exo-type elem)] (do ;; (prn 'analyse-1 (aget output 0)) - (matchv ::M/objects [output] - [["lux;Cons" [x ["lux;Nil" _]]]] - (return x) + (matchv ::M/objects [output] + [["lux;Cons" [x ["lux;Nil" _]]]] + (return x) - [_] - (fail "[Analyser Error] Can't expand to other than 1 element."))))) + [_] + (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))] (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 [output] + [["lux;Cons" [x ["lux;Cons" [y ["lux;Nil" _]]]]]] + (return [x y]) - [_] - (fail "[Analyser Error] Can't expand to other than 2 elements."))))) + [_] + (fail "[Analyser Error] Can't expand to other than 2 elements."))))) (defn with-var [k] (|do [=var &type/fresh-var - =ret (k =var)] + =ret (k =var)] (matchv ::M/objects [=ret] [["Expression" [?expr ?type]]] (|do [=type (&type/clean =var ?type)] |