Permalink
Browse files

work in progress

  • Loading branch information...
1 parent effb966 commit 4c9fa3e66e6059ef905414093d7ab07e5c95a8db @EricThorsen committed Jul 17, 2010
@@ -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))]
@@ -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?
@@ -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]
@@ -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)]

0 comments on commit 4c9fa3e

Please sign in to comment.