Skip to content

Commit

Permalink
work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
ericthorsen committed Jul 17, 2010
1 parent effb966 commit 4c9fa3e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 15 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Expand Up @@ -75,10 +75,6 @@
(. sb (append (char c)))
(recur (. istream (read))))))))

;(defmethod form-parse 'load [form]
; (conj (get-def-attribs-for-clojure-form form)
; :type :func :disp-value (nth form 2)
; :arglists (get-arglists form 3)))

(defn skip-to-next-form [#^CharCountingPushbackReader is]
(let [c (char (.read #^CharCountingPushbackReader is))]
Expand All @@ -88,11 +84,6 @@
(recur #^CharCountingPushbackReader is)
(.unread #^CharCountingPushbackReader is (int c)))))

; (catch Throwable t
; (println "Could not parse the " (inc (count forms))
; " form in " additional-attribs " form:";
; form " error:" (.getMessage t)))))

(def #^{:private true} EOF (Object.))

(defn readable-form?
Expand Down
Expand Up @@ -83,7 +83,7 @@
; (recur (inc count))
; count))))

; patch from Daro Macchi - 2009-11-17
; patch from Daro Macchi - 2009-11-17
(defn count-leading-spaces [ts]
(let [token-text (-> ts .token .text)]
(loop [count 0]
Expand Down Expand Up @@ -199,11 +199,14 @@
(let [#^TokenSequence ts (.tokenSequence (TokenHierarchy/get document))
ns-pred #(or (token-match :ns-publics "ns" %1)
(token-match :ns-publics "in-ns" %1))]
(.moveStart ts)
(when (move-next ns-pred ts)
(when-let [position (get-top-enclosing-form ts (.offset ts))]
(.getText document (:start position)
(- (:end position) (:start position)))))))
(if ts
(do
(.moveStart ts)
(when (move-next ns-pred ts)
(when-let [position (get-top-enclosing-form ts (.offset ts))]
(.getText document (:start position)
(- (:end position) (:start position))))))
(throw (Exception. (format "Enable for create TokenSequence for %s" document))))))

(defn get-namespace [pane]
(when-let [nsnode (get-namespace-node pane)]
Expand Down

0 comments on commit 4c9fa3e

Please sign in to comment.