Permalink
Browse files

Merge nested let statements.

  • Loading branch information...
zachallaun committed Aug 18, 2012
1 parent 1372836 commit 68432d2fcc319dc5fdc4b4bb09ab01ce0d62f200
Showing with 9 additions and 9 deletions.
  1. +9 −9 src/isla/interpreter.clj
View
@@ -26,18 +26,18 @@
value-node (interpret (utils/extract node [:c 2]) env)
value (if (contains? value-node :ref)
{:ref (:ref value-node)}
- (:val value-node))]
- (let [new-ctx (assign (:ctx env) assignee value)]
- (nreturn new-ctx))))
+ (:val value-node))
+ new-ctx (assign (:ctx env) assignee value)]
+ (nreturn new-ctx)))
(defmethod interpret :type-assignment [node env]
(let [assignee (utils/extract node [:c 0])
- type-identifier (interpret (utils/extract node [:c 2]) env)]
- (let [type-fn (or (get-in env [:ctx :types type-identifier])
- (get-in env [:ctx :types "generic"]))
- type (instantiate-type type-fn type-identifier assignee)
- new-ctx (assign (:ctx env) assignee type)]
- (nreturn new-ctx))))
+ type-identifier (interpret (utils/extract node [:c 2]) env)
+ type-fn (or (get-in env [:ctx :types type-identifier])
+ (get-in env [:ctx :types "generic"]))
+ type (instantiate-type type-fn type-identifier assignee)
+ new-ctx (assign (:ctx env) assignee type)]
+ (nreturn new-ctx)))
(defmethod interpret :array-operation [node env]
(let [assignee (utils/extract node [:c 0])

0 comments on commit 68432d2

Please sign in to comment.