Skip to content

Commit

Permalink
propagate column information through the analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
David Nolen authored and David Nolen committed Nov 20, 2012
1 parent 129f65e commit 07e5516
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/clj/cljs/analyzer.clj
Expand Up @@ -91,7 +91,8 @@
(binding [*out* *err*]
(println
(str s (when (:line env)
(str " at line " (:line env) " " *cljs-file*))))))
(str " at line " (:line env) " column " (:column env) " "
*cljs-file*))))))

(defn confirm-var-exists [env prefix suffix]
(when *cljs-warn-on-undeclared*
Expand Down Expand Up @@ -337,7 +338,7 @@
(when doc {:doc doc})
(when dynamic {:dynamic true})
(when-let [line (:line env)]
{:file *cljs-file* :line line})
{:file *cljs-file* :line line :column (:column env)})
;; the protocol a protocol fn belongs to
(when protocol
{:protocol protocol})
Expand Down Expand Up @@ -699,7 +700,8 @@
{:protocols (-> tsym meta :protocols)}
(when-let [line (:line env)]
{:file *cljs-file*
:line line})))))
:line line
:column (:column env)})))))
{:env env :op :deftype* :form form :t t :fields fields :pmasks pmasks}))

(defmethod parse 'defrecord*
Expand All @@ -712,7 +714,8 @@
{:protocols (-> tsym meta :protocols)}
(when-let [line (:line env)]
{:file *cljs-file*
:line line})))))
:line line
:column (:column env)})))))
{:env env :op :defrecord* :form form :t t :fields fields :pmasks pmasks}))

;; dot accessor code
Expand Down Expand Up @@ -887,9 +890,11 @@

(defn analyze-seq
[env form name]
(let [env (assoc env :line
(or (-> form meta :line)
(:line env)))]
(let [env (assoc env
:line (or (-> form meta :line)
(:line env))
:column (or (-> form meta :column)
(:column env)))]
(let [op (first form)]
(assert (not (nil? op)) "Can't call nil")
(let [mform (macroexpand-1 env form)]
Expand Down

0 comments on commit 07e5516

Please sign in to comment.