Permalink
Browse files

Merge pull request #16 from jonase/line-num

Added line numbers to :fn-expr and :deftype*
  • Loading branch information...
frenchy64 committed Apr 16, 2012
2 parents dc251f0 + 3d775b7 commit 50f2397b93b5f76c3b5f3b841118e81c8299e876
Showing with 6 additions and 4 deletions.
  1. +1 −1 project.clj
  2. +5 −3 src/analyze/core.clj
View
@@ -1,3 +1,3 @@
-(defproject analyze "0.1.5"
+(defproject analyze "0.1.6-SNAPSHOT"
:description "Interface to Clojure Analyzer"
:dependencies [[org.clojure/clojure "1.4.0-beta5"]])
View
@@ -526,10 +526,11 @@
Compiler$FnExpr
(analysis->map
[expr env]
- (let [methods (doall (map analysis->map (.methods expr) (repeat env)))]
+ (let [methods (doall (map analysis->map (.methods expr) (repeat env)))
+ parent-field (partial field-accessor Compiler$ObjExpr)]
(merge
{:op :fn-expr
- :env env
+ :env (assoc env :line (parent-field 'line expr))
:methods methods
:variadic-method (when-let [variadic-method (.variadicMethod expr)]
(analysis->map variadic-method env))
@@ -546,10 +547,11 @@
(analysis->map
[expr env]
(let [field (partial field-accessor Compiler$NewInstanceExpr)
+ parent-field (partial field-accessor Compiler$ObjExpr)
methods (doall (map analysis->map (field 'methods expr) (repeat env)))]
(merge
{:op :deftype*
- :env env
+ :env (assoc env :line (parent-field 'line expr))
:methods methods
:mmap (field 'mmap expr)
:covariants (field 'covariants expr)

0 comments on commit 50f2397

Please sign in to comment.