diff options
author | Eduardo Julian | 2015-03-01 17:16:52 -0400 |
---|---|---|
committer | Eduardo Julian | 2015-03-01 17:16:52 -0400 |
commit | 2caf39ea09ae96669466e0e17fd2949347acda7a (patch) | |
tree | d4faf386cbfca23ac759c9082f9588e8cd7308b9 /src/lux/compiler/case.clj | |
parent | 83a1a1510ca2e83711a80ff2eb961c5694306b9e (diff) |
- Fixed some bugs with pattern matching and macros.
- Simplified the code for handling definitions and macros.
- Slightly changed the names of the fields of tuple classes.
- Added a (currently empty) optimization phase.
Diffstat (limited to '')
-rw-r--r-- | src/lux/compiler/case.clj | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lux/compiler/case.clj b/src/lux/compiler/case.clj index ba27d2c12..593a85d34 100644 --- a/src/lux/compiler/case.clj +++ b/src/lux/compiler/case.clj @@ -158,6 +158,7 @@ (let [ex-class (&host/->class "java.lang.IllegalStateException")] (defn ^:private compile-pattern-matching [writer compile mappings patterns $end] + ;; (prn 'compile-pattern-matching patterns) (let [entries (for [[?branch ?body] mappings :let [label (new Label)]] [[?branch label] @@ -167,7 +168,7 @@ (-> (doto (compile-match ?match (get mappings* ?body) $else) (.visitLabel $else)) (->> (doseq [[_ ?body ?match :as pattern] patterns - :let [_ (prn 'compile-pattern-matching/pattern pattern) + :let [;; _ (prn 'compile-pattern-matching/pattern pattern) $else (new Label)]]))) (.visitInsn Opcodes/POP) (.visitTypeInsn Opcodes/NEW ex-class) @@ -195,9 +196,9 @@ :let [_ (doto *writer* (.visitInsn Opcodes/DUP) (.visitLabel $start))] - :let [_ (prn "PRE Compiled ?branches")] + ;; :let [_ (prn "PRE Compiled ?branches")] :let [[mappings patterns] (process-branches ?base-register ?branches)] _ (compile-pattern-matching *writer* compile mappings patterns $end) - :let [_ (prn "POST Compiled ?branches")] + ;; :let [_ (prn "POST Compiled ?branches")] :let [_ (.visitLabel *writer* $end)]] (return nil))) |