Skip to content
Browse files

Removed outdated GCLosure deps

  • Loading branch information...
1 parent 2cd311f commit 8a5082ec294ece949d57a4844d052e68fcc6d6d7 @fogus committed Jul 25, 2013
View
5 project.clj
@@ -13,10 +13,7 @@
[compojure "1.0.1"]
[domina "1.0.1"]
[ring-clj-params "0.1.0"]
- [org.clojure/clojurescript "0.0-1847"]
- [com.google.javascript/closure-compiler "r1592"]
- [org.clojure/google-closure-library "0.0-790"]
- [org.mozilla/rhino "1.7R3"]]
+ [org.clojure/clojurescript "0.0-1847"]]
:plugins [[lein-cljsbuild "0.3.2"]]
:dev-dependencies [[jline "0.9.94"]
[lein-marginalia "0.7.0-SNAPSHOT"]]
View
5,647 resources/public/cljs/core.cljs
4,785 additions, 862 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
26,888 resources/public/cljs/core.js
18,429 additions, 8,459 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
401 resources/public/cljs/reader.cljs
@@ -21,7 +21,7 @@ nil if the end of stream has been reached")
(if (empty? @buffer-atom)
(let [idx @index-atom]
(swap! index-atom inc)
- (nth s idx))
+ (aget s idx))
(let [buf @buffer-atom]
(swap! buffer-atom rest)
(first buf))))
@@ -35,26 +35,26 @@ nil if the end of stream has been reached")
;; predicates
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(defn- whitespace?
+(defn- ^boolean whitespace?
"Checks whether a given character is whitespace"
[ch]
- (or (gstring/isBreakingWhitespace ch) (= \, ch)))
+ (or (gstring/isBreakingWhitespace ch) (identical? \, ch)))
-(defn- numeric?
+(defn- ^boolean numeric?
"Checks whether a given character is numeric"
[ch]
(gstring/isNumeric ch))
-(defn- comment-prefix?
+(defn- ^boolean comment-prefix?
"Checks whether the character begins a comment."
[ch]
- (= \; ch))
+ (identical? \; ch))
-(defn- number-literal?
+(defn- ^boolean number-literal?
"Checks whether the reader is at the start of a number literal"
[reader initch]
(or (numeric? initch)
- (and (or (= \+ initch) (= \- initch))
+ (and (or (identical? \+ initch) (identical? \- initch))
(numeric? (let [next-ch (read-char reader)]
(unread reader next-ch)
next-ch)))))
@@ -65,13 +65,17 @@ nil if the end of stream has been reached")
;; read helpers
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
; later will do e.g. line numbers...
(defn reader-error
[rdr & msg]
- (throw (apply str msg)))
+ (throw (js/Error. (apply str msg))))
-(defn macro-terminating? [ch]
- (and (not= ch "#") (not= ch \') (not= ch ":") (contains? macros ch)))
+(defn ^boolean macro-terminating? [ch]
+ (and (not (identical? ch "#"))
+ (not (identical? ch \'))
+ (not (identical? ch ":"))
+ (macros ch)))
(defn read-token
[rdr initch]
@@ -88,7 +92,7 @@ nil if the end of stream has been reached")
[reader _]
(loop []
(let [ch (read-char reader)]
- (if (or (= ch \n) (= ch \r) (nil? ch))
+ (if (or (identical? ch \n) (identical? ch \r) (nil? ch))
reader
(recur)))))
@@ -97,64 +101,125 @@ nil if the end of stream has been reached")
(def float-pattern (re-pattern "([-+]?[0-9]+(\\.[0-9]*)?([eE][-+]?[0-9]+)?)(M)?"))
(def symbol-pattern (re-pattern "[:]?([^0-9/].*/)?([^0-9/][^/]*)"))
+(defn- re-find*
+ [re s]
+ (let [matches (.exec re s)]
+ (when-not (nil? matches)
+ (if (== (alength matches) 1)
+ (aget matches 0)
+ matches))))
+
(defn- match-int
[s]
- (let [groups (re-find int-pattern s)
- group3 (nth groups 2)]
- (if (not (or (undefined? group3)
- (< (.-length group3) 1)))
+ (let [groups (re-find* int-pattern s)
+ group3 (aget groups 2)]
+ (if-not (or (nil? group3)
+ (< (alength group3) 1))
0
- (let [negate (if (= "-" (nth groups 1)) -1 1)
- [n radix] (cond
- (nth groups 3) [(nth groups 3) 10]
- (nth groups 4) [(nth groups 4) 16]
- (nth groups 5) [(nth groups 5) 8]
- (nth groups 7) [(nth groups 7) (js/parseInt (nth groups 7))]
- :default [nil nil])]
+ (let [negate (if (identical? "-" (aget groups 1)) -1 1)
+ a (cond
+ (aget groups 3) (array (aget groups 3) 10)
+ (aget groups 4) (array (aget groups 4) 16)
+ (aget groups 5) (array (aget groups 5) 8)
+ (aget groups 7) (array (aget groups 7) (js/parseInt (aget groups 7)))
+ :default (array nil nil))
+ n (aget a 0)
+ radix (aget a 1)]
(if (nil? n)
nil
(* negate (js/parseInt n radix)))))))
(defn- match-ratio
[s]
- (let [groups (re-find ratio-pattern s)
- numinator (nth groups 1)
- denominator (nth groups 2)]
+ (let [groups (re-find* ratio-pattern s)
+ numinator (aget groups 1)
+ denominator (aget groups 2)]
(/ (js/parseInt numinator) (js/parseInt denominator))))
(defn- match-float
[s]
(js/parseFloat s))
+(defn- re-matches*
+ [re s]
+ (let [matches (.exec re s)]
+ (when (and (not (nil? matches))
+ (identical? (aget matches 0) s))
+ (if (== (alength matches) 1)
+ (aget matches 0)
+ matches))))
+
(defn- match-number
[s]
(cond
- (re-matches int-pattern s) (match-int s)
- (re-matches ratio-pattern s) (match-ratio s)
- (re-matches float-pattern s) (match-float s)))
-
-(def escape-char-map {\t "\t"
- \r "\r"
- \n "\n"
- \\ \\
- \" \"
- \b "\b"
- \f "\f"})
-
-(defn read-unicode-char
- [reader initch]
- (reader-error reader "Unicode characters not supported by reader (yet)"))
+ (re-matches* int-pattern s) (match-int s)
+ (re-matches* ratio-pattern s) (match-ratio s)
+ (re-matches* float-pattern s) (match-float s)))
+
+(defn escape-char-map [c]
+ (cond
+ (identical? c \t) "\t"
+ (identical? c \r) "\r"
+ (identical? c \n) "\n"
+ (identical? c \\) \\
+ (identical? c \") \"
+ (identical? c \b) "\b"
+ (identical? c \f) "\f"
+ :else nil))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; unicode
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defn read-2-chars [reader]
+ (.toString
+ (gstring/StringBuffer.
+ (read-char reader)
+ (read-char reader))))
+
+(defn read-4-chars [reader]
+ (.toString
+ (gstring/StringBuffer.
+ (read-char reader)
+ (read-char reader)
+ (read-char reader)
+ (read-char reader))))
+
+(def unicode-2-pattern (re-pattern "[0-9A-Fa-f]{2}"))
+(def unicode-4-pattern (re-pattern "[0-9A-Fa-f]{4}"))
+
+(defn validate-unicode-escape [unicode-pattern reader escape-char unicode-str]
+ (if (re-matches unicode-pattern unicode-str)
+ unicode-str
+ (reader-error reader "Unexpected unicode escape \\" escape-char unicode-str)))
+
+(defn make-unicode-char [code-str]
+ (let [code (js/parseInt code-str 16)]
+ (.fromCharCode js/String code)))
(defn escape-char
[buffer reader]
(let [ch (read-char reader)
- mapresult (get escape-char-map ch)]
+ mapresult (escape-char-map ch)]
(if mapresult
mapresult
- (if (or (= \u ch) (numeric? ch))
- (read-unicode-char reader ch)
- (reader-error reader "Unsupported escape charater: \\" ch)))))
+ (cond
+ (identical? ch \x)
+ (->> (read-2-chars reader)
+ (validate-unicode-escape unicode-2-pattern reader ch)
+ (make-unicode-char))
+
+ (identical? ch \u)
+ (->> (read-4-chars reader)
+ (validate-unicode-escape unicode-4-pattern reader ch)
+ (make-unicode-char))
+
+ (numeric? ch)
+ (.fromCharCode js/String ch)
+
+ :else
+ (reader-error reader "Unexpected unicode escape \\" ch )))))
(defn read-past
"Read until first character that doesn't match pred, returning
@@ -167,18 +232,18 @@ nil if the end of stream has been reached")
(defn read-delimited-list
[delim rdr recursive?]
- (loop [a []]
+ (loop [a (transient [])]
(let [ch (read-past whitespace? rdr)]
- (when-not ch (reader-error rdr "EOF"))
- (if (= delim ch)
- a
- (if-let [macrofn (get macros ch)]
+ (when-not ch (reader-error rdr "EOF while reading"))
+ (if (identical? delim ch)
+ (persistent! a)
+ (if-let [macrofn (macros ch)]
(let [mret (macrofn rdr ch)]
- (recur (if (= mret rdr) a (conj a mret))))
+ (recur (if (identical? mret rdr) a (conj! a mret))))
(do
(unread rdr ch)
(let [o (read rdr true nil recursive?)]
- (recur (if (= o rdr) a (conj a o))))))))))
+ (recur (if (identical? o rdr) a (conj! a o))))))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; data structure readers
@@ -188,13 +253,17 @@ nil if the end of stream has been reached")
[rdr ch]
(reader-error rdr "Reader for " ch " not implemented yet"))
+(declare maybe-read-tagged-type)
+
(defn read-dispatch
[rdr _]
(let [ch (read-char rdr)
- dm (get dispatch-macros ch)]
+ dm (dispatch-macros ch)]
(if dm
(dm rdr _)
- (reader-error rdr "No dispatch macro for " ch))))
+ (if-let [obj (maybe-read-tagged-type rdr ch)]
+ obj
+ (reader-error rdr "No dispatch macro for " ch)))))
(defn read-unmatched-delimiter
[rdr ch]
@@ -221,48 +290,53 @@ nil if the end of stream has been reached")
[reader initch]
(loop [buffer (gstring/StringBuffer. initch)
ch (read-char reader)]
- (if (or (nil? ch) (whitespace? ch) (contains? macros ch))
+ (if (or (nil? ch) (whitespace? ch) (macros ch))
(do
(unread reader ch)
(let [s (. buffer (toString))]
(or (match-number s)
(reader-error reader "Invalid number format [" s "]"))))
(recur (do (.append buffer ch) buffer) (read-char reader)))))
-(defn read-string
+(defn read-string*
[reader _]
(loop [buffer (gstring/StringBuffer.)
ch (read-char reader)]
(cond
- (nil? ch) (reader-error reader "EOF while reading string")
- (= "\\" ch) (recur (do (.append buffer (escape-char buffer reader)) buffer)
+ (nil? ch) (reader-error reader "EOF while reading")
+ (identical? "\\" ch) (recur (do (.append buffer (escape-char buffer reader)) buffer)
(read-char reader))
- (= \" ch) (. buffer (toString))
+ (identical? \" ch) (. buffer (toString))
:default (recur (do (.append buffer ch) buffer) (read-char reader)))))
-(def special-symbols
- {"nil" nil
- "true" true
- "false" false})
+(defn special-symbols [t not-found]
+ (cond
+ (identical? t "nil") nil
+ (identical? t "true") true
+ (identical? t "false") false
+ :else not-found))
(defn read-symbol
[reader initch]
(let [token (read-token reader initch)]
(if (gstring/contains token "/")
(symbol (subs token 0 (.indexOf token "/"))
(subs token (inc (.indexOf token "/")) (.-length token)))
- (get special-symbols token (symbol token)))))
+ (special-symbols token (symbol token)))))
(defn read-keyword
[reader initch]
(let [token (read-token reader (read-char reader))
- [token ns name] (re-matches symbol-pattern token)]
+ a (re-matches* symbol-pattern token)
+ token (aget a 0)
+ ns (aget a 1)
+ name (aget a 2)]
(if (or (and (not (undefined? ns))
(identical? (. ns (substring (- (.-length ns) 2) (.-length ns))) ":/"))
(identical? (aget name (dec (.-length name))) ":")
(not (== (.indexOf token "::" 1) -1)))
(reader-error reader "Invalid token: " token)
- (if ns?
+ (if (and (not (nil? ns)) (> (.-length ns) 0))
(keyword (.substring ns 0 (.indexOf ns "/")) name)
(keyword token)))))
@@ -300,56 +374,60 @@ nil if the end of stream has been reached")
(defn read-regex
[rdr ch]
- (-> (read-string rdr ch) re-pattern))
+ (-> (read-string* rdr ch) re-pattern))
(defn read-discard
[rdr _]
(read rdr true nil true)
rdr)
-(def macros
- { \" read-string
- \: read-keyword
- \; not-implemented ;; never hit this
- \' (wrapping-reader 'quote)
- \@ (wrapping-reader 'deref)
- \^ read-meta
- \` not-implemented
- \~ not-implemented
- \( read-list
- \) read-unmatched-delimiter
- \[ read-vector
- \] read-unmatched-delimiter
- \{ read-map
- \} read-unmatched-delimiter
- \\ read-char
- \% not-implemented
- \# read-dispatch
- })
+(defn macros [c]
+ (cond
+ (identical? c \") read-string*
+ (identical? c \:) read-keyword
+ (identical? c \;) not-implemented ;; never hit this
+ (identical? c \') (wrapping-reader 'quote)
+ (identical? c \@) (wrapping-reader 'deref)
+ (identical? c \^) read-meta
+ (identical? c \`) not-implemented
+ (identical? c \~) not-implemented
+ (identical? c \() read-list
+ (identical? c \)) read-unmatched-delimiter
+ (identical? c \[) read-vector
+ (identical? c \]) read-unmatched-delimiter
+ (identical? c \{) read-map
+ (identical? c \}) read-unmatched-delimiter
+ (identical? c \\) read-char
+ (identical? c \%) not-implemented
+ (identical? c \#) read-dispatch
+ :else nil))
;; omitted by design: var reader, eval reader
-(def dispatch-macros
- {"{" read-set
- "<" (throwing-reader "Unreadable form")
- "\"" read-regex
- "!" read-comment
- "_" read-discard})
+(defn dispatch-macros [s]
+ (cond
+ (identical? s "{") read-set
+ (identical? s "<") (throwing-reader "Unreadable form")
+ (identical? s "\"") read-regex
+ (identical? s"!") read-comment
+ (identical? s "_") read-discard
+ :else nil))
(defn read
"Reads the first object from a PushbackReader. Returns the object read.
If EOF, throws if eof-is-error is true. Otherwise returns sentinel."
[reader eof-is-error sentinel is-recursive]
(let [ch (read-char reader)]
(cond
- (nil? ch) (if eof-is-error (reader-error reader "EOF") sentinel)
+ (nil? ch) (if eof-is-error (reader-error reader "EOF while reading") sentinel)
(whitespace? ch) (recur reader eof-is-error sentinel is-recursive)
(comment-prefix? ch) (recur (read-comment reader ch) eof-is-error sentinel is-recursive)
- :else (let [res
+ :else (let [f (macros ch)
+ res
(cond
- (macros ch) ((macros ch) reader ch)
+ f (f reader ch)
(number-literal? reader ch) (read-number reader ch)
:else (read-symbol reader ch))]
- (if (= res reader)
+ (if (identical? res reader)
(recur reader eof-is-error sentinel is-recursive)
res)))))
@@ -359,4 +437,133 @@ nil if the end of stream has been reached")
(let [r (push-back-reader s)]
(read r true nil false)))
-
+
+;; read instances
+
+(defn ^:private zero-fill-right [s width]
+ (cond (= width (count s)) s
+ (< width (count s)) (.substring s 0 width)
+ :else (loop [b (gstring/StringBuffer. s)]
+ (if (< (.getLength b) width)
+ (recur (.append b \0))
+ (.toString b)))))
+
+(defn ^:private divisible?
+ [num div]
+ (zero? (mod num div)))
+
+(defn ^:private indivisible?
+ [num div]
+ (not (divisible? num div)))
+
+(defn ^:private leap-year?
+ [year]
+ (and (divisible? year 4)
+ (or (indivisible? year 100)
+ (divisible? year 400))))
+
+(def ^:private days-in-month
+ (let [dim-norm [nil 31 28 31 30 31 30 31 31 30 31 30 31]
+ dim-leap [nil 31 29 31 30 31 30 31 31 30 31 30 31]]
+ (fn [month leap-year?]
+ (get (if leap-year? dim-leap dim-norm) month))))
+
+(def ^:private parse-and-validate-timestamp
+ (let [timestamp #"(\d\d\d\d)(?:-(\d\d)(?:-(\d\d)(?:[T](\d\d)(?::(\d\d)(?::(\d\d)(?:[.](\d+))?)?)?)?)?)?(?:[Z]|([-+])(\d\d):(\d\d))?"
+ check (fn [low n high msg]
+ (assert (<= low n high) (str msg " Failed: " low "<=" n "<=" high))
+ n)]
+ (fn [ts]
+ (when-let [[[_ years months days hours minutes seconds milliseconds] [_ _ _] :as V]
+ (->> ts
+ (re-matches timestamp)
+ (split-at 8)
+ (map vec))]
+ (let [[[_ y mo d h m s ms] [offset-sign offset-hours offset-minutes]]
+ (->> V
+ (map #(update-in %2 [0] %)
+ [(constantly nil) #(if (= % "-") "-1" "1")])
+ (map (fn [v] (map #(js/parseInt % 10) v))))
+ offset (* offset-sign (+ (* offset-hours 60) offset-minutes))]
+ [(if-not years 1970 y)
+ (if-not months 1 (check 1 mo 12 "timestamp month field must be in range 1..12"))
+ (if-not days 1 (check 1 d (days-in-month mo (leap-year? y)) "timestamp day field must be in range 1..last day in month"))
+ (if-not hours 0 (check 0 h 23 "timestamp hour field must be in range 0..23"))
+ (if-not minutes 0 (check 0 m 59 "timestamp minute field must be in range 0..59"))
+ (if-not seconds 0 (check 0 s (if (= m 59) 60 59) "timestamp second field must be in range 0..60"))
+ (if-not milliseconds 0 (check 0 ms 999 "timestamp millisecond field must be in range 0..999"))
+ offset])))))
+
+(defn parse-timestamp
+ [ts]
+ (if-let [[years months days hours minutes seconds ms offset]
+ (parse-and-validate-timestamp ts)]
+ (js/Date.
+ (- (.UTC js/Date years (dec months) days hours minutes seconds ms)
+ (* offset 60 1000)))
+ (reader-error nil (str "Unrecognized date/time syntax: " ts))))
+
+(defn ^:private read-date
+ [s]
+ (if (string? s)
+ (parse-timestamp s)
+ (reader-error nil "Instance literal expects a string for its timestamp.")))
+
+
+(defn ^:private read-queue
+ [elems]
+ (if (vector? elems)
+ (into cljs.core.PersistentQueue/EMPTY elems)
+ (reader-error nil "Queue literal expects a vector for its elements.")))
+
+
+(defn ^:private read-uuid
+ [uuid]
+ (if (string? uuid)
+ (UUID. uuid)
+ (reader-error nil "UUID literal expects a string as its representation.")))
+
+(def *tag-table* (atom {"inst" read-date
+ "uuid" read-uuid
+ "queue" read-queue}))
+
+(def *default-data-reader-fn*
+ (atom nil))
+
+(defn maybe-read-tagged-type
+ [rdr initch]
+ (let [tag (read-symbol rdr initch)
+ pfn (get @*tag-table* (str tag))
+ dfn @*default-data-reader-fn*]
+ (cond
+ pfn (pfn (read rdr true nil false))
+ dfn (dfn tag (read rdr true nil false))
+ :else (reader-error rdr
+ "Could not find tag parser for " (str tag)
+ " in " (pr-str (keys @*tag-table*))))))
+
+(defn register-tag-parser!
+ [tag f]
+ (let [tag (str tag)
+ old-parser (get @*tag-table* tag)]
+ (swap! *tag-table* assoc tag f)
+ old-parser))
+
+(defn deregister-tag-parser!
+ [tag]
+ (let [tag (str tag)
+ old-parser (get @*tag-table* tag)]
+ (swap! *tag-table* dissoc tag)
+ old-parser))
+
+(defn register-default-tag-parser!
+ [f]
+ (let [old-parser @*default-data-reader-fn*]
+ (swap! *default-data-reader-fn* (fn [_] f))
+ old-parser))
+
+(defn deregister-default-tag-parser!
+ []
+ (let [old-parser @*default-data-reader-fn*]
+ (swap! *default-data-reader-fn* (fn [_] nil))
+ old-parser))
View
1,066 resources/public/cljs/reader.js
@@ -3,25 +3,23 @@ goog.require('cljs.core');
goog.require('goog.string');
cljs.reader.PushbackReader = {};
cljs.reader.read_char = (function read_char(reader){
-if(cljs.core.truth_((function (){var and__3546__auto____4817 = reader;
-
-if(cljs.core.truth_(and__3546__auto____4817))
-{return reader.cljs$reader$PushbackReader$read_char;
+if((function (){var and__3941__auto__ = reader;
+if(and__3941__auto__)
+{return reader.cljs$reader$PushbackReader$read_char$arity$1;
} else
-{return and__3546__auto____4817;
+{return and__3941__auto__;
}
-})()))
-{return reader.cljs$reader$PushbackReader$read_char(reader);
+})())
+{return reader.cljs$reader$PushbackReader$read_char$arity$1(reader);
} else
-{return (function (){var or__3548__auto____4818 = (cljs.reader.read_char[goog.typeOf.call(null,reader)]);
-
-if(cljs.core.truth_(or__3548__auto____4818))
-{return or__3548__auto____4818;
+{var x__2906__auto__ = (((reader == null))?null:reader);
+return (function (){var or__3943__auto__ = (cljs.reader.read_char[goog.typeOf(x__2906__auto__)]);
+if(or__3943__auto__)
+{return or__3943__auto__;
} else
-{var or__3548__auto____4819 = (cljs.reader.read_char["_"]);
-
-if(cljs.core.truth_(or__3548__auto____4819))
-{return or__3548__auto____4819;
+{var or__3943__auto____$1 = (cljs.reader.read_char["_"]);
+if(or__3943__auto____$1)
+{return or__3943__auto____$1;
} else
{throw cljs.core.missing_protocol.call(null,"PushbackReader.read-char",reader);
}
@@ -30,32 +28,31 @@ if(cljs.core.truth_(or__3548__auto____4819))
}
});
cljs.reader.unread = (function unread(reader,ch){
-if(cljs.core.truth_((function (){var and__3546__auto____4820 = reader;
-
-if(cljs.core.truth_(and__3546__auto____4820))
-{return reader.cljs$reader$PushbackReader$unread;
+if((function (){var and__3941__auto__ = reader;
+if(and__3941__auto__)
+{return reader.cljs$reader$PushbackReader$unread$arity$2;
} else
-{return and__3546__auto____4820;
+{return and__3941__auto__;
}
-})()))
-{return reader.cljs$reader$PushbackReader$unread(reader,ch);
+})())
+{return reader.cljs$reader$PushbackReader$unread$arity$2(reader,ch);
} else
-{return (function (){var or__3548__auto____4821 = (cljs.reader.unread[goog.typeOf.call(null,reader)]);
-
-if(cljs.core.truth_(or__3548__auto____4821))
-{return or__3548__auto____4821;
+{var x__2906__auto__ = (((reader == null))?null:reader);
+return (function (){var or__3943__auto__ = (cljs.reader.unread[goog.typeOf(x__2906__auto__)]);
+if(or__3943__auto__)
+{return or__3943__auto__;
} else
-{var or__3548__auto____4822 = (cljs.reader.unread["_"]);
-
-if(cljs.core.truth_(or__3548__auto____4822))
-{return or__3548__auto____4822;
+{var or__3943__auto____$1 = (cljs.reader.unread["_"]);
+if(or__3943__auto____$1)
+{return or__3943__auto____$1;
} else
{throw cljs.core.missing_protocol.call(null,"PushbackReader.unread",reader);
}
}
})().call(null,reader,ch);
}
});
+goog.provide('cljs.reader.StringPushbackReader');
/**
* @constructor
@@ -65,84 +62,81 @@ this.s = s;
this.index_atom = index_atom;
this.buffer_atom = buffer_atom;
})
-cljs.reader.StringPushbackReader.cljs$core$IPrintable$_pr_seq = (function (this__360__auto__){
-return cljs.core.list.call(null,"cljs.reader.StringPushbackReader");
+cljs.reader.StringPushbackReader.cljs$lang$type = true;
+cljs.reader.StringPushbackReader.cljs$lang$ctorStr = "cljs.reader/StringPushbackReader";
+cljs.reader.StringPushbackReader.cljs$lang$ctorPrWriter = (function (this__2847__auto__,writer__2848__auto__,opt__2849__auto__){
+return cljs.core._write.call(null,writer__2848__auto__,"cljs.reader/StringPushbackReader");
});
cljs.reader.StringPushbackReader.prototype.cljs$reader$PushbackReader$ = true;
-cljs.reader.StringPushbackReader.prototype.cljs$reader$PushbackReader$read_char = (function (reader){
-var this__4823 = this;
-if(cljs.core.truth_(cljs.core.empty_QMARK_.call(null,cljs.core.deref.call(null,this__4823.buffer_atom))))
-{var idx__4824 = cljs.core.deref.call(null,this__4823.index_atom);
-
-cljs.core.swap_BANG_.call(null,this__4823.index_atom,cljs.core.inc);
-return cljs.core.nth.call(null,this__4823.s,idx__4824);
+cljs.reader.StringPushbackReader.prototype.cljs$reader$PushbackReader$read_char$arity$1 = (function (reader){
+var self__ = this;
+if(cljs.core.empty_QMARK_.call(null,cljs.core.deref.call(null,self__.buffer_atom)))
+{var idx = cljs.core.deref.call(null,self__.index_atom);
+cljs.core.swap_BANG_.call(null,self__.index_atom,cljs.core.inc);
+return (self__.s[idx]);
} else
-{var buf__4825 = cljs.core.deref.call(null,this__4823.buffer_atom);
-
-cljs.core.swap_BANG_.call(null,this__4823.buffer_atom,cljs.core.rest);
-return cljs.core.first.call(null,buf__4825);
+{var buf = cljs.core.deref.call(null,self__.buffer_atom);
+cljs.core.swap_BANG_.call(null,self__.buffer_atom,cljs.core.rest);
+return cljs.core.first.call(null,buf);
}
});
-cljs.reader.StringPushbackReader.prototype.cljs$reader$PushbackReader$unread = (function (reader,ch){
-var this__4826 = this;
-return cljs.core.swap_BANG_.call(null,this__4826.buffer_atom,(function (p1__4816_SHARP_){
-return cljs.core.cons.call(null,ch,p1__4816_SHARP_);
+cljs.reader.StringPushbackReader.prototype.cljs$reader$PushbackReader$unread$arity$2 = (function (reader,ch){
+var self__ = this;
+return cljs.core.swap_BANG_.call(null,self__.buffer_atom,(function (p1__4531_SHARP_){
+return cljs.core.cons.call(null,ch,p1__4531_SHARP_);
}));
});
-cljs.reader.StringPushbackReader;
+cljs.reader.__GT_StringPushbackReader = (function __GT_StringPushbackReader(s,index_atom,buffer_atom){
+return (new cljs.reader.StringPushbackReader(s,index_atom,buffer_atom));
+});
cljs.reader.push_back_reader = (function push_back_reader(s){
return (new cljs.reader.StringPushbackReader(s,cljs.core.atom.call(null,0),cljs.core.atom.call(null,null)));
});
/**
* Checks whether a given character is whitespace
*/
cljs.reader.whitespace_QMARK_ = (function whitespace_QMARK_(ch){
-var or__3548__auto____4827 = goog.string.isBreakingWhitespace.call(null,ch);
-
-if(cljs.core.truth_(or__3548__auto____4827))
-{return or__3548__auto____4827;
+var or__3943__auto__ = goog.string.isBreakingWhitespace(ch);
+if(cljs.core.truth_(or__3943__auto__))
+{return or__3943__auto__;
} else
-{return cljs.core._EQ_.call(null,",",ch);
+{return ("," === ch);
}
});
/**
* Checks whether a given character is numeric
*/
cljs.reader.numeric_QMARK_ = (function numeric_QMARK_(ch){
-return goog.string.isNumeric.call(null,ch);
+return goog.string.isNumeric(ch);
});
/**
* Checks whether the character begins a comment.
*/
cljs.reader.comment_prefix_QMARK_ = (function comment_prefix_QMARK_(ch){
-return cljs.core._EQ_.call(null,";",ch);
+return (";" === ch);
});
/**
* Checks whether the reader is at the start of a number literal
*/
cljs.reader.number_literal_QMARK_ = (function number_literal_QMARK_(reader,initch){
-var or__3548__auto____4828 = cljs.reader.numeric_QMARK_.call(null,initch);
-
-if(cljs.core.truth_(or__3548__auto____4828))
-{return or__3548__auto____4828;
+var or__3943__auto__ = cljs.reader.numeric_QMARK_.call(null,initch);
+if(or__3943__auto__)
+{return or__3943__auto__;
} else
-{var and__3546__auto____4830 = (function (){var or__3548__auto____4829 = cljs.core._EQ_.call(null,"+",initch);
-
-if(cljs.core.truth_(or__3548__auto____4829))
-{return or__3548__auto____4829;
+{var and__3941__auto__ = (function (){var or__3943__auto____$1 = ("+" === initch);
+if(or__3943__auto____$1)
+{return or__3943__auto____$1;
} else
-{return cljs.core._EQ_.call(null,"-",initch);
+{return ("-" === initch);
}
})();
-
-if(cljs.core.truth_(and__3546__auto____4830))
-{return cljs.reader.numeric_QMARK_.call(null,(function (){var next_ch__4831 = cljs.reader.read_char.call(null,reader);
-
-cljs.reader.unread.call(null,reader,next_ch__4831);
-return next_ch__4831;
+if(cljs.core.truth_(and__3941__auto__))
+{return cljs.reader.numeric_QMARK_.call(null,(function (){var next_ch = cljs.reader.read_char.call(null,reader);
+cljs.reader.unread.call(null,reader,next_ch);
+return next_ch;
})());
} else
-{return and__3546__auto____4830;
+{return and__3941__auto__;
}
}
});
@@ -151,74 +145,69 @@ return next_ch__4831;
*/
cljs.reader.reader_error = (function() {
var reader_error__delegate = function (rdr,msg){
-throw cljs.core.apply.call(null,cljs.core.str,msg);
+throw (new Error(cljs.core.apply.call(null,cljs.core.str,msg)));
};
var reader_error = function (rdr,var_args){
var msg = null;
-if (goog.isDef(var_args)) {
+if (arguments.length > 1) {
msg = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1),0);
}
return reader_error__delegate.call(this, rdr, msg);
};
reader_error.cljs$lang$maxFixedArity = 1;
-reader_error.cljs$lang$applyTo = (function (arglist__4832){
-var rdr = cljs.core.first(arglist__4832);
-var msg = cljs.core.rest(arglist__4832);
-return reader_error__delegate.call(this, rdr, msg);
+reader_error.cljs$lang$applyTo = (function (arglist__4532){
+var rdr = cljs.core.first(arglist__4532);
+var msg = cljs.core.rest(arglist__4532);
+return reader_error__delegate(rdr, msg);
});
+reader_error.cljs$core$IFn$_invoke$arity$variadic = reader_error__delegate;
return reader_error;
})()
;
cljs.reader.macro_terminating_QMARK_ = (function macro_terminating_QMARK_(ch){
-var and__3546__auto____4833 = cljs.core.not_EQ_.call(null,ch,"#");
-
-if(cljs.core.truth_(and__3546__auto____4833))
-{var and__3546__auto____4834 = cljs.core.not_EQ_.call(null,ch,"'");
-
-if(cljs.core.truth_(and__3546__auto____4834))
-{var and__3546__auto____4835 = cljs.core.not_EQ_.call(null,ch,":");
-
-if(cljs.core.truth_(and__3546__auto____4835))
-{return cljs.core.contains_QMARK_.call(null,cljs.reader.macros,ch);
+var and__3941__auto__ = !((ch === "#"));
+if(and__3941__auto__)
+{var and__3941__auto____$1 = !((ch === "'"));
+if(and__3941__auto____$1)
+{var and__3941__auto____$2 = !((ch === ":"));
+if(and__3941__auto____$2)
+{return cljs.reader.macros.call(null,ch);
} else
-{return and__3546__auto____4835;
+{return and__3941__auto____$2;
}
} else
-{return and__3546__auto____4834;
+{return and__3941__auto____$1;
}
} else
-{return and__3546__auto____4833;
+{return and__3941__auto__;
}
});
cljs.reader.read_token = (function read_token(rdr,initch){
-var sb__4836 = (new goog.string.StringBuffer(initch));
-var ch__4837 = cljs.reader.read_char.call(null,rdr);
-
+var sb = (new goog.string.StringBuffer(initch));
+var ch = cljs.reader.read_char.call(null,rdr);
while(true){
-if(cljs.core.truth_((function (){var or__3548__auto____4838 = cljs.core.nil_QMARK_.call(null,ch__4837);
-
-if(cljs.core.truth_(or__3548__auto____4838))
-{return or__3548__auto____4838;
+if((function (){var or__3943__auto__ = (ch == null);
+if(or__3943__auto__)
+{return or__3943__auto__;
} else
-{var or__3548__auto____4839 = cljs.reader.whitespace_QMARK_.call(null,ch__4837);
-
-if(cljs.core.truth_(or__3548__auto____4839))
-{return or__3548__auto____4839;
+{var or__3943__auto____$1 = cljs.reader.whitespace_QMARK_.call(null,ch);
+if(or__3943__auto____$1)
+{return or__3943__auto____$1;
} else
-{return cljs.reader.macro_terminating_QMARK_.call(null,ch__4837);
+{return cljs.reader.macro_terminating_QMARK_.call(null,ch);
}
}
-})()))
-{cljs.reader.unread.call(null,rdr,ch__4837);
-return sb__4836.toString();
+})())
+{cljs.reader.unread.call(null,rdr,ch);
+return sb.toString();
} else
{{
-var G__4840 = (function (){sb__4836.append(ch__4837);
-return sb__4836;
+var G__4533 = (function (){sb.append(ch);
+return sb;
})();
-var G__4841 = cljs.reader.read_char.call(null,rdr);
-sb__4836 = G__4840;
-ch__4837 = G__4841;
+var G__4534 = cljs.reader.read_char.call(null,rdr);
+sb = G__4533;
+ch = G__4534;
continue;
}
}
@@ -229,24 +218,20 @@ break;
* Advances the reader to the end of a line. Returns the reader
*/
cljs.reader.skip_line = (function skip_line(reader,_){
-
while(true){
-var ch__4842 = cljs.reader.read_char.call(null,reader);
-
-if(cljs.core.truth_((function (){var or__3548__auto____4843 = cljs.core._EQ_.call(null,ch__4842,"n");
-
-if(cljs.core.truth_(or__3548__auto____4843))
-{return or__3548__auto____4843;
+var ch = cljs.reader.read_char.call(null,reader);
+if((function (){var or__3943__auto__ = (ch === "n");
+if(or__3943__auto__)
+{return or__3943__auto__;
} else
-{var or__3548__auto____4844 = cljs.core._EQ_.call(null,ch__4842,"r");
-
-if(cljs.core.truth_(or__3548__auto____4844))
-{return or__3548__auto____4844;
+{var or__3943__auto____$1 = (ch === "r");
+if(or__3943__auto____$1)
+{return or__3943__auto____$1;
} else
-{return cljs.core.nil_QMARK_.call(null,ch__4842);
+{return (ch == null);
}
}
-})()))
+})())
{return reader;
} else
{{
@@ -260,79 +245,159 @@ cljs.reader.int_pattern = cljs.core.re_pattern.call(null,"([-+]?)(?:(0)|([1-9][0
cljs.reader.ratio_pattern = cljs.core.re_pattern.call(null,"([-+]?[0-9]+)/([0-9]+)");
cljs.reader.float_pattern = cljs.core.re_pattern.call(null,"([-+]?[0-9]+(\\.[0-9]*)?([eE][-+]?[0-9]+)?)(M)?");
cljs.reader.symbol_pattern = cljs.core.re_pattern.call(null,"[:]?([^0-9/].*/)?([^0-9/][^/]*)");
+cljs.reader.re_find_STAR_ = (function re_find_STAR_(re,s){
+var matches = re.exec(s);
+if((matches == null))
+{return null;
+} else
+{if((matches.length === 1))
+{return (matches[0]);
+} else
+{return matches;
+}
+}
+});
cljs.reader.match_int = (function match_int(s){
-var groups__4845 = cljs.core.re_find.call(null,cljs.reader.int_pattern,s);
-var group3__4846 = cljs.core.nth.call(null,groups__4845,2);
-
-if(cljs.core.truth_(cljs.core.not.call(null,(function (){var or__3548__auto____4847 = (void 0 === group3__4846);
-
-if(cljs.core.truth_(or__3548__auto____4847))
-{return or__3548__auto____4847;
+var groups = cljs.reader.re_find_STAR_.call(null,cljs.reader.int_pattern,s);
+var group3 = (groups[2]);
+if(!((function (){var or__3943__auto__ = (group3 == null);
+if(or__3943__auto__)
+{return or__3943__auto__;
} else
-{return (group3__4846.length < 1);
+{return (group3.length < 1);
}
-})())))
+})()))
{return 0;
} else
-{var negate__4849 = (cljs.core.truth_(cljs.core._EQ_.call(null,"-",cljs.core.nth.call(null,groups__4845,1)))?-1:1);
-var vec__4848__4850 = (cljs.core.truth_(cljs.core.nth.call(null,groups__4845,3))?cljs.core.Vector.fromArray([cljs.core.nth.call(null,groups__4845,3),10]):(cljs.core.truth_(cljs.core.nth.call(null,groups__4845,4))?cljs.core.Vector.fromArray([cljs.core.nth.call(null,groups__4845,4),16]):(cljs.core.truth_(cljs.core.nth.call(null,groups__4845,5))?cljs.core.Vector.fromArray([cljs.core.nth.call(null,groups__4845,5),8]):(cljs.core.truth_(cljs.core.nth.call(null,groups__4845,7))?cljs.core.Vector.fromArray([cljs.core.nth.call(null,groups__4845,7),parseInt.call(null,cljs.core.nth.call(null,groups__4845,7))]):(cljs.core.truth_("﷐'default")?cljs.core.Vector.fromArray([null,null]):null)))));
-var n__4851 = cljs.core.nth.call(null,vec__4848__4850,0,null);
-var radix__4852 = cljs.core.nth.call(null,vec__4848__4850,1,null);
-
-if(cljs.core.truth_(cljs.core.nil_QMARK_.call(null,n__4851)))
+{var negate = ((("-" === (groups[1])))?-1:1);
+var a = (cljs.core.truth_((groups[3]))?[(groups[3]),10]:(cljs.core.truth_((groups[4]))?[(groups[4]),16]:(cljs.core.truth_((groups[5]))?[(groups[5]),8]:(cljs.core.truth_((groups[7]))?[(groups[7]),parseInt((groups[7]))]:(("\uFDD0:default")?[null,null]:null)))));
+var n = (a[0]);
+var radix = (a[1]);
+if((n == null))
{return null;
} else
-{return (negate__4849 * parseInt.call(null,n__4851,radix__4852));
+{return (negate * parseInt(n,radix));
}
}
});
cljs.reader.match_ratio = (function match_ratio(s){
-var groups__4853 = cljs.core.re_find.call(null,cljs.reader.ratio_pattern,s);
-var numinator__4854 = cljs.core.nth.call(null,groups__4853,1);
-var denominator__4855 = cljs.core.nth.call(null,groups__4853,2);
-
-return (parseInt.call(null,numinator__4854) / parseInt.call(null,denominator__4855));
+var groups = cljs.reader.re_find_STAR_.call(null,cljs.reader.ratio_pattern,s);
+var numinator = (groups[1]);
+var denominator = (groups[2]);
+return (parseInt(numinator) / parseInt(denominator));
});
cljs.reader.match_float = (function match_float(s){
-return parseFloat.call(null,s);
+return parseFloat(s);
+});
+cljs.reader.re_matches_STAR_ = (function re_matches_STAR_(re,s){
+var matches = re.exec(s);
+if((function (){var and__3941__auto__ = !((matches == null));
+if(and__3941__auto__)
+{return ((matches[0]) === s);
+} else
+{return and__3941__auto__;
+}
+})())
+{if((matches.length === 1))
+{return (matches[0]);
+} else
+{return matches;
+}
+} else
+{return null;
+}
});
cljs.reader.match_number = (function match_number(s){
-if(cljs.core.truth_(cljs.core.re_matches.call(null,cljs.reader.int_pattern,s)))
+if(cljs.core.truth_(cljs.reader.re_matches_STAR_.call(null,cljs.reader.int_pattern,s)))
{return cljs.reader.match_int.call(null,s);
} else
-{if(cljs.core.truth_(cljs.core.re_matches.call(null,cljs.reader.ratio_pattern,s)))
+{if(cljs.core.truth_(cljs.reader.re_matches_STAR_.call(null,cljs.reader.ratio_pattern,s)))
{return cljs.reader.match_ratio.call(null,s);
} else
-{if(cljs.core.truth_(cljs.core.re_matches.call(null,cljs.reader.float_pattern,s)))
+{if(cljs.core.truth_(cljs.reader.re_matches_STAR_.call(null,cljs.reader.float_pattern,s)))
{return cljs.reader.match_float.call(null,s);
} else
{return null;
}
}
}
});
-cljs.reader.escape_char_map = cljs.core.HashMap.fromArrays(["t","r","n","\\","\"","b","f"],["\t","\r","\n","\\","\"","\b","\f"]);
-cljs.reader.read_unicode_char = (function read_unicode_char(reader,initch){
-return cljs.reader.reader_error.call(null,reader,"Unicode characters not supported by reader (yet)");
+cljs.reader.escape_char_map = (function escape_char_map(c){
+if((c === "t"))
+{return "\t";
+} else
+{if((c === "r"))
+{return "\r";
+} else
+{if((c === "n"))
+{return "\n";
+} else
+{if((c === "\\"))
+{return "\\";
+} else
+{if((c === "\""))
+{return "\"";
+} else
+{if((c === "b"))
+{return "\b";
+} else
+{if((c === "f"))
+{return "\f";
+} else
+{if("\uFDD0:else")
+{return null;
+} else
+{return null;
+}
+}
+}
+}
+}
+}
+}
+}
+});
+cljs.reader.read_2_chars = (function read_2_chars(reader){
+return (new goog.string.StringBuffer(cljs.reader.read_char.call(null,reader),cljs.reader.read_char.call(null,reader))).toString();
+});
+cljs.reader.read_4_chars = (function read_4_chars(reader){
+return (new goog.string.StringBuffer(cljs.reader.read_char.call(null,reader),cljs.reader.read_char.call(null,reader),cljs.reader.read_char.call(null,reader),cljs.reader.read_char.call(null,reader))).toString();
+});
+cljs.reader.unicode_2_pattern = cljs.core.re_pattern.call(null,"[0-9A-Fa-f]{2}");
+cljs.reader.unicode_4_pattern = cljs.core.re_pattern.call(null,"[0-9A-Fa-f]{4}");
+cljs.reader.validate_unicode_escape = (function validate_unicode_escape(unicode_pattern,reader,escape_char,unicode_str){
+if(cljs.core.truth_(cljs.core.re_matches.call(null,unicode_pattern,unicode_str)))
+{return unicode_str;
+} else
+{return cljs.reader.reader_error.call(null,reader,"Unexpected unicode escape \\",escape_char,unicode_str);
+}
+});
+cljs.reader.make_unicode_char = (function make_unicode_char(code_str){
+var code = parseInt(code_str,16);
+return String.fromCharCode(code);
});
cljs.reader.escape_char = (function escape_char(buffer,reader){
-var ch__4856 = cljs.reader.read_char.call(null,reader);
-var mapresult__4857 = cljs.core.get.call(null,cljs.reader.escape_char_map,ch__4856);
-
-if(cljs.core.truth_(mapresult__4857))
-{return mapresult__4857;
+var ch = cljs.reader.read_char.call(null,reader);
+var mapresult = cljs.reader.escape_char_map.call(null,ch);
+if(cljs.core.truth_(mapresult))
+{return mapresult;
} else
-{if(cljs.core.truth_((function (){var or__3548__auto____4858 = cljs.core._EQ_.call(null,"u",ch__4856);
-
-if(cljs.core.truth_(or__3548__auto____4858))
-{return or__3548__auto____4858;
+{if((ch === "x"))
+{return cljs.reader.make_unicode_char.call(null,cljs.reader.validate_unicode_escape.call(null,cljs.reader.unicode_2_pattern,reader,ch,cljs.reader.read_2_chars.call(null,reader)));
} else
-{return cljs.reader.numeric_QMARK_.call(null,ch__4856);
-}
-})()))
-{return cljs.reader.read_unicode_char.call(null,reader,ch__4856);
+{if((ch === "u"))
+{return cljs.reader.make_unicode_char.call(null,cljs.reader.validate_unicode_escape.call(null,cljs.reader.unicode_4_pattern,reader,ch,cljs.reader.read_4_chars.call(null,reader)));
+} else
+{if(cljs.reader.numeric_QMARK_.call(null,ch))
+{return String.fromCharCode(ch);
+} else
+{if("\uFDD0:else")
+{return cljs.reader.reader_error.call(null,reader,"Unexpected unicode escape \\",ch);
} else
-{return cljs.reader.reader_error.call(null,reader,"Unsupported escape charater: \\",ch__4856);
+{return null;
+}
+}
+}
}
}
});
@@ -341,53 +406,46 @@ if(cljs.core.truth_(or__3548__auto____4858))
* char.
*/
cljs.reader.read_past = (function read_past(pred,rdr){
-var ch__4859 = cljs.reader.read_char.call(null,rdr);
-
+var ch = cljs.reader.read_char.call(null,rdr);
while(true){
-if(cljs.core.truth_(pred.call(null,ch__4859)))
+if(cljs.core.truth_(pred.call(null,ch)))
{{
-var G__4860 = cljs.reader.read_char.call(null,rdr);
-ch__4859 = G__4860;
+var G__4535 = cljs.reader.read_char.call(null,rdr);
+ch = G__4535;
continue;
}
} else
-{return ch__4859;
+{return ch;
}
break;
}
});
cljs.reader.read_delimited_list = (function read_delimited_list(delim,rdr,recursive_QMARK_){
-var a__4861 = cljs.core.Vector.fromArray([]);
-
+var a = cljs.core.transient$.call(null,cljs.core.PersistentVector.EMPTY);
while(true){
-var ch__4862 = cljs.reader.read_past.call(null,cljs.reader.whitespace_QMARK_,rdr);
-
-if(cljs.core.truth_(ch__4862))
+var ch = cljs.reader.read_past.call(null,cljs.reader.whitespace_QMARK_,rdr);
+if(cljs.core.truth_(ch))
{} else
-{cljs.reader.reader_error.call(null,rdr,"EOF");
+{cljs.reader.reader_error.call(null,rdr,"EOF while reading");
}
-if(cljs.core.truth_(cljs.core._EQ_.call(null,delim,ch__4862)))
-{return a__4861;
+if((delim === ch))
+{return cljs.core.persistent_BANG_.call(null,a);
} else
-{var temp__3695__auto____4863 = cljs.core.get.call(null,cljs.reader.macros,ch__4862);
-
-if(cljs.core.truth_(temp__3695__auto____4863))
-{var macrofn__4864 = temp__3695__auto____4863;
-
-var mret__4865 = macrofn__4864.call(null,rdr,ch__4862);
-
+{var temp__4090__auto__ = cljs.reader.macros.call(null,ch);
+if(cljs.core.truth_(temp__4090__auto__))
+{var macrofn = temp__4090__auto__;
+var mret = macrofn.call(null,rdr,ch);
{
-var G__4867 = (cljs.core.truth_(cljs.core._EQ_.call(null,mret__4865,rdr))?a__4861:cljs.core.conj.call(null,a__4861,mret__4865));
-a__4861 = G__4867;
+var G__4536 = (((mret === rdr))?a:cljs.core.conj_BANG_.call(null,a,mret));
+a = G__4536;
continue;
}
} else
-{cljs.reader.unread.call(null,rdr,ch__4862);
-var o__4866 = cljs.reader.read.call(null,rdr,true,null,recursive_QMARK_);
-
+{cljs.reader.unread.call(null,rdr,ch);
+var o = cljs.reader.read.call(null,rdr,true,null,recursive_QMARK_);
{
-var G__4868 = (cljs.core.truth_(cljs.core._EQ_.call(null,o__4866,rdr))?a__4861:cljs.core.conj.call(null,a__4861,o__4866));
-a__4861 = G__4868;
+var G__4537 = (((o === rdr))?a:cljs.core.conj_BANG_.call(null,a,o));
+a = G__4537;
continue;
}
}
@@ -399,13 +457,18 @@ cljs.reader.not_implemented = (function not_implemented(rdr,ch){
return cljs.reader.reader_error.call(null,rdr,"Reader for ",ch," not implemented yet");
});
cljs.reader.read_dispatch = (function read_dispatch(rdr,_){
-var ch__4869 = cljs.reader.read_char.call(null,rdr);
-var dm__4870 = cljs.core.get.call(null,cljs.reader.dispatch_macros,ch__4869);
-
-if(cljs.core.truth_(dm__4870))
-{return dm__4870.call(null,rdr,_);
+var ch = cljs.reader.read_char.call(null,rdr);
+var dm = cljs.reader.dispatch_macros.call(null,ch);
+if(cljs.core.truth_(dm))
+{return dm.call(null,rdr,_);
} else
-{return cljs.reader.reader_error.call(null,rdr,"No dispatch macro for ",ch__4869);
+{var temp__4090__auto__ = cljs.reader.maybe_read_tagged_type.call(null,rdr,ch);
+if(cljs.core.truth_(temp__4090__auto__))
+{var obj = temp__4090__auto__;
+return obj;
+} else
+{return cljs.reader.reader_error.call(null,rdr,"No dispatch macro for ",ch);
+}
}
});
cljs.reader.read_unmatched_delimiter = (function read_unmatched_delimiter(rdr,ch){
@@ -419,87 +482,80 @@ cljs.reader.read_vector = (function read_vector(rdr,_){
return cljs.reader.read_delimited_list.call(null,"]",rdr,true);
});
cljs.reader.read_map = (function read_map(rdr,_){
-var l__4871 = cljs.reader.read_delimited_list.call(null,"}",rdr,true);
-
-if(cljs.core.truth_(cljs.core.odd_QMARK_.call(null,cljs.core.count.call(null,l__4871))))
+var l = cljs.reader.read_delimited_list.call(null,"}",rdr,true);
+if(cljs.core.odd_QMARK_.call(null,cljs.core.count.call(null,l)))
{cljs.reader.reader_error.call(null,rdr,"Map literal must contain an even number of forms");
} else
{}
-return cljs.core.apply.call(null,cljs.core.hash_map,l__4871);
+return cljs.core.apply.call(null,cljs.core.hash_map,l);
});
cljs.reader.read_number = (function read_number(reader,initch){
-var buffer__4872 = (new goog.string.StringBuffer(initch));
-var ch__4873 = cljs.reader.read_char.call(null,reader);
-
+var buffer = (new goog.string.StringBuffer(initch));
+var ch = cljs.reader.read_char.call(null,reader);
while(true){
-if(cljs.core.truth_((function (){var or__3548__auto____4874 = cljs.core.nil_QMARK_.call(null,ch__4873);
-
-if(cljs.core.truth_(or__3548__auto____4874))
-{return or__3548__auto____4874;
+if(cljs.core.truth_((function (){var or__3943__auto__ = (ch == null);
+if(or__3943__auto__)
+{return or__3943__auto__;
} else
-{var or__3548__auto____4875 = cljs.reader.whitespace_QMARK_.call(null,ch__4873);
-
-if(cljs.core.truth_(or__3548__auto____4875))
-{return or__3548__auto____4875;
+{var or__3943__auto____$1 = cljs.reader.whitespace_QMARK_.call(null,ch);
+if(or__3943__auto____$1)
+{return or__3943__auto____$1;
} else
-{return cljs.core.contains_QMARK_.call(null,cljs.reader.macros,ch__4873);
+{return cljs.reader.macros.call(null,ch);
}
}
})()))
-{cljs.reader.unread.call(null,reader,ch__4873);
-var s__4876 = buffer__4872.toString();
-
-var or__3548__auto____4877 = cljs.reader.match_number.call(null,s__4876);
-
-if(cljs.core.truth_(or__3548__auto____4877))
-{return or__3548__auto____4877;
+{cljs.reader.unread.call(null,reader,ch);
+var s = buffer.toString();
+var or__3943__auto__ = cljs.reader.match_number.call(null,s);
+if(cljs.core.truth_(or__3943__auto__))
+{return or__3943__auto__;
} else
-{return cljs.reader.reader_error.call(null,reader,"Invalid number format [",s__4876,"]");
+{return cljs.reader.reader_error.call(null,reader,"Invalid number format [",s,"]");
}
} else
{{
-var G__4878 = (function (){buffer__4872.append(ch__4873);
-return buffer__4872;
+var G__4538 = (function (){buffer.append(ch);
+return buffer;
})();
-var G__4879 = cljs.reader.read_char.call(null,reader);
-buffer__4872 = G__4878;
-ch__4873 = G__4879;
+var G__4539 = cljs.reader.read_char.call(null,reader);
+buffer = G__4538;
+ch = G__4539;
continue;
}
}
break;
}
});
-cljs.reader.read_string = (function read_string(reader,_){
-var buffer__4880 = (new goog.string.StringBuffer());
-var ch__4881 = cljs.reader.read_char.call(null,reader);
-
+cljs.reader.read_string_STAR_ = (function read_string_STAR_(reader,_){
+var buffer = (new goog.string.StringBuffer());
+var ch = cljs.reader.read_char.call(null,reader);
while(true){
-if(cljs.core.truth_(cljs.core.nil_QMARK_.call(null,ch__4881)))
-{return cljs.reader.reader_error.call(null,reader,"EOF while reading string");
+if((ch == null))
+{return cljs.reader.reader_error.call(null,reader,"EOF while reading");
} else
-{if(cljs.core.truth_(cljs.core._EQ_.call(null,"\\",ch__4881)))
+{if(("\\" === ch))
{{
-var G__4882 = (function (){buffer__4880.append(cljs.reader.escape_char.call(null,buffer__4880,reader));
-return buffer__4880;
+var G__4540 = (function (){buffer.append(cljs.reader.escape_char.call(null,buffer,reader));
+return buffer;
})();
-var G__4883 = cljs.reader.read_char.call(null,reader);
-buffer__4880 = G__4882;
-ch__4881 = G__4883;
+var G__4541 = cljs.reader.read_char.call(null,reader);
+buffer = G__4540;
+ch = G__4541;
continue;
}
} else
-{if(cljs.core.truth_(cljs.core._EQ_.call(null,"\"",ch__4881)))
-{return buffer__4880.toString();
+{if(("\"" === ch))
+{return buffer.toString();
} else
-{if(cljs.core.truth_("﷐'default"))
+{if("\uFDD0:default")
{{
-var G__4884 = (function (){buffer__4880.append(ch__4881);
-return buffer__4880;
+var G__4542 = (function (){buffer.append(ch);
+return buffer;
})();
-var G__4885 = cljs.reader.read_char.call(null,reader);
-buffer__4880 = G__4884;
-ch__4881 = G__4885;
+var G__4543 = cljs.reader.read_char.call(null,reader);
+buffer = G__4542;
+ch = G__4543;
continue;
}
} else
@@ -511,64 +567,83 @@ continue;
break;
}
});
-cljs.reader.special_symbols = cljs.core.ObjMap.fromObject(["nil","true","false"],{"nil":null,"true":true,"false":false});
+cljs.reader.special_symbols = (function special_symbols(t,not_found){
+if((t === "nil"))
+{return null;
+} else
+{if((t === "true"))
+{return true;
+} else
+{if((t === "false"))
+{return false;
+} else
+{if("\uFDD0:else")
+{return not_found;
+} else
+{return null;
+}
+}
+}
+}
+});
cljs.reader.read_symbol = (function read_symbol(reader,initch){
-var token__4886 = cljs.reader.read_token.call(null,reader,initch);
-
-if(cljs.core.truth_(goog.string.contains.call(null,token__4886,"/")))
-{return cljs.core.symbol.call(null,cljs.core.subs.call(null,token__4886,0,token__4886.indexOf("/")),cljs.core.subs.call(null,token__4886,(token__4886.indexOf("/") + 1),token__4886.length));
+var token = cljs.reader.read_token.call(null,reader,initch);
+if(cljs.core.truth_(goog.string.contains(token,"/")))
+{return cljs.core.symbol.call(null,cljs.core.subs.call(null,token,0,token.indexOf("/")),cljs.core.subs.call(null,token,(token.indexOf("/") + 1),token.length));
} else
-{return cljs.core.get.call(null,cljs.reader.special_symbols,token__4886,cljs.core.symbol.call(null,token__4886));
+{return cljs.reader.special_symbols.call(null,token,cljs.core.symbol.call(null,token));
}
});
cljs.reader.read_keyword = (function read_keyword(reader,initch){
-var token__4888 = cljs.reader.read_token.call(null,reader,cljs.reader.read_char.call(null,reader));
-var vec__4887__4889 = cljs.core.re_matches.call(null,cljs.reader.symbol_pattern,token__4888);
-var token__4890 = cljs.core.nth.call(null,vec__4887__4889,0,null);
-var ns__4891 = cljs.core.nth.call(null,vec__4887__4889,1,null);
-var name__4892 = cljs.core.nth.call(null,vec__4887__4889,2,null);
-
-if(cljs.core.truth_((function (){var or__3548__auto____4894 = (function (){var and__3546__auto____4893 = cljs.core.not.call(null,(void 0 === ns__4891));
-
-if(cljs.core.truth_(and__3546__auto____4893))
-{return (ns__4891.substring((ns__4891.length - 2),ns__4891.length) === ":/");
+var token = cljs.reader.read_token.call(null,reader,cljs.reader.read_char.call(null,reader));
+var a = cljs.reader.re_matches_STAR_.call(null,cljs.reader.symbol_pattern,token);
+var token__$1 = (a[0]);
+var ns = (a[1]);
+var name = (a[2]);
+if(cljs.core.truth_((function (){var or__3943__auto__ = (function (){var and__3941__auto__ = !((void 0 === ns));
+if(and__3941__auto__)
+{return (ns.substring((ns.length - 2),ns.length) === ":/");
} else
-{return and__3546__auto____4893;
+{return and__3941__auto__;
}
})();
-
-if(cljs.core.truth_(or__3548__auto____4894))
-{return or__3548__auto____4894;
+if(cljs.core.truth_(or__3943__auto__))
+{return or__3943__auto__;
} else
-{var or__3548__auto____4895 = ((name__4892[(name__4892.length - 1)]) === ":");
-
-if(cljs.core.truth_(or__3548__auto____4895))
-{return or__3548__auto____4895;
+{var or__3943__auto____$1 = ((name[(name.length - 1)]) === ":");
+if(or__3943__auto____$1)
+{return or__3943__auto____$1;
} else
-{return cljs.core.not.call(null,(token__4890.indexOf("::",1) === -1));
+{return !((token__$1.indexOf("::",1) === -1));
}
}
})()))
-{return cljs.reader.reader_error.call(null,reader,"Invalid token: ",token__4890);
+{return cljs.reader.reader_error.call(null,reader,"Invalid token: ",token__$1);
} else
-{if(cljs.core.truth_(cljs.reader.ns_QMARK_))
-{return cljs.core.keyword.call(null,ns__4891.substring(0,ns__4891.indexOf("/")),name__4892);
+{if((function (){var and__3941__auto__ = !((ns == null));
+if(and__3941__auto__)
+{return (ns.length > 0);
} else
-{return cljs.core.keyword.call(null,token__4890);
+{return and__3941__auto__;
+}
+})())
+{return cljs.core.keyword.call(null,ns.substring(0,ns.indexOf("/")),name);
+} else
+{return cljs.core.keyword.call(null,token__$1);
}
}
});
cljs.reader.desugar_meta = (function desugar_meta(f){
-if(cljs.core.truth_(cljs.core.symbol_QMARK_.call(null,f)))
-{return cljs.core.ObjMap.fromObject(["﷐'tag"],{"﷐'tag":f});
+if((f instanceof cljs.core.Symbol))
+{return cljs.core.PersistentArrayMap.fromArray(["\uFDD0:tag",f], true);
} else
-{if(cljs.core.truth_(cljs.core.string_QMARK_.call(null,f)))
-{return cljs.core.ObjMap.fromObject(["﷐'tag"],{"﷐'tag":f});
+{if(cljs.core.string_QMARK_.call(null,f))
+{return cljs.core.PersistentArrayMap.fromArray(["\uFDD0:tag",f], true);
} else
-{if(cljs.core.truth_(cljs.core.keyword_QMARK_.call(null,f)))
-{return cljs.core.HashMap.fromArrays([f],[true]);
+{if(cljs.core.keyword_QMARK_.call(null,f))
+{return cljs.core.PersistentArrayMap.fromArray([f,true], true);
} else
-{if(cljs.core.truth_("﷐'else"))
+{if("\uFDD0:else")
{return f;
} else
{return null;
@@ -588,36 +663,34 @@ return cljs.reader.reader_error.call(null,rdr,msg);
});
});
cljs.reader.read_meta = (function read_meta(rdr,_){
-var m__4896 = cljs.reader.desugar_meta.call(null,cljs.reader.read.call(null,rdr,true,null,true));
-
-if(cljs.core.truth_(cljs.core.map_QMARK_.call(null,m__4896)))
+var m = cljs.reader.desugar_meta.call(null,cljs.reader.read.call(null,rdr,true,null,true));
+if(cljs.core.map_QMARK_.call(null,m))
{} else
{cljs.reader.reader_error.call(null,rdr,"Metadata must be Symbol,Keyword,String or Map");
}
-var o__4897 = cljs.reader.read.call(null,rdr,true,null,true);
-
-if(cljs.core.truth_((function (){var x__445__auto____4898 = o__4897;
-
-if(cljs.core.truth_((function (){var and__3546__auto____4899 = x__445__auto____4898;
-
-if(cljs.core.truth_(and__3546__auto____4899))
-{var and__3546__auto____4900 = x__445__auto____4898.cljs$core$IWithMeta$;
-
-if(cljs.core.truth_(and__3546__auto____4900))
-{return cljs.core.not.call(null,x__445__auto____4898.hasOwnProperty("cljs$core$IWithMeta$"));
+var o = cljs.reader.read.call(null,rdr,true,null,true);
+if((function (){var G__4545 = o;
+if(G__4545)
+{if((function (){var or__3943__auto__ = (G__4545.cljs$lang$protocol_mask$partition0$ & 262144);
+if(or__3943__auto__)
+{return or__3943__auto__;
} else
-{return and__3546__auto____4900;
+{return G__4545.cljs$core$IWithMeta$;
}
+})())
+{return true;
+} else
+{if((!G__4545.cljs$lang$protocol_mask$partition0$))
+{return cljs.core.type_satisfies_.call(null,cljs.core.IWithMeta,G__4545);
} else
-{return and__3546__auto____4899;
+{return false;
+}
}
-})()))
-{return true;
} else
-{return cljs.core.type_satisfies_.call(null,cljs.core.IWithMeta,x__445__auto____4898);
+{return cljs.core.type_satisfies_.call(null,cljs.core.IWithMeta,G__4545);
}
-})()))
-{return cljs.core.with_meta.call(null,o__4897,cljs.core.merge.call(null,cljs.core.meta.call(null,o__4897),m__4896));
+})())
+{return cljs.core.with_meta.call(null,o,cljs.core.merge.call(null,cljs.core.meta.call(null,o),m));
} else
{return cljs.reader.reader_error.call(null,rdr,"Metadata can only be applied to IWithMetas");
}
@@ -626,72 +699,171 @@ cljs.reader.read_set = (function read_set(rdr,_){
return cljs.core.set.call(null,cljs.reader.read_delimited_list.call(null,"}",rdr,true));
});
cljs.reader.read_regex = (function read_regex(rdr,ch){
-return cljs.core.re_pattern.call(null,cljs.reader.read_string.call(null,rdr,ch));
+return cljs.core.re_pattern.call(null,cljs.reader.read_string_STAR_.call(null,rdr,ch));
});
cljs.reader.read_discard = (function read_discard(rdr,_){
cljs.reader.read.call(null,rdr,true,null,true);
return rdr;
});
-cljs.reader.macros = cljs.core.HashMap.fromArrays(["@","`","\"","#","%","'","(",")",":",";","[","{","\\","]","}","^","~"],[cljs.reader.wrapping_reader.call(null,"﷑'deref"),cljs.reader.not_implemented,cljs.reader.read_string,cljs.reader.read_dispatch,cljs.reader.not_implemented,cljs.reader.wrapping_reader.call(null,"﷑'quote"),cljs.reader.read_list,cljs.reader.read_unmatched_delimiter,cljs.reader.read_keyword,cljs.reader.not_implemented,cljs.reader.read_vector,cljs.reader.read_map,cljs.reader.read_char,cljs.reader.read_unmatched_delimiter,cljs.reader.read_unmatched_delimiter,cljs.reader.read_meta,cljs.reader.not_implemented]);
-cljs.reader.dispatch_macros = cljs.core.ObjMap.fromObject(["{","<","\"","!","_"],{"{":cljs.reader.read_set,"<":cljs.reader.throwing_reader.call(null,"Unreadable form"),"\"":cljs.reader.read_regex,"!":cljs.reader.read_comment,"_":cljs.reader.read_discard});
+cljs.reader.macros = (function macros(c){
+if((c === "\""))
+{return cljs.reader.read_string_STAR_;
+} else
+{if((c === ":"))
+{return cljs.reader.read_keyword;
+} else
+{if((c === ";"))
+{return cljs.reader.not_implemented;
+} else
+{if((c === "'"))
+{return cljs.reader.wrapping_reader.call(null,new cljs.core.Symbol(null,"quote","quote",-1532577739,null));
+} else
+{if((c === "@"))
+{return cljs.reader.wrapping_reader.call(null,new cljs.core.Symbol(null,"deref","deref",-1545057749,null));
+} else
+{if((c === "^"))
+{return cljs.reader.read_meta;
+} else
+{if((c === "`"))
+{return cljs.reader.not_implemented;
+} else
+{if((c === "~"))
+{return cljs.reader.not_implemented;
+} else
+{if((c === "("))
+{return cljs.reader.read_list;
+} else
+{if((c === ")"))
+{return cljs.reader.read_unmatched_delimiter;
+} else
+{if((c === "["))
+{return cljs.reader.read_vector;
+} else
+{if((c === "]"))
+{return cljs.reader.read_unmatched_delimiter;
+} else
+{if((c === "{"))
+{return cljs.reader.read_map;
+} else
+{if((c === "}"))
+{return cljs.reader.read_unmatched_delimiter;
+} else
+{if((c === "\\"))
+{return cljs.reader.read_char;
+} else
+{if((c === "%"))
+{return cljs.reader.not_implemented;
+} else
+{if((c === "#"))
+{return cljs.reader.read_dispatch;
+} else
+{if("\uFDD0:else")
+{return null;
+} else
+{return null;
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+});
+cljs.reader.dispatch_macros = (function dispatch_macros(s){
+if((s === "{"))
+{return cljs.reader.read_set;
+} else
+{if((s === "<"))
+{return cljs.reader.throwing_reader.call(null,"Unreadable form");
+} else
+{if((s === "\""))
+{return cljs.reader.read_regex;
+} else
+{if((s === "!"))
+{return cljs.reader.read_comment;
+} else
+{if((s === "_"))
+{return cljs.reader.read_discard;
+} else
+{if("\uFDD0:else")
+{return null;
+} else
+{return null;
+}
+}
+}
+}
+}
+}
+});
/**
* Reads the first object from a PushbackReader. Returns the object read.
* If EOF, throws if eof-is-error is true. Otherwise returns sentinel.
*/
cljs.reader.read = (function read(reader,eof_is_error,sentinel,is_recursive){
while(true){
-var ch__4901 = cljs.reader.read_char.call(null,reader);
-
-if(cljs.core.truth_(cljs.core.nil_QMARK_.call(null,ch__4901)))
+var ch = cljs.reader.read_char.call(null,reader);
+if((ch == null))
{if(cljs.core.truth_(eof_is_error))
-{return cljs.reader.reader_error.call(null,reader,"EOF");
+{return cljs.reader.reader_error.call(null,reader,"EOF while reading");
} else
{return sentinel;
}
} else
-{if(cljs.core.truth_(cljs.reader.whitespace_QMARK_.call(null,ch__4901)))
+{if(cljs.reader.whitespace_QMARK_.call(null,ch))
{{
-var G__4903 = reader;
-var G__4904 = eof_is_error;
-var G__4905 = sentinel;
-var G__4906 = is_recursive;
-reader = G__4903;
-eof_is_error = G__4904;
-sentinel = G__4905;
-is_recursive = G__4906;
+var G__4546 = reader;
+var G__4547 = eof_is_error;
+var G__4548 = sentinel;
+var G__4549 = is_recursive;
+reader = G__4546;
+eof_is_error = G__4547;
+sentinel = G__4548;
+is_recursive = G__4549;
continue;
}
} else
-{if(cljs.core.truth_(cljs.reader.comment_prefix_QMARK_.call(null,ch__4901)))
+{if(cljs.reader.comment_prefix_QMARK_.call(null,ch))
{{
-var G__4907 = cljs.reader.read_comment.call(null,reader,ch__4901);
-var G__4908 = eof_is_error;
-var G__4909 = sentinel;
-var G__4910 = is_recursive;
-reader = G__4907;
-eof_is_error = G__4908;
-sentinel = G__4909;
-is_recursive = G__4910;
+var G__4550 = cljs.reader.read_comment.call(null,reader,ch);
+var G__4551 = eof_is_error;
+var G__4552 = sentinel;
+var G__4553 = is_recursive;
+reader = G__4550;
+eof_is_error = G__4551;
+sentinel = G__4552;
+is_recursive = G__4553;
continue;
}
} else
-{if(cljs.core.truth_("﷐'else"))
-{var res__4902 = (cljs.core.truth_(cljs.reader.macros.call(null,ch__4901))?cljs.reader.macros.call(null,ch__4901).call(null,reader,ch__4901):(cljs.core.truth_(cljs.reader.number_literal_QMARK_.call(null,reader,ch__4901))?cljs.reader.read_number.call(null,reader,ch__4901):(cljs.core.truth_("﷐'else")?cljs.reader.read_symbol.call(null,reader,ch__4901):null)));
-
-if(cljs.core.truth_(cljs.core._EQ_.call(null,res__4902,reader)))
+{if("\uFDD0:else")
+{var f = cljs.reader.macros.call(null,ch);
+var res = (cljs.core.truth_(f)?f.call(null,reader,ch):((cljs.reader.number_literal_QMARK_.call(null,reader,ch))?cljs.reader.read_number.call(null,reader,ch):(("\uFDD0:else")?cljs.reader.read_symbol.call(null,reader,ch):null)));
+if((res === reader))
{{
-var G__4911 = reader;
-var G__4912 = eof_is_error;
-var G__4913 = sentinel;
-var G__4914 = is_recursive;
-reader = G__4911;
-eof_is_error = G__4912;
-sentinel = G__4913;
-is_recursive = G__4914;
+var G__4554 = reader;
+var G__4555 = eof_is_error;
+var G__4556 = sentinel;
+var G__4557 = is_recursive;
+reader = G__4554;
+eof_is_error = G__4555;
+sentinel = G__4556;
+is_recursive = G__4557;
continue;
}
} else
-{return res__4902;
+{return res;
}
} else
{return null;
@@ -706,7 +878,209 @@ break;
* Reads one object from the string s
*/
cljs.reader.read_string = (function read_string(s){
-var r__4915 = cljs.reader.push_back_reader.call(null,s);
-
-return cljs.reader.read.call(null,r__4915,true,null,false);
+var r = cljs.reader.push_back_reader.call(null,s);
+return cljs.reader.read.call(null,r,true,null,false);
+});
+cljs.reader.zero_fill_right = (function zero_fill_right(s,width){
+if(cljs.core._EQ_.call(null,width,cljs.core.count.call(null,s)))
+{return s;
+} else
+{if((width < cljs.core.count.call(null,s)))
+{return s.substring(0,width);
+} else
+{if("\uFDD0:else")
+{var b = (new goog.string.StringBuffer(s));
+while(true){
+if((b.getLength() < width))
+{{
+var G__4558 = b.append("0");
+b = G__4558;
+continue;
+}
+} else
+{return b.toString();
+}
+break;
+}
+} else
+{return null;
+}
+}
+}
+});
+cljs.reader.divisible_QMARK_ = (function divisible_QMARK_(num,div){
+return (cljs.core.mod.call(null,num,div) === 0);
+});
+cljs.reader.indivisible_QMARK_ = (function indivisible_QMARK_(num,div){
+return cljs.core.not.call(null,cljs.reader.divisible_QMARK_.call(null,num,div));
+});
+cljs.reader.leap_year_QMARK_ = (function leap_year_QMARK_(year){
+var and__3941__auto__ = cljs.reader.divisible_QMARK_.call(null,year,4);
+if(cljs.core.truth_(and__3941__auto__))
+{var or__3943__auto__ = cljs.reader.indivisible_QMARK_.call(null,year,100);
+if(cljs.core.truth_(or__3943__auto__))
+{return or__3943__auto__;
+} else
+{return cljs.reader.divisible_QMARK_.call(null,year,400);
+}
+} else
+{return and__3941__auto__;
+}
+});
+cljs.reader.days_in_month = (function (){var dim_norm = cljs.core.PersistentVector.fromArray([null,31,28,31,30,31,30,31,31,30,31,30,31], true);
+var dim_leap = cljs.core.PersistentVector.fromArray([null,31,29,31,30,31,30,31,31,30,31,30,31], true);
+return (function (month,leap_year_QMARK_){
+return cljs.core.get.call(null,(cljs.core.truth_(leap_year_QMARK_)?dim_leap:dim_norm),month);
+});
+})();
+cljs.reader.parse_and_validate_timestamp = (function (){var timestamp = /(\d\d\d\d)(?:-(\d\d)(?:-(\d\d)(?:[T](\d\d)(?::(\d\d)(?::(\d\d)(?:[.](\d+))?)?)?)?)?)?(?:[Z]|([-+])(\d\d):(\d\d))?/;
+var check = ((function (timestamp){
+return (function (low,n,high,msg){
+if((function (){var and__3941__auto__ = (low <= n);
+if(and__3941__auto__)
+{return (n <= high);
+} else
+{return and__3941__auto__;
+}
+})())
+{} else
+{throw (new Error([cljs.core.str("Assert failed: "),cljs.core.str([cljs.core.str(msg),cljs.core.str(" Failed: "),cljs.core.str(low),cljs.core.str("<="),cljs.core.str(n),cljs.core.str("<="),cljs.core.str(high)].join('')),cljs.core.str("\n"),cljs.core.str(cljs.core.pr_str.call(null,cljs.core.list(new cljs.core.Symbol(null,"<=","<=",-1640529606,null),new cljs.core.Symbol(null,"low","low",-1640424179,null),new cljs.core.Symbol(null,"n","n",-1640531417,null),new cljs.core.Symbol(null,"high","high",-1637329061,null))))].join('')));
+}
+return n;
+});})(timestamp))
+;
+return (function (ts){
+var temp__4092__auto__ = cljs.core.map.call(null,cljs.core.vec,cljs.core.split_at.call(null,8,cljs.core.re_matches.call(null,timestamp,ts)));
+if(cljs.core.truth_(temp__4092__auto__))
+{var vec__4563 = temp__4092__auto__;
+var vec__4564 = cljs.core.nth.call(null,vec__4563,0,null);
+var _ = cljs.core.nth.call(null,vec__4564,0,null);
+var years = cljs.core.nth.call(null,vec__4564,1,null);
+var months = cljs.core.nth.call(null,vec__4564,2,null);
+var days = cljs.core.nth.call(null,vec__4564,3,null);
+var hours = cljs.core.nth.call(null,vec__4564,4,null);
+var minutes = cljs.core.nth.call(null,vec__4564,5,null);
+var seconds = cljs.core.nth.call(null,vec__4564,6,null);
+var milliseconds = cljs.core.nth.call(null,vec__4564,7,null);
+var vec__4565 = cljs.core.nth.call(null,vec__4563,1,null);
+var ___$1 = cljs.core.nth.call(null,vec__4565,0,null);
+var ___$2 = cljs.core.nth.call(null,vec__4565,1,null);
+var ___$3 = cljs.core.nth.call(null,vec__4565,2,null);
+var V = vec__4563;
+var vec__4566 = cljs.core.map.call(null,(function (v){
+return cljs.core.map.call(null,(function (p1__4562_SHARP_){
+return parseInt(p1__4562_SHARP_,10);
+}),v);
+}),cljs.core.map.call(null,(function (p1__4560_SHARP_,p2__4559_SHARP_){
+return cljs.core.update_in.call(null,p2__4559_SHARP_,cljs.core.PersistentVector.fromArray([0], true),p1__4560_SHARP_);
+}),cljs.core.PersistentVector.fromArray([cljs.core.constantly.call(null,null),(function (p1__4561_SHARP_){
+if(cljs.core._EQ_.call(null,p1__4561_SHARP_,"-"))
+{return "-1";
+} else
+{return "1";
+}
+})], true),V));
+var vec__4567 = cljs.core.nth.call(null,vec__4566,0,null);
+var ___$4 = cljs.core.nth.call(null,vec__4567,0,null);
+var y = cljs.core.nth.call(null,vec__4567,1,null);
+var mo = cljs.core.nth.call(null,vec__4567,2,null);
+var d = cljs.core.nth.call(null,vec__4567,3,null);
+var h = cljs.core.nth.call(null,vec__4567,4,null);
+var m = cljs.core.nth.call(null,vec__4567,5,null);
+var s = cljs.core.nth.call(null,vec__4567,6,null);
+var ms = cljs.core.nth.call(null,vec__4567,7,null);
+var vec__4568 = cljs.core.nth.call(null,vec__4566,1,null);
+var offset_sign = cljs.core.nth.call(null,vec__4568,0,null);
+var offset_hours = cljs.core.nth.call(null,vec__4568,1,null);
+var offset_minutes = cljs.core.nth.call(null,vec__4568,2,null);
+var offset = (offset_sign * ((offset_hours * 60) + offset_minutes));
+return cljs.core.PersistentVector.fromArray([((cljs.core.not.call(null,years))?1970:y),((cljs.core.not.call(null,months))?1:check.call(null,1,mo,12,"timestamp month field must be in range 1..12")),((cljs.core.not.call(null,days))?1:check.call(null,1,d,cljs.reader.days_in_month.call(null,mo,cljs.reader.leap_year_QMARK_.call(null,y)),"timestamp day field must be in range 1..last day in month")),((cljs.core.not.call(null,hours))?0:check.call(null,0,h,23,"timestamp hour field must be in range 0..23")),((cljs.core.not.call(null,minutes))?0:check.call(null,0,m,59,"timestamp minute field must be in range 0..59")),((cljs.core.not.call(null,seconds))?0:check.call(null,0,s,((cljs.core._EQ_.call(null,m,59))?60:59),"timestamp second field must be in range 0..60")),((cljs.core.not.call(null,milliseconds))?0:check.call(null,0,ms,999,"timestamp millisecond field must be in range 0..999")),offset], true);
+} else
+{return null;
+}
+});
+})();
+cljs.reader.parse_timestamp = (function parse_timestamp(ts){
+var temp__4090__auto__ = cljs.reader.parse_and_validate_timestamp.call(null,ts);
+if(cljs.core.truth_(temp__4090__auto__))
+{var vec__4570 = temp__4090__auto__;
+var years = cljs.core.nth.call(null,vec__4570,0,null);
+var months = cljs.core.nth.call(null,vec__4570,1,null);
+var days = cljs.core.nth.call(null,vec__4570,2,null);
+var hours = cljs.core.nth.call(null,vec__4570,3,null);
+var minutes = cljs.core.nth.call(null,vec__4570,4,null);
+var seconds = cljs.core.nth.call(null,vec__4570,5,null);
+var ms = cljs.core.nth.call(null,vec__4570,6,null);
+var offset = cljs.core.nth.call(null,vec__4570,7,null);
+return (new Date((Date.UTC(years,(months - 1),days,hours,minutes,seconds,ms) - ((offset * 60) * 1000))));
+} else
+{return cljs.reader.reader_error.call(null,null,[cljs.core.str("Unrecognized date/time syntax: "),cljs.core.str(ts)].join(''));
+}
+});
+cljs.reader.read_date = (function read_date(s){
+if(cljs.core.string_QMARK_.call(null,s))
+{return cljs.reader.parse_timestamp.call(null,s);
+} else
+{return cljs.reader.reader_error.call(null,null,"Instance literal expects a string for its timestamp.");
+}
+});
+cljs.reader.read_queue = (function read_queue(elems){
+if(cljs.core.vector_QMARK_.call(null,elems))
+{return cljs.core.into.call(null,cljs.core.PersistentQueue.EMPTY,elems);
+} else
+{return cljs.reader.reader_error.call(null,null,"Queue literal expects a vector for its elements.");
+}
+});
+cljs.reader.read_uuid = (function read_uuid(uuid){
+if(cljs.core.string_QMARK_.call(null,uuid))
+{return (new cljs.core.UUID(uuid));
+} else
+{return cljs.reader.reader_error.call(null,null,"UUID literal expects a string as its representation.");
+}
+});
+cljs.reader._STAR_tag_table_STAR_ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.fromArray(["inst",cljs.reader.read_date,"uuid",cljs.reader.read_uuid,"queue",cljs.reader.read_queue], true));
+cljs.reader._STAR_default_data_reader_fn_STAR_ = cljs.core.atom.call(null,null);
+cljs.reader.maybe_read_tagged_type = (function maybe_read_tagged_type(rdr,initch){
+var tag = cljs.reader.read_symbol.call(null,rdr,initch);
+var pfn = cljs.core.get.call(null,cljs.core.deref.call(null,cljs.reader._STAR_tag_table_STAR_),[cljs.core.str(tag)].join(''));
+var dfn = cljs.core.deref.call(null,cljs.reader._STAR_default_data_reader_fn_STAR_);
+if(cljs.core.truth_(pfn))
+{return pfn.call(null,cljs.reader.read.call(null,rdr,true,null,false));
+} else
+{if(cljs.core.truth_(dfn))
+{return dfn.call(null,tag,cljs.reader.read.call(null,rdr,true,null,false));
+} else
+{if("\uFDD0:else")
+{return cljs.reader.reader_error.call(null,rdr,"Could not find tag parser for ",[cljs.core.str(tag)].join('')," in ",cljs.core.pr_str.call(null,cljs.core.keys.call(null,cljs.core.deref.call(null,cljs.reader._STAR_tag_table_STAR_))));
+} else
+{return null;
+}
+}
+}
+});
+cljs.reader.register_tag_parser_BANG_ = (function register_tag_parser_BANG_(tag,f){
+var tag__$1 = [cljs.core.str(tag)].join('');
+var old_parser = cljs.core.get.call(null,cljs.core.deref.call(null,cljs.reader._STAR_tag_table_STAR_),tag__$1);
+cljs.core.swap_BANG_.call(null,cljs.reader._STAR_tag_table_STAR_,cljs.core.assoc,tag__$1,f);
+return old_parser;
+});
+cljs.reader.deregister_tag_parser_BANG_ = (function deregister_tag_parser_BANG_(tag){
+var tag__$1 = [cljs.core.str(tag)].join('');
+var old_parser = cljs.core.get.call(null,cljs.core.deref.call(null,cljs.reader._STAR_tag_table_STAR_),tag__$1);
+cljs.core.swap_BANG_.call(null,cljs.reader._STAR_tag_table_STAR_,cljs.core.dissoc,tag__$1);
+return old_parser;
+});
+cljs.reader.register_default_tag_parser_BANG_ = (function register_default_tag_parser_BANG_(f){
+var old_parser = cljs.core.deref.call(null,cljs.reader._STAR_default_data_reader_fn_STAR_);
+cljs.core.swap_BANG_.call(null,cljs.reader._STAR_default_data_reader_fn_STAR_,(function (_){
+return f;
+}));
+return old_parser;
+});
+cljs.reader.deregister_default_tag_parser_BANG_ = (function deregister_default_tag_parser_BANG_(){
+var old_parser = cljs.core.deref.call(null,cljs.reader._STAR_default_data_reader_fn_STAR_);
+cljs.core.swap_BANG_.call(null,cljs.reader._STAR_default_data_reader_fn_STAR_,(function (_){
+return null;
+}));
+return old_parser;
});
View
334 resources/public/clojure/set.js
@@ -1,10 +1,9 @@
goog.provide('clojure.set');
goog.require('cljs.core');
clojure.set.bubble_max_key = (function bubble_max_key(k,coll){
-var max__4917 = cljs.core.apply.call(null,cljs.core.max_key,k,coll);
-
-return cljs.core.cons.call(null,max__4917,cljs.core.remove.call(null,(function (p1__4916_SHARP_){
-return (max__4917 === p1__4916_SHARP_);
+var max = cljs.core.apply.call(null,cljs.core.max_key,k,coll);
+return cljs.core.cons.call(null,max,cljs.core.remove.call(null,(function (p1__4571_SHARP_){
+return (max === p1__4571_SHARP_);