diff options
author | Eduardo Julian | 2015-03-08 04:42:09 -0400 |
---|---|---|
committer | Eduardo Julian | 2015-03-08 04:42:09 -0400 |
commit | 33f318849c0702b254eccf79f6ef9b7015e4537b (patch) | |
tree | 5ddfa65cb22db5771200610f3ce1d29a78b2b3a6 /src | |
parent | 9b0c07dbf78bbdb6e13fbbd44e02fe322d9f145c (diff) |
- In lux.lux, fixed a bug in the "list" macro that rendered it unusable.
- Fixed a bug when compiling lambda instantiation (the bug had to do with compiling the env variables passed to the closure).
- Fixed a bug in the lexer wherein the backquote (`) wasn't being recognized.
Diffstat (limited to '')
-rw-r--r-- | src/lux/compiler/lambda.clj | 4 | ||||
-rw-r--r-- | src/lux/lexer.clj | 2 | ||||
-rw-r--r-- | src/lux/macro.clj | 4 |
3 files changed, 7 insertions, 3 deletions
diff --git a/src/lux/compiler/lambda.clj b/src/lux/compiler/lambda.clj index 5358519d9..004f09743 100644 --- a/src/lux/compiler/lambda.clj +++ b/src/lux/compiler/lambda.clj @@ -83,13 +83,13 @@ (.visitTypeInsn Opcodes/NEW lambda-class) (.visitInsn Opcodes/DUP))] _ (->> closed-over - (sort #(match [%1 %2] + (sort #(match [(second %1) (second %2)] [[::&a/Expression [::&a/captured _ ?cid1 _] _] [::&a/Expression [::&a/captured _ ?cid2 _] _]] (< ?cid1 ?cid2))) (map-m (fn [[?name ?captured]] (match ?captured - [::&a/Expression [::&a/captured _ ?captured-id ?source] _] + [::&a/Expression [::&a/captured _ _ ?source] _] (compile ?source))))) :let [_ (.visitMethodInsn *writer* Opcodes/INVOKESPECIAL lambda-class "<init>" init-signature)]] (return nil))) diff --git a/src/lux/lexer.clj b/src/lux/lexer.clj index 4ad36f669..fe899691c 100644 --- a/src/lux/lexer.clj +++ b/src/lux/lexer.clj @@ -41,7 +41,7 @@ (return (str prefix unescaped postfix))) (lex-regex #"(?s)^([^\"\\]*)")])) -(def ^:private +ident-re+ #"^([a-zA-Z\-\+\_\=!@$%^&*<>\.,/\\\|':\~\?][0-9a-zA-Z\-\+\_\=!@$%^&*<>\.,/\\\|':\~\?]*)(;[0-9a-zA-Z\-\+\_\=!@$%^&*<>\.,/\\\|':\~\?]+)?") +(def ^:private +ident-re+ #"^([a-zA-Z\-\+\_\=!@$%^&*<>\.,/\\\|'`:\~\?][0-9a-zA-Z\-\+\_\=!@$%^&*<>\.,/\\\|'`:\~\?]*)(;[0-9a-zA-Z\-\+\_\=!@$%^&*<>\.,/\\\|'`:\~\?]+)?") ;; [Lexers] (def ^:private lex-white-space diff --git a/src/lux/macro.clj b/src/lux/macro.clj index 7f1e7116b..071f95691 100644 --- a/src/lux/macro.clj +++ b/src/lux/macro.clj @@ -38,6 +38,7 @@ )) (defn ^:private ->clojure+ [->clojure xs] + ;; (prn '->clojure+ (aget xs 0)) (case (aget xs 0) "Nil" (list) "Cons" (let [tuple2 (aget xs 1)] @@ -46,6 +47,9 @@ )) (defn ^:private ->clojure [x] + ;; (if (= "Tag" (aget x 0)) + ;; (println " ->clojure" (pr-str (aget x 0)) (aget x 1)) + ;; (println " ->clojure" (pr-str (aget x 0)))) (case (aget x 0) "Bool" [::&parser/Bool (aget x 1)] "Int" [::&parser/Int (aget x 1)] |