added github pages support
This commit is contained in:
1 parent
b14ebdbf63
commit
6ed638a1cc
373 files changed
+185436
-2343
No files matched your search
@@ -0,0 +1,131 @@
|
||||
;; Copyright (c) Nicola Mometto, Rich Hickey & contributors.
|
||||
;; The use and distribution terms for this software are covered by the
|
||||
;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
|
||||
;; which can be found in the file epl-v10.html at the root of this distribution.
|
||||
;; By using this software in any fashion, you are agreeing to be bound by
|
||||
;; the terms of this license.
|
||||
;; You must not remove this notice, or any other, from this software.
|
||||
|
||||
(ns cljs.tools.reader.impl.commons
|
||||
(:refer-clojure :exclude [char])
|
||||
(:require
|
||||
[cljs.tools.reader.impl.errors :refer [reader-error]]
|
||||
[cljs.tools.reader.reader-types :refer [peek-char read-char]]
|
||||
[cljs.tools.reader.impl.utils :refer [numeric? newline? char]]))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; helpers
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defn ^boolean number-literal?
|
||||
"Checks whether the reader is at the start of a number literal"
|
||||
[^not-native reader initch]
|
||||
(or (numeric? initch)
|
||||
(and (or (identical? \+ initch) (identical? \- initch))
|
||||
(numeric? (peek-char reader)))))
|
||||
|
||||
(defn read-past
|
||||
"Read until first character that doesn't match pred, returning
|
||||
char."
|
||||
[pred ^not-native rdr]
|
||||
(loop [ch (read-char rdr)]
|
||||
(if ^boolean (pred ch)
|
||||
(recur (read-char rdr))
|
||||
ch)))
|
||||
|
||||
(defn skip-line
|
||||
"Advances the reader to the end of a line. Returns the reader"
|
||||
[^not-native reader]
|
||||
(loop []
|
||||
(when-not (newline? (read-char reader))
|
||||
(recur)))
|
||||
reader)
|
||||
|
||||
(def int-pattern #"^([-+]?)(?:(0)|([1-9][0-9]*)|0[xX]([0-9A-Fa-f]+)|0([0-7]+)|([1-9][0-9]?)[rR]([0-9A-Za-z]+)|0[0-9]+)(N)?$")
|
||||
(def ratio-pattern #"([-+]?[0-9]+)/([0-9]+)")
|
||||
(def float-pattern #"([-+]?[0-9]+(\.[0-9]*)?([eE][-+]?[0-9]+)?)(M)?")
|
||||
|
||||
(defn- match-int
|
||||
[s]
|
||||
(let [m (vec (re-find int-pattern s))]
|
||||
(if-not (nil? (m 2))
|
||||
0
|
||||
(let [^boolean negate? (identical? "-" (m 1))
|
||||
a (cond
|
||||
(not (nil? (m 3))) [(m 3) 10]
|
||||
(not (nil? (m 4))) [(m 4) 16]
|
||||
(not (nil? (m 5))) [(m 5) 8]
|
||||
(not (nil? (m 7))) [(m 7) (js/parseInt (m 6))]
|
||||
:else [nil nil])
|
||||
n (a 0)]
|
||||
(when-not (nil? n)
|
||||
(let [bn (js/parseInt n (a 1))
|
||||
bn (if negate? (* -1 bn) bn)]
|
||||
(when-not (js/isNaN bn)
|
||||
bn)))))))
|
||||
|
||||
(defn- match-ratio
|
||||
[s]
|
||||
(let [m (vec (re-find ratio-pattern s))
|
||||
numerator (m 1)
|
||||
denominator (m 2)
|
||||
numerator (if (re-find #"^\+" numerator)
|
||||
(subs numerator 1)
|
||||
numerator)]
|
||||
(/ (-> numerator js/parseInt) ;;; No ratio type in cljs
|
||||
(-> denominator js/parseInt)))); So will convert to js/Number
|
||||
|
||||
(defn- match-float
|
||||
[s]
|
||||
(let [m (vec (re-find float-pattern s))]
|
||||
(if-not (nil? (m 4)) ;; for BigDecimal "10.03M", as all parsed to js/Number
|
||||
(js/parseFloat (m 1))
|
||||
(js/parseFloat s))))
|
||||
|
||||
(defn ^boolean matches? [pattern s]
|
||||
(let [[match] (re-find pattern s)]
|
||||
(identical? match s)))
|
||||
|
||||
(defn match-number [s]
|
||||
(if (matches? int-pattern s)
|
||||
(match-int s)
|
||||
(if (matches? float-pattern s)
|
||||
(match-float s)
|
||||
(when (matches? ratio-pattern s)
|
||||
(match-ratio s)))))
|
||||
|
||||
(defn parse-symbol
|
||||
"Parses a string into a vector of the namespace and symbol"
|
||||
[token]
|
||||
(when-not (or (identical? "" token)
|
||||
(true? (.test #":$" token))
|
||||
(true? (.test #"^::" token)))
|
||||
(let [ns-idx (.indexOf token "/")
|
||||
ns (when (pos? ns-idx)
|
||||
(subs token 0 ns-idx))]
|
||||
(if-not (nil? ns)
|
||||
(let [ns-idx (inc ns-idx)]
|
||||
(when-not (== ns-idx (count token))
|
||||
(let [sym (subs token ns-idx)]
|
||||
(when (and (not (numeric? (nth sym 0)))
|
||||
(not (identical? "" sym))
|
||||
(false? (.test #":$" ns))
|
||||
(or (identical? sym "/")
|
||||
(== -1 (.indexOf sym "/"))))
|
||||
[ns sym]))))
|
||||
(when (or (identical? token "/")
|
||||
(== -1 (.indexOf token "/")))
|
||||
[nil token])))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; readers
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defn read-comment
|
||||
[rdr & _]
|
||||
(skip-line rdr))
|
||||
|
||||
(defn throwing-reader
|
||||
[msg]
|
||||
(fn [rdr & _]
|
||||
(reader-error rdr msg)))
|
||||
@@ -0,0 +1 @@
|
||||
{:rename-macros {}, :renames {}, :externs {parseInt {}, isNaN {}, parseFloat {}}, :use-macros {}, :excludes #{char}, :name cljs.tools.reader.impl.commons, :imports nil, :requires {cljs.tools.reader.impl.errors cljs.tools.reader.impl.errors, cljs.tools.reader.reader-types cljs.tools.reader.reader-types, cljs.tools.reader.impl.utils cljs.tools.reader.impl.utils}, :cljs.spec/speced-vars [], :uses {char cljs.tools.reader.impl.utils, numeric? cljs.tools.reader.impl.utils, reader-error cljs.tools.reader.impl.errors, peek-char cljs.tools.reader.reader-types, read-char cljs.tools.reader.reader-types, newline? cljs.tools.reader.impl.utils}, :defs {match-number {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/tools/reader/impl/commons.cljs", :line 89, :column 7, :end-line 89, :end-column 19, :arglists (quote ([s]))}, :name cljs.tools.reader.impl.commons/match-number, :variadic false, :file "target/cljsbuild/public/js/out/cljs/tools/reader/impl/commons.cljs", :end-column 19, :method-params ([s]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 89, :end-line 89, :max-fixed-arity 1, :fn-var true, :arglists (quote ([s]))}, skip-line {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/tools/reader/impl/commons.cljs", :line 36, :column 7, :end-line 36, :end-column 16, :arglists (quote ([reader])), :doc "Advances the reader to the end of a line. Returns the reader"}, :name cljs.tools.reader.impl.commons/skip-line, :variadic false, :file "target/cljsbuild/public/js/out/cljs/tools/reader/impl/commons.cljs", :end-column 16, :method-params ([reader]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 36, :end-line 36, :max-fixed-arity 1, :fn-var true, :arglists (quote ([reader])), :doc "Advances the reader to the end of a line. Returns the reader"}, int-pattern {:name cljs.tools.reader.impl.commons/int-pattern, :file "target/cljsbuild/public/js/out/cljs/tools/reader/impl/commons.cljs", :line 44, :column 1, :end-line 44, :end-column 17, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/tools/reader/impl/commons.cljs", :line 44, :column 6, :end-line 44, :end-column 17}, :tag any}, read-comment {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/tools/reader/impl/commons.cljs", :line 124, :column 7, :end-line 124, :end-column 19, :arglists (quote ([rdr & _])), :top-fn {:variadic true, :max-fixed-arity 1, :method-params [(rdr _)], :arglists ([rdr & _]), :arglists-meta (nil)}}, :name cljs.tools.reader.impl.commons/read-comment, :variadic true, :file "target/cljsbuild/public/js/out/cljs/tools/reader/impl/commons.cljs", :end-column 19, :top-fn {:variadic true, :max-fixed-arity 1, :method-params [(rdr _)], :arglists ([rdr & _]), :arglists-meta (nil)}, :method-params [(rdr _)], :protocol-impl nil, :arglists-meta (nil), :column 1, :line 124, :end-line 124, :max-fixed-arity 1, :fn-var true, :arglists ([rdr & _])}, match-ratio {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/tools/reader/impl/commons.cljs", :line 67, :column 8, :end-line 67, :end-column 19, :private true, :arglists (quote ([s]))}, :private true, :name cljs.tools.reader.impl.commons/match-ratio, :variadic false, :file "target/cljsbuild/public/js/out/cljs/tools/reader/impl/commons.cljs", :end-column 19, :method-params ([s]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 67, :end-line 67, :max-fixed-arity 1, :fn-var true, :arglists (quote ([s]))}, match-int {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/tools/reader/impl/commons.cljs", :line 48, :column 8, :end-line 48, :end-column 17, :private true, :arglists (quote ([s]))}, :private true, :name cljs.tools.reader.impl.commons/match-int, :variadic false, :file "target/cljsbuild/public/js/out/cljs/tools/reader/impl/commons.cljs", :end-column 17, :method-params ([s]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 48, :end-line 48, :max-fixed-arity 1, :fn-var true, :arglists (quote ([s]))}, parse-symbol {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/tools/reader/impl/commons.cljs", :line 97, :column 7, :end-line 97, :end-column 19, :arglists (quote ([token])), :doc "Parses a string into a vector of the namespace and symbol"}, :name cljs.tools.reader.impl.commons/parse-symbol, :variadic false, :file "target/cljsbuild/public/js/out/cljs/tools/reader/impl/commons.cljs", :end-column 19, :method-params ([token]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 97, :end-line 97, :max-fixed-arity 1, :fn-var true, :arglists (quote ([token])), :doc "Parses a string into a vector of the namespace and symbol"}, number-literal? {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/clLine truncated
|
||||
@@ -0,0 +1,191 @@
|
||||
// Compiled by ClojureScript 1.9.946 {}
|
||||
goog.provide('cljs.tools.reader.impl.commons');
|
||||
goog.require('cljs.core');
|
||||
goog.require('cljs.tools.reader.impl.errors');
|
||||
goog.require('cljs.tools.reader.reader_types');
|
||||
goog.require('cljs.tools.reader.impl.utils');
|
||||
/**
|
||||
* Checks whether the reader is at the start of a number literal
|
||||
*/
|
||||
cljs.tools.reader.impl.commons.number_literal_QMARK_ = (function cljs$tools$reader$impl$commons$number_literal_QMARK_(reader,initch){
|
||||
return (cljs.tools.reader.impl.utils.numeric_QMARK_.call(null,initch)) || (((("+" === initch)) || (("-" === initch))) && (cljs.tools.reader.impl.utils.numeric_QMARK_.call(null,cljs.tools.reader.reader_types.peek_char.call(null,reader))));
|
||||
});
|
||||
/**
|
||||
* Read until first character that doesn't match pred, returning
|
||||
* char.
|
||||
*/
|
||||
cljs.tools.reader.impl.commons.read_past = (function cljs$tools$reader$impl$commons$read_past(pred,rdr){
|
||||
var ch = cljs.tools.reader.reader_types.read_char.call(null,rdr);
|
||||
while(true){
|
||||
if(pred.call(null,ch)){
|
||||
var G__44276 = cljs.tools.reader.reader_types.read_char.call(null,rdr);
|
||||
ch = G__44276;
|
||||
continue;
|
||||
} else {
|
||||
return ch;
|
||||
}
|
||||
break;
|
||||
}
|
||||
});
|
||||
/**
|
||||
* Advances the reader to the end of a line. Returns the reader
|
||||
*/
|
||||
cljs.tools.reader.impl.commons.skip_line = (function cljs$tools$reader$impl$commons$skip_line(reader){
|
||||
while(true){
|
||||
if(cljs.tools.reader.impl.utils.newline_QMARK_.call(null,cljs.tools.reader.reader_types.read_char.call(null,reader))){
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return reader;
|
||||
});
|
||||
cljs.tools.reader.impl.commons.int_pattern = /^([-+]?)(?:(0)|([1-9][0-9]*)|0[xX]([0-9A-Fa-f]+)|0([0-7]+)|([1-9][0-9]?)[rR]([0-9A-Za-z]+)|0[0-9]+)(N)?$/;
|
||||
cljs.tools.reader.impl.commons.ratio_pattern = /([-+]?[0-9]+)\/([0-9]+)/;
|
||||
cljs.tools.reader.impl.commons.float_pattern = /([-+]?[0-9]+(\.[0-9]*)?([eE][-+]?[0-9]+)?)(M)?/;
|
||||
cljs.tools.reader.impl.commons.match_int = (function cljs$tools$reader$impl$commons$match_int(s){
|
||||
var m = cljs.core.vec.call(null,cljs.core.re_find.call(null,cljs.tools.reader.impl.commons.int_pattern,s));
|
||||
if(!((m.call(null,(2)) == null))){
|
||||
return (0);
|
||||
} else {
|
||||
var negate_QMARK_ = ("-" === m.call(null,(1)));
|
||||
var a = ((!((m.call(null,(3)) == null)))?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [m.call(null,(3)),(10)], null):((!((m.call(null,(4)) == null)))?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [m.call(null,(4)),(16)], null):((!((m.call(null,(5)) == null)))?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [m.call(null,(5)),(8)], null):((!((m.call(null,(7)) == null)))?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [m.call(null,(7)),parseInt(m.call(null,(6)))], null):new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [null,null], null)
|
||||
))));
|
||||
var n = a.call(null,(0));
|
||||
if((n == null)){
|
||||
return null;
|
||||
} else {
|
||||
var bn = parseInt(n,a.call(null,(1)));
|
||||
var bn__$1 = ((negate_QMARK_)?((-1) * bn):bn);
|
||||
if(cljs.core.truth_(isNaN(bn__$1))){
|
||||
return null;
|
||||
} else {
|
||||
return bn__$1;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
cljs.tools.reader.impl.commons.match_ratio = (function cljs$tools$reader$impl$commons$match_ratio(s){
|
||||
var m = cljs.core.vec.call(null,cljs.core.re_find.call(null,cljs.tools.reader.impl.commons.ratio_pattern,s));
|
||||
var numerator = m.call(null,(1));
|
||||
var denominator = m.call(null,(2));
|
||||
var numerator__$1 = (cljs.core.truth_(cljs.core.re_find.call(null,/^\+/,numerator))?cljs.core.subs.call(null,numerator,(1)):numerator);
|
||||
return (parseInt(numerator__$1) / parseInt(denominator));
|
||||
});
|
||||
cljs.tools.reader.impl.commons.match_float = (function cljs$tools$reader$impl$commons$match_float(s){
|
||||
var m = cljs.core.vec.call(null,cljs.core.re_find.call(null,cljs.tools.reader.impl.commons.float_pattern,s));
|
||||
if(!((m.call(null,(4)) == null))){
|
||||
return parseFloat(m.call(null,(1)));
|
||||
} else {
|
||||
return parseFloat(s);
|
||||
}
|
||||
});
|
||||
cljs.tools.reader.impl.commons.matches_QMARK_ = (function cljs$tools$reader$impl$commons$matches_QMARK_(pattern,s){
|
||||
var vec__44277 = cljs.core.re_find.call(null,pattern,s);
|
||||
var match = cljs.core.nth.call(null,vec__44277,(0),null);
|
||||
return (match === s);
|
||||
});
|
||||
cljs.tools.reader.impl.commons.match_number = (function cljs$tools$reader$impl$commons$match_number(s){
|
||||
if(cljs.tools.reader.impl.commons.matches_QMARK_.call(null,cljs.tools.reader.impl.commons.int_pattern,s)){
|
||||
return cljs.tools.reader.impl.commons.match_int.call(null,s);
|
||||
} else {
|
||||
if(cljs.tools.reader.impl.commons.matches_QMARK_.call(null,cljs.tools.reader.impl.commons.float_pattern,s)){
|
||||
return cljs.tools.reader.impl.commons.match_float.call(null,s);
|
||||
} else {
|
||||
if(cljs.tools.reader.impl.commons.matches_QMARK_.call(null,cljs.tools.reader.impl.commons.ratio_pattern,s)){
|
||||
return cljs.tools.reader.impl.commons.match_ratio.call(null,s);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
/**
|
||||
* Parses a string into a vector of the namespace and symbol
|
||||
*/
|
||||
cljs.tools.reader.impl.commons.parse_symbol = (function cljs$tools$reader$impl$commons$parse_symbol(token){
|
||||
if((("" === token)) || (/:$/.test(token) === true) || (/^::/.test(token) === true)){
|
||||
return null;
|
||||
} else {
|
||||
var ns_idx = token.indexOf("/");
|
||||
var ns = (((ns_idx > (0)))?cljs.core.subs.call(null,token,(0),ns_idx):null);
|
||||
if(!((ns == null))){
|
||||
var ns_idx__$1 = (ns_idx + (1));
|
||||
if((ns_idx__$1 === cljs.core.count.call(null,token))){
|
||||
return null;
|
||||
} else {
|
||||
var sym = cljs.core.subs.call(null,token,ns_idx__$1);
|
||||
if((!(cljs.tools.reader.impl.utils.numeric_QMARK_.call(null,cljs.core.nth.call(null,sym,(0))))) && (!(("" === sym))) && (/:$/.test(ns) === false) && (((sym === "/")) || (((-1) === sym.indexOf("/"))))){
|
||||
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [ns,sym], null);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(((token === "/")) || (((-1) === token.indexOf("/")))){
|
||||
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [null,token], null);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
cljs.tools.reader.impl.commons.read_comment = (function cljs$tools$reader$impl$commons$read_comment(var_args){
|
||||
var args__36784__auto__ = [];
|
||||
var len__36777__auto___44282 = arguments.length;
|
||||
var i__36778__auto___44283 = (0);
|
||||
while(true){
|
||||
if((i__36778__auto___44283 < len__36777__auto___44282)){
|
||||
args__36784__auto__.push((arguments[i__36778__auto___44283]));
|
||||
|
||||
var G__44284 = (i__36778__auto___44283 + (1));
|
||||
i__36778__auto___44283 = G__44284;
|
||||
continue;
|
||||
} else {
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
var argseq__36785__auto__ = ((((1) < args__36784__auto__.length))?(new cljs.core.IndexedSeq(args__36784__auto__.slice((1)),(0),null)):null);
|
||||
return cljs.tools.reader.impl.commons.read_comment.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__36785__auto__);
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.commons.read_comment.cljs$core$IFn$_invoke$arity$variadic = (function (rdr,_){
|
||||
return cljs.tools.reader.impl.commons.skip_line.call(null,rdr);
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.commons.read_comment.cljs$lang$maxFixedArity = (1);
|
||||
|
||||
cljs.tools.reader.impl.commons.read_comment.cljs$lang$applyTo = (function (seq44280){
|
||||
var G__44281 = cljs.core.first.call(null,seq44280);
|
||||
var seq44280__$1 = cljs.core.next.call(null,seq44280);
|
||||
return cljs.tools.reader.impl.commons.read_comment.cljs$core$IFn$_invoke$arity$variadic(G__44281,seq44280__$1);
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.commons.throwing_reader = (function cljs$tools$reader$impl$commons$throwing_reader(msg){
|
||||
return (function() {
|
||||
var G__44285__delegate = function (rdr,_){
|
||||
return cljs.tools.reader.impl.errors.reader_error.call(null,rdr,msg);
|
||||
};
|
||||
var G__44285 = function (rdr,var_args){
|
||||
var _ = null;
|
||||
if (arguments.length > 1) {
|
||||
var G__44286__i = 0, G__44286__a = new Array(arguments.length - 1);
|
||||
while (G__44286__i < G__44286__a.length) {G__44286__a[G__44286__i] = arguments[G__44286__i + 1]; ++G__44286__i;}
|
||||
_ = new cljs.core.IndexedSeq(G__44286__a,0,null);
|
||||
}
|
||||
return G__44285__delegate.call(this,rdr,_);};
|
||||
G__44285.cljs$lang$maxFixedArity = 1;
|
||||
G__44285.cljs$lang$applyTo = (function (arglist__44287){
|
||||
var rdr = cljs.core.first(arglist__44287);
|
||||
var _ = cljs.core.rest(arglist__44287);
|
||||
return G__44285__delegate(rdr,_);
|
||||
});
|
||||
G__44285.cljs$core$IFn$_invoke$arity$variadic = G__44285__delegate;
|
||||
return G__44285;
|
||||
})()
|
||||
;
|
||||
});
|
||||
|
||||
//# sourceMappingURL=commons.js.map?rel=1517021946510
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"\/home\/didier\/clojupyter\/website\/target\/cljsbuild\/public\/js\/out\/cljs\/tools\/reader\/impl\/commons.js","sources":["commons.cljs?rel=1517021946511"],"lineCount":191,"mappings":";AAQA;;;;;AAWA;;;uDAAA,vDAAeA,sHAEAC,OAAOC;AAFtB,AAGE,QAAI,AAACC,sDAASD,aACV,CAAK,CAAI,CAAA,QAAeA,aAAQ,CAAA,QAAgBA,cAC3C,AAACC,sDAAS,AAACC,mDAAUH;;AAEhC;;;;2CAAA,3CAAMI,8FAGHC,KAAiBC;AAHpB,AAIE,IAAOC,KAAG,AAACC,mDAAUF;;AAArB,AACE,GAAI,AAAUD,eAAKE;AACjB,eAAO,AAACC,mDAAUF;;;;AAClBC;;;;;AAEN;;;2CAAA,3CAAME,8FAEST;AAFf,AAGE;AAAA,AACE,GAAU,AAACU,sDAAS,AAACF,mDAAUR;AAA\/B;AAAA,AACE;;;;;AACJA;;AAEF,6CAAA,7CAAKW;AACL,+CAAA,\/CAAKC;AACL,+CAAA,\/CAAKC;AAEL,2CAAA,3CAAOC,8FACJC;AADH,AAEE,IAAMC,IAAE,AAACC,wBAAI,AAACC,4BAAQP,2CAAYI;AAAlC,AACE,GAAA,EAAQ,qBAAA,pBAAM,YAAA,ZAACC;AAAf;;AAEE,IAAeG,gBAAQ,CAAA,QAAgB,YAAA,ZAACH;IAClCI,IAAE,iCAAA,oGAAA,aAAA,iCAAA,oGAAA,aAAA,iCAAA,oGAAA,YAAA,iCAAA,uIAAA,AAAA,mFAAA,KAAA,nrBACC,EAAK,qBAAA,pBAAM,YAAA,ZAACJ,+GAAQ,YAAA,ZAACA,gCACrB,EAAK,qBAAA,pBAAM,YAAA,ZAACA,+GAAQ,YAAA,ZAACA,gCACrB,EAAK,qBAAA,pBAAM,YAAA,ZAACA,+GAAQ,YAAA,ZAACA,+BACrB,EAAK,qBAAA,pBA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,WAAA,AAAAC,0BAAAF;IAAAA,eAAA,AAAAG,yBAAAH;AAAA,AAAA,OAAAD,iFAAAE,SAAAD;;;AAAA,AAIA,iDAAA,jDAAMK,0GACHC;AADH,AAEE;mCAAKlD,IAAMgD;AAAX,AACE,OAACG,qDAAanD,IAAIkD;;yBADflD;IAAMgD;;;;EAAAA;;oCAANhD,IAAMgD;;;IAANhD;IAAMgD;0BAANhD,IAAMgD","names":["cljs.tools.reader.impl.commons\/number-literal?","reader","initch","cljs.tools.reader.impl.utils\/numeric?","cljs.tools.reader.reader-types\/peek-char","cljs.tools.reader.impl.commons\/read-past","pred","rdr","ch","cljs.tools.reader.reader-types\/read-char","cljs.tools.reader.impl.commons\/skip-line","cljs.tools.reader.impl.utils\/newline?","cljs.tools.reader.impl.commons\/int-pattern","cljs.tools.reader.impl.commons\/ratio-pattern","cljs.tools.reader.impl.commons\/float-pattern","cljs.tools.reader.impl.commons\/match-int","s","m","cljs.core\/vec","cljs.core\/re-find","negate?","a","js\/parseInt","n","bn","js\/isNaN","cljs.tools.reader.impl.commons\/match-ratio","numerator","denominator","cljs.core\/subs","cljs.tools.reader.impl.commons\/match-float","js\/parseFloat","cljs.tools.reader.impl.commons\/matches?","pattern","vec__44277","cljs.core\/nth","match","cljs.tools.reader.impl.commons\/match-number","cljs.tools.reader.impl.commons\/parse-symbol","token","ns-idx","ns","cljs.core\/count","sym","var_args","args__36784__auto__","len__36777__auto__","i__36778__auto__","argseq__36785__auto__","cljs.core\/IndexedSeq","cljs.tools.reader.impl.commons\/read-comment","seq44280","G__44281","cljs.core\/first","cljs.core\/next","_","cljs.tools.reader.impl.commons\/throwing-reader","msg","cljs.tools.reader.impl.errors\/reader-error"]}
|
||||
@@ -0,0 +1,253 @@
|
||||
;; Copyright (c) Russ Olsen, Nicola Mometto, Rich Hickey & contributors.
|
||||
;; The use and distribution terms for this software are covered by the
|
||||
;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
|
||||
;; which can be found in the file epl-v10.html at the root of this distribution.
|
||||
;; By using this software in any fashion, you are agreeing to be bound by
|
||||
;; the terms of this license.
|
||||
;; You must not remove this notice, or any other, from this software.
|
||||
|
||||
(ns cljs.tools.reader.impl.errors
|
||||
(:require [cljs.tools.reader.reader-types :as types]
|
||||
[clojure.string :as s]
|
||||
[cljs.tools.reader.impl.inspect :as i]))
|
||||
|
||||
(defn- ex-details
|
||||
[rdr ex-type]
|
||||
(let [details {:type :reader-exception
|
||||
:ex-kind ex-type}]
|
||||
(if (types/indexing-reader? rdr)
|
||||
(assoc
|
||||
details
|
||||
:file (types/get-file-name rdr)
|
||||
:line (types/get-line-number rdr)
|
||||
:col (types/get-column-number rdr))
|
||||
details)))
|
||||
|
||||
(defn- throw-ex
|
||||
"Throw an ex-info error."
|
||||
[rdr ex-type & msg]
|
||||
(let [details (ex-details rdr ex-type)
|
||||
file (:file details)
|
||||
line (:line details)
|
||||
col (:col details)
|
||||
msg1 (if file (str file " "))
|
||||
msg2 (if line (str "[line " line ", col " col "]"))
|
||||
msg3 (if (or msg1 msg2) " ")
|
||||
full-msg (apply str msg1 msg2 msg3 msg)]
|
||||
(throw (ex-info full-msg details))))
|
||||
|
||||
(defn reader-error
|
||||
"Throws an ExceptionInfo with the given message.
|
||||
If rdr is an IndexingReader, additional information about column and line number is provided"
|
||||
[rdr & msgs]
|
||||
(throw-ex rdr :reader-error (apply str msgs)))
|
||||
|
||||
(defn illegal-arg-error
|
||||
"Throws an ExceptionInfo with the given message.
|
||||
If rdr is an IndexingReader, additional information about column and line number is provided"
|
||||
[rdr & msgs]
|
||||
(throw-ex rdr :illegal-argument (apply str msgs)))
|
||||
|
||||
(defn eof-error
|
||||
"Throws an ExceptionInfo with the given message.
|
||||
If rdr is an IndexingReader, additional information about column and line number is provided"
|
||||
[rdr & msgs]
|
||||
(throw-ex rdr :eof (apply str msgs)))
|
||||
|
||||
(defn throw-eof-delimited
|
||||
([rdr kind column line] (throw-eof-delimited rdr kind line column nil))
|
||||
([rdr kind line column n]
|
||||
(eof-error
|
||||
rdr
|
||||
"Unexpected EOF while reading "
|
||||
(if n
|
||||
(str "item " n " of "))
|
||||
(name kind)
|
||||
(if line
|
||||
(str ", starting at line " line " and column " column))
|
||||
".")))
|
||||
|
||||
(defn throw-odd-map [rdr line col elements]
|
||||
(reader-error
|
||||
rdr
|
||||
"The map literal starting with "
|
||||
(i/inspect (first elements))
|
||||
(if line (str " on line " line " column " col))
|
||||
" contains "
|
||||
(count elements)
|
||||
" form(s). Map literals must contain an even number of forms."))
|
||||
|
||||
(defn throw-invalid-number [rdr token]
|
||||
(reader-error
|
||||
rdr
|
||||
"Invalid number: "
|
||||
token
|
||||
"."))
|
||||
|
||||
(defn throw-invalid-unicode-literal [rdr token]
|
||||
(throw
|
||||
(illegal-arg-error
|
||||
rdr
|
||||
"Invalid unicode literal: \\"
|
||||
token
|
||||
".")))
|
||||
|
||||
(defn throw-invalid-unicode-escape [rdr ch]
|
||||
(reader-error
|
||||
rdr
|
||||
"Invalid unicode escape: \\u"
|
||||
ch
|
||||
"."))
|
||||
|
||||
(defn throw-invalid [rdr kind token]
|
||||
(reader-error rdr "Invalid " (name kind) ": " token "."))
|
||||
|
||||
(defn throw-eof-at-start [rdr kind]
|
||||
(eof-error rdr "Unexpected EOF while reading start of " (name kind) "."))
|
||||
|
||||
(defn throw-bad-char [rdr kind ch]
|
||||
(reader-error rdr "Invalid character: " ch " found while reading " (name kind) "."))
|
||||
|
||||
(defn throw-eof-at-dispatch [rdr]
|
||||
(eof-error rdr "Unexpected EOF while reading dispatch character."))
|
||||
|
||||
(defn throw-bad-dispatch [rdr ch]
|
||||
(reader-error rdr "No dispatch macro for " ch "."))
|
||||
|
||||
(defn throw-unmatch-delimiter [rdr ch]
|
||||
(reader-error rdr "Unmatched delimiter " ch "."))
|
||||
|
||||
(defn throw-eof-reading [rdr kind & start]
|
||||
(let [init (case kind :regex "#\"" :string \")]
|
||||
(eof-error rdr "Unexpected EOF reading " (name kind) " starting " (apply str init start) ".")))
|
||||
|
||||
(defn throw-no-dispatch [rdr ch]
|
||||
(throw-bad-dispatch rdr ch))
|
||||
|
||||
(defn throw-invalid-unicode-char[rdr token]
|
||||
(reader-error
|
||||
rdr
|
||||
"Invalid unicode character \\"
|
||||
token
|
||||
"."))
|
||||
|
||||
(defn throw-invalid-unicode-digit-in-token[rdr ch token]
|
||||
(illegal-arg-error
|
||||
rdr
|
||||
"Invalid digit "
|
||||
ch
|
||||
" in unicode character \\"
|
||||
token
|
||||
"."))
|
||||
|
||||
(defn throw-invalid-unicode-digit[rdr ch]
|
||||
(illegal-arg-error
|
||||
rdr
|
||||
"Invalid digit "
|
||||
ch
|
||||
" in unicode character."))
|
||||
|
||||
(defn throw-invalid-unicode-len[rdr actual expected]
|
||||
(illegal-arg-error
|
||||
rdr
|
||||
"Invalid unicode literal. Unicode literals should be "
|
||||
expected
|
||||
"characters long. "
|
||||
"value suppled is "
|
||||
actual
|
||||
"characters long."))
|
||||
|
||||
(defn throw-invalid-character-literal[rdr token]
|
||||
(reader-error rdr "Invalid character literal \\u" token "."))
|
||||
|
||||
(defn throw-invalid-octal-len[rdr token]
|
||||
(reader-error
|
||||
rdr
|
||||
"Invalid octal escape sequence in a character literal:"
|
||||
token
|
||||
". Octal escape sequences must be 3 or fewer digits."))
|
||||
|
||||
(defn throw-bad-octal-number [rdr]
|
||||
(reader-error rdr "Octal escape sequence must be in range [0, 377]."))
|
||||
|
||||
(defn throw-unsupported-character[rdr token]
|
||||
(reader-error
|
||||
rdr
|
||||
"Unsupported character: "
|
||||
token
|
||||
"."))
|
||||
|
||||
(defn throw-eof-in-character [rdr]
|
||||
(eof-error
|
||||
rdr
|
||||
"Unexpected EOF while reading character."))
|
||||
|
||||
(defn throw-bad-escape-char [rdr ch]
|
||||
(reader-error rdr "Unsupported escape character: \\" ch "."))
|
||||
|
||||
(defn throw-single-colon [rdr]
|
||||
(reader-error rdr "A single colon is not a valid keyword."))
|
||||
|
||||
(defn throw-bad-metadata [rdr x]
|
||||
(reader-error
|
||||
rdr
|
||||
"Metadata cannot be "
|
||||
(i/inspect x)
|
||||
". Metadata must be a Symbol, Keyword, String or Map."))
|
||||
|
||||
(defn throw-bad-metadata-target [rdr target]
|
||||
(reader-error
|
||||
rdr
|
||||
"Metadata can not be applied to "
|
||||
(i/inspect target)
|
||||
". "
|
||||
"Metadata can only be applied to IMetas."))
|
||||
|
||||
(defn throw-feature-not-keyword [rdr feature]
|
||||
(reader-error
|
||||
rdr
|
||||
"Feature cannot be "
|
||||
(i/inspect feature)
|
||||
" Features must be keywords."))
|
||||
|
||||
(defn throw-ns-map-no-map [rdr ns-name]
|
||||
(reader-error rdr "Namespaced map with namespace " ns-name " does not specify a map."))
|
||||
|
||||
(defn throw-bad-ns [rdr ns-name]
|
||||
(reader-error rdr "Invalid value used as namespace in namespaced map: " ns-name "."))
|
||||
|
||||
(defn throw-bad-reader-tag [rdr tag]
|
||||
(reader-error
|
||||
rdr
|
||||
"Invalid reader tag: "
|
||||
(i/inspect tag)
|
||||
". Reader tags must be symbols."))
|
||||
|
||||
(defn throw-unknown-reader-tag [rdr tag]
|
||||
(reader-error
|
||||
rdr
|
||||
"No reader function for tag "
|
||||
(i/inspect tag)
|
||||
"."))
|
||||
|
||||
(defn- duplicate-keys-error [msg coll]
|
||||
(letfn [(duplicates [seq]
|
||||
(for [[id freq] (frequencies seq)
|
||||
:when (> freq 1)]
|
||||
id))]
|
||||
(let [dups (duplicates coll)]
|
||||
(apply str msg
|
||||
(when (> (count dups) 1) "s")
|
||||
": " (interpose ", " dups)))))
|
||||
|
||||
(defn throw-dup-keys [rdr kind ks]
|
||||
(reader-error
|
||||
rdr
|
||||
(duplicate-keys-error
|
||||
(str (s/capitalize (name kind)) " literal contains duplicate key")
|
||||
ks)))
|
||||
|
||||
(defn throw-eof-error [rdr line]
|
||||
(if line
|
||||
(eof-error rdr "EOF while reading, starting at line " line ".")
|
||||
(eof-error rdr "EOF while reading.")))
|
||||
@@ -0,0 +1 @@
|
||||
{:rename-macros {}, :renames {}, :externs {Error {}}, :use-macros {}, :excludes #{}, :name cljs.tools.reader.impl.errors, :imports nil, :requires {types cljs.tools.reader.reader-types, cljs.tools.reader.reader-types cljs.tools.reader.reader-types, s clojure.string, clojure.string clojure.string, i cljs.tools.reader.impl.inspect, cljs.tools.reader.impl.inspect cljs.tools.reader.impl.inspect}, :cljs.spec/speced-vars [], :uses nil, :defs {throw-bad-dispatch {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/tools/reader/impl/errors.cljs", :line 114, :column 7, :end-line 114, :end-column 25, :arglists (quote ([rdr ch]))}, :name cljs.tools.reader.impl.errors/throw-bad-dispatch, :variadic false, :file "target/cljsbuild/public/js/out/cljs/tools/reader/impl/errors.cljs", :end-column 25, :method-params ([rdr ch]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 114, :end-line 114, :max-fixed-arity 2, :fn-var true, :arglists (quote ([rdr ch]))}, throw-invalid-unicode-escape {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/tools/reader/impl/errors.cljs", :line 95, :column 7, :end-line 95, :end-column 35, :arglists (quote ([rdr ch]))}, :name cljs.tools.reader.impl.errors/throw-invalid-unicode-escape, :variadic false, :file "target/cljsbuild/public/js/out/cljs/tools/reader/impl/errors.cljs", :end-column 35, :method-params ([rdr ch]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 95, :end-line 95, :max-fixed-arity 2, :fn-var true, :arglists (quote ([rdr ch]))}, throw-dup-keys {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/tools/reader/impl/errors.cljs", :line 243, :column 7, :end-line 243, :end-column 21, :arglists (quote ([rdr kind ks]))}, :name cljs.tools.reader.impl.errors/throw-dup-keys, :variadic false, :file "target/cljsbuild/public/js/out/cljs/tools/reader/impl/errors.cljs", :end-column 21, :method-params ([rdr kind ks]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 243, :end-line 243, :max-fixed-arity 3, :fn-var true, :arglists (quote ([rdr kind ks]))}, throw-bad-ns {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/tools/reader/impl/errors.cljs", :line 216, :column 7, :end-line 216, :end-column 19, :arglists (quote ([rdr ns-name]))}, :name cljs.tools.reader.impl.errors/throw-bad-ns, :variadic false, :file "target/cljsbuild/public/js/out/cljs/tools/reader/impl/errors.cljs", :end-column 19, :method-params ([rdr ns-name]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 216, :end-line 216, :max-fixed-arity 2, :fn-var true, :arglists (quote ([rdr ns-name]))}, duplicate-keys-error {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/tools/reader/impl/errors.cljs", :line 233, :column 8, :end-line 233, :end-column 28, :private true, :arglists (quote ([msg coll]))}, :private true, :name cljs.tools.reader.impl.errors/duplicate-keys-error, :variadic false, :file "target/cljsbuild/public/js/out/cljs/tools/reader/impl/errors.cljs", :end-column 28, :method-params ([msg coll]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 233, :end-line 233, :max-fixed-arity 2, :fn-var true, :arglists (quote ([msg coll]))}, throw-unknown-reader-tag {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/tools/reader/impl/errors.cljs", :line 226, :column 7, :end-line 226, :end-column 31, :arglists (quote ([rdr tag]))}, :name cljs.tools.reader.impl.errors/throw-unknown-reader-tag, :variadic false, :file "target/cljsbuild/public/js/out/cljs/tools/reader/impl/errors.cljs", :end-column 31, :method-params ([rdr tag]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 226, :end-line 226, :max-fixed-arity 2, :fn-var true, :arglists (quote ([rdr tag]))}, throw-eof-at-dispatch {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/tools/reader/impl/errors.cljs", :line 111, :column 7, :end-line 111, :end-column 28, :arglists (quote ([rdr]))}, :name cljs.tools.reader.impl.errors/throw-eof-at-dispatch, :variadic false, :file "target/cljsbuild/public/js/out/cljs/tools/reader/impl/errors.cljs", :end-column 28, :method-params ([rdr]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 111, :end-line 111, :max-fixed-arity 1, :fn-var true, :arglists (quote ([rdr]))}, throw-bad-metadata-target {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/tools/reader/impl/errors.cljs", :line 198, :column 7, :end-line 198, :end-column 32, :arglists (quote ([rdr target]))}, :name cljs.tools.reader.impl.errors/throw-bad-metadata-target, :variadic false, :file "target/cljsbuild/public/js/out/cljs/tools/reader/impl/errors.cljs", :end-column 32, :methoLine truncated
|
||||
@@ -0,0 +1,413 @@
|
||||
// Compiled by ClojureScript 1.9.946 {}
|
||||
goog.provide('cljs.tools.reader.impl.errors');
|
||||
goog.require('cljs.core');
|
||||
goog.require('cljs.tools.reader.reader_types');
|
||||
goog.require('clojure.string');
|
||||
goog.require('cljs.tools.reader.impl.inspect');
|
||||
cljs.tools.reader.impl.errors.ex_details = (function cljs$tools$reader$impl$errors$ex_details(rdr,ex_type){
|
||||
var details = new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"reader-exception","reader-exception",-1938323098),new cljs.core.Keyword(null,"ex-kind","ex-kind",1581199296),ex_type], null);
|
||||
if(cljs.core.truth_(cljs.tools.reader.reader_types.indexing_reader_QMARK_.call(null,rdr))){
|
||||
return cljs.core.assoc.call(null,details,new cljs.core.Keyword(null,"file","file",-1269645878),cljs.tools.reader.reader_types.get_file_name.call(null,rdr),new cljs.core.Keyword(null,"line","line",212345235),cljs.tools.reader.reader_types.get_line_number.call(null,rdr),new cljs.core.Keyword(null,"col","col",-1959363084),cljs.tools.reader.reader_types.get_column_number.call(null,rdr));
|
||||
} else {
|
||||
return details;
|
||||
}
|
||||
});
|
||||
/**
|
||||
* Throw an ex-info error.
|
||||
*/
|
||||
cljs.tools.reader.impl.errors.throw_ex = (function cljs$tools$reader$impl$errors$throw_ex(var_args){
|
||||
var args__36784__auto__ = [];
|
||||
var len__36777__auto___44222 = arguments.length;
|
||||
var i__36778__auto___44223 = (0);
|
||||
while(true){
|
||||
if((i__36778__auto___44223 < len__36777__auto___44222)){
|
||||
args__36784__auto__.push((arguments[i__36778__auto___44223]));
|
||||
|
||||
var G__44224 = (i__36778__auto___44223 + (1));
|
||||
i__36778__auto___44223 = G__44224;
|
||||
continue;
|
||||
} else {
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
var argseq__36785__auto__ = ((((2) < args__36784__auto__.length))?(new cljs.core.IndexedSeq(args__36784__auto__.slice((2)),(0),null)):null);
|
||||
return cljs.tools.reader.impl.errors.throw_ex.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),argseq__36785__auto__);
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.errors.throw_ex.cljs$core$IFn$_invoke$arity$variadic = (function (rdr,ex_type,msg){
|
||||
var details = cljs.tools.reader.impl.errors.ex_details.call(null,rdr,ex_type);
|
||||
var file = new cljs.core.Keyword(null,"file","file",-1269645878).cljs$core$IFn$_invoke$arity$1(details);
|
||||
var line = new cljs.core.Keyword(null,"line","line",212345235).cljs$core$IFn$_invoke$arity$1(details);
|
||||
var col = new cljs.core.Keyword(null,"col","col",-1959363084).cljs$core$IFn$_invoke$arity$1(details);
|
||||
var msg1 = (cljs.core.truth_(file)?[cljs.core.str.cljs$core$IFn$_invoke$arity$1(file)," "].join(''):null);
|
||||
var msg2 = (cljs.core.truth_(line)?["[line ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(line),", col ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(col),"]"].join(''):null);
|
||||
var msg3 = (cljs.core.truth_((function (){var or__35498__auto__ = msg1;
|
||||
if(cljs.core.truth_(or__35498__auto__)){
|
||||
return or__35498__auto__;
|
||||
} else {
|
||||
return msg2;
|
||||
}
|
||||
})())?" ":null);
|
||||
var full_msg = cljs.core.apply.call(null,cljs.core.str,msg1,msg2,msg3,msg);
|
||||
throw cljs.core.ex_info.call(null,full_msg,details);
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.errors.throw_ex.cljs$lang$maxFixedArity = (2);
|
||||
|
||||
cljs.tools.reader.impl.errors.throw_ex.cljs$lang$applyTo = (function (seq44219){
|
||||
var G__44220 = cljs.core.first.call(null,seq44219);
|
||||
var seq44219__$1 = cljs.core.next.call(null,seq44219);
|
||||
var G__44221 = cljs.core.first.call(null,seq44219__$1);
|
||||
var seq44219__$2 = cljs.core.next.call(null,seq44219__$1);
|
||||
return cljs.tools.reader.impl.errors.throw_ex.cljs$core$IFn$_invoke$arity$variadic(G__44220,G__44221,seq44219__$2);
|
||||
});
|
||||
|
||||
/**
|
||||
* Throws an ExceptionInfo with the given message.
|
||||
* If rdr is an IndexingReader, additional information about column and line number is provided
|
||||
*/
|
||||
cljs.tools.reader.impl.errors.reader_error = (function cljs$tools$reader$impl$errors$reader_error(var_args){
|
||||
var args__36784__auto__ = [];
|
||||
var len__36777__auto___44227 = arguments.length;
|
||||
var i__36778__auto___44228 = (0);
|
||||
while(true){
|
||||
if((i__36778__auto___44228 < len__36777__auto___44227)){
|
||||
args__36784__auto__.push((arguments[i__36778__auto___44228]));
|
||||
|
||||
var G__44229 = (i__36778__auto___44228 + (1));
|
||||
i__36778__auto___44228 = G__44229;
|
||||
continue;
|
||||
} else {
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
var argseq__36785__auto__ = ((((1) < args__36784__auto__.length))?(new cljs.core.IndexedSeq(args__36784__auto__.slice((1)),(0),null)):null);
|
||||
return cljs.tools.reader.impl.errors.reader_error.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__36785__auto__);
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.errors.reader_error.cljs$core$IFn$_invoke$arity$variadic = (function (rdr,msgs){
|
||||
return cljs.tools.reader.impl.errors.throw_ex.call(null,rdr,new cljs.core.Keyword(null,"reader-error","reader-error",1610253121),cljs.core.apply.call(null,cljs.core.str,msgs));
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.errors.reader_error.cljs$lang$maxFixedArity = (1);
|
||||
|
||||
cljs.tools.reader.impl.errors.reader_error.cljs$lang$applyTo = (function (seq44225){
|
||||
var G__44226 = cljs.core.first.call(null,seq44225);
|
||||
var seq44225__$1 = cljs.core.next.call(null,seq44225);
|
||||
return cljs.tools.reader.impl.errors.reader_error.cljs$core$IFn$_invoke$arity$variadic(G__44226,seq44225__$1);
|
||||
});
|
||||
|
||||
/**
|
||||
* Throws an ExceptionInfo with the given message.
|
||||
* If rdr is an IndexingReader, additional information about column and line number is provided
|
||||
*/
|
||||
cljs.tools.reader.impl.errors.illegal_arg_error = (function cljs$tools$reader$impl$errors$illegal_arg_error(var_args){
|
||||
var args__36784__auto__ = [];
|
||||
var len__36777__auto___44232 = arguments.length;
|
||||
var i__36778__auto___44233 = (0);
|
||||
while(true){
|
||||
if((i__36778__auto___44233 < len__36777__auto___44232)){
|
||||
args__36784__auto__.push((arguments[i__36778__auto___44233]));
|
||||
|
||||
var G__44234 = (i__36778__auto___44233 + (1));
|
||||
i__36778__auto___44233 = G__44234;
|
||||
continue;
|
||||
} else {
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
var argseq__36785__auto__ = ((((1) < args__36784__auto__.length))?(new cljs.core.IndexedSeq(args__36784__auto__.slice((1)),(0),null)):null);
|
||||
return cljs.tools.reader.impl.errors.illegal_arg_error.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__36785__auto__);
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.errors.illegal_arg_error.cljs$core$IFn$_invoke$arity$variadic = (function (rdr,msgs){
|
||||
return cljs.tools.reader.impl.errors.throw_ex.call(null,rdr,new cljs.core.Keyword(null,"illegal-argument","illegal-argument",-1845493170),cljs.core.apply.call(null,cljs.core.str,msgs));
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.errors.illegal_arg_error.cljs$lang$maxFixedArity = (1);
|
||||
|
||||
cljs.tools.reader.impl.errors.illegal_arg_error.cljs$lang$applyTo = (function (seq44230){
|
||||
var G__44231 = cljs.core.first.call(null,seq44230);
|
||||
var seq44230__$1 = cljs.core.next.call(null,seq44230);
|
||||
return cljs.tools.reader.impl.errors.illegal_arg_error.cljs$core$IFn$_invoke$arity$variadic(G__44231,seq44230__$1);
|
||||
});
|
||||
|
||||
/**
|
||||
* Throws an ExceptionInfo with the given message.
|
||||
* If rdr is an IndexingReader, additional information about column and line number is provided
|
||||
*/
|
||||
cljs.tools.reader.impl.errors.eof_error = (function cljs$tools$reader$impl$errors$eof_error(var_args){
|
||||
var args__36784__auto__ = [];
|
||||
var len__36777__auto___44237 = arguments.length;
|
||||
var i__36778__auto___44238 = (0);
|
||||
while(true){
|
||||
if((i__36778__auto___44238 < len__36777__auto___44237)){
|
||||
args__36784__auto__.push((arguments[i__36778__auto___44238]));
|
||||
|
||||
var G__44239 = (i__36778__auto___44238 + (1));
|
||||
i__36778__auto___44238 = G__44239;
|
||||
continue;
|
||||
} else {
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
var argseq__36785__auto__ = ((((1) < args__36784__auto__.length))?(new cljs.core.IndexedSeq(args__36784__auto__.slice((1)),(0),null)):null);
|
||||
return cljs.tools.reader.impl.errors.eof_error.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__36785__auto__);
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.errors.eof_error.cljs$core$IFn$_invoke$arity$variadic = (function (rdr,msgs){
|
||||
return cljs.tools.reader.impl.errors.throw_ex.call(null,rdr,new cljs.core.Keyword(null,"eof","eof",-489063237),cljs.core.apply.call(null,cljs.core.str,msgs));
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.errors.eof_error.cljs$lang$maxFixedArity = (1);
|
||||
|
||||
cljs.tools.reader.impl.errors.eof_error.cljs$lang$applyTo = (function (seq44235){
|
||||
var G__44236 = cljs.core.first.call(null,seq44235);
|
||||
var seq44235__$1 = cljs.core.next.call(null,seq44235);
|
||||
return cljs.tools.reader.impl.errors.eof_error.cljs$core$IFn$_invoke$arity$variadic(G__44236,seq44235__$1);
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.errors.throw_eof_delimited = (function cljs$tools$reader$impl$errors$throw_eof_delimited(var_args){
|
||||
var G__44241 = arguments.length;
|
||||
switch (G__44241) {
|
||||
case 4:
|
||||
return cljs.tools.reader.impl.errors.throw_eof_delimited.cljs$core$IFn$_invoke$arity$4((arguments[(0)]),(arguments[(1)]),(arguments[(2)]),(arguments[(3)]));
|
||||
|
||||
break;
|
||||
case 5:
|
||||
return cljs.tools.reader.impl.errors.throw_eof_delimited.cljs$core$IFn$_invoke$arity$5((arguments[(0)]),(arguments[(1)]),(arguments[(2)]),(arguments[(3)]),(arguments[(4)]));
|
||||
|
||||
break;
|
||||
default:
|
||||
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.errors.throw_eof_delimited.cljs$core$IFn$_invoke$arity$4 = (function (rdr,kind,column,line){
|
||||
return cljs.tools.reader.impl.errors.throw_eof_delimited.call(null,rdr,kind,line,column,null);
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.errors.throw_eof_delimited.cljs$core$IFn$_invoke$arity$5 = (function (rdr,kind,line,column,n){
|
||||
return cljs.tools.reader.impl.errors.eof_error.call(null,rdr,"Unexpected EOF while reading ",(cljs.core.truth_(n)?["item ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(n)," of "].join(''):null),cljs.core.name.call(null,kind),(cljs.core.truth_(line)?[", starting at line ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(line)," and column ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(column)].join(''):null),".");
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.errors.throw_eof_delimited.cljs$lang$maxFixedArity = 5;
|
||||
|
||||
cljs.tools.reader.impl.errors.throw_odd_map = (function cljs$tools$reader$impl$errors$throw_odd_map(rdr,line,col,elements){
|
||||
return cljs.tools.reader.impl.errors.reader_error.call(null,rdr,"The map literal starting with ",cljs.tools.reader.impl.inspect.inspect.call(null,cljs.core.first.call(null,elements)),(cljs.core.truth_(line)?[" on line ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(line)," column ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(col)].join(''):null)," contains ",cljs.core.count.call(null,elements)," form(s). Map literals must contain an even number of forms.");
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_invalid_number = (function cljs$tools$reader$impl$errors$throw_invalid_number(rdr,token){
|
||||
return cljs.tools.reader.impl.errors.reader_error.call(null,rdr,"Invalid number: ",token,".");
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_invalid_unicode_literal = (function cljs$tools$reader$impl$errors$throw_invalid_unicode_literal(rdr,token){
|
||||
throw cljs.tools.reader.impl.errors.illegal_arg_error.call(null,rdr,"Invalid unicode literal: \\",token,".");
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_invalid_unicode_escape = (function cljs$tools$reader$impl$errors$throw_invalid_unicode_escape(rdr,ch){
|
||||
return cljs.tools.reader.impl.errors.reader_error.call(null,rdr,"Invalid unicode escape: \\u",ch,".");
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_invalid = (function cljs$tools$reader$impl$errors$throw_invalid(rdr,kind,token){
|
||||
return cljs.tools.reader.impl.errors.reader_error.call(null,rdr,"Invalid ",cljs.core.name.call(null,kind),": ",token,".");
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_eof_at_start = (function cljs$tools$reader$impl$errors$throw_eof_at_start(rdr,kind){
|
||||
return cljs.tools.reader.impl.errors.eof_error.call(null,rdr,"Unexpected EOF while reading start of ",cljs.core.name.call(null,kind),".");
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_bad_char = (function cljs$tools$reader$impl$errors$throw_bad_char(rdr,kind,ch){
|
||||
return cljs.tools.reader.impl.errors.reader_error.call(null,rdr,"Invalid character: ",ch," found while reading ",cljs.core.name.call(null,kind),".");
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_eof_at_dispatch = (function cljs$tools$reader$impl$errors$throw_eof_at_dispatch(rdr){
|
||||
return cljs.tools.reader.impl.errors.eof_error.call(null,rdr,"Unexpected EOF while reading dispatch character.");
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_bad_dispatch = (function cljs$tools$reader$impl$errors$throw_bad_dispatch(rdr,ch){
|
||||
return cljs.tools.reader.impl.errors.reader_error.call(null,rdr,"No dispatch macro for ",ch,".");
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_unmatch_delimiter = (function cljs$tools$reader$impl$errors$throw_unmatch_delimiter(rdr,ch){
|
||||
return cljs.tools.reader.impl.errors.reader_error.call(null,rdr,"Unmatched delimiter ",ch,".");
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_eof_reading = (function cljs$tools$reader$impl$errors$throw_eof_reading(var_args){
|
||||
var args__36784__auto__ = [];
|
||||
var len__36777__auto___44247 = arguments.length;
|
||||
var i__36778__auto___44248 = (0);
|
||||
while(true){
|
||||
if((i__36778__auto___44248 < len__36777__auto___44247)){
|
||||
args__36784__auto__.push((arguments[i__36778__auto___44248]));
|
||||
|
||||
var G__44249 = (i__36778__auto___44248 + (1));
|
||||
i__36778__auto___44248 = G__44249;
|
||||
continue;
|
||||
} else {
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
var argseq__36785__auto__ = ((((2) < args__36784__auto__.length))?(new cljs.core.IndexedSeq(args__36784__auto__.slice((2)),(0),null)):null);
|
||||
return cljs.tools.reader.impl.errors.throw_eof_reading.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),argseq__36785__auto__);
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.errors.throw_eof_reading.cljs$core$IFn$_invoke$arity$variadic = (function (rdr,kind,start){
|
||||
var init = (function (){var G__44246 = kind;
|
||||
var G__44246__$1 = (((G__44246 instanceof cljs.core.Keyword))?G__44246.fqn:null);
|
||||
switch (G__44246__$1) {
|
||||
case "regex":
|
||||
return "#\"";
|
||||
|
||||
break;
|
||||
case "string":
|
||||
return "\"";
|
||||
|
||||
break;
|
||||
default:
|
||||
throw (new Error(["No matching clause: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__44246__$1)].join('')));
|
||||
|
||||
}
|
||||
})();
|
||||
return cljs.tools.reader.impl.errors.eof_error.call(null,rdr,"Unexpected EOF reading ",cljs.core.name.call(null,kind)," starting ",cljs.core.apply.call(null,cljs.core.str,init,start),".");
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.errors.throw_eof_reading.cljs$lang$maxFixedArity = (2);
|
||||
|
||||
cljs.tools.reader.impl.errors.throw_eof_reading.cljs$lang$applyTo = (function (seq44243){
|
||||
var G__44244 = cljs.core.first.call(null,seq44243);
|
||||
var seq44243__$1 = cljs.core.next.call(null,seq44243);
|
||||
var G__44245 = cljs.core.first.call(null,seq44243__$1);
|
||||
var seq44243__$2 = cljs.core.next.call(null,seq44243__$1);
|
||||
return cljs.tools.reader.impl.errors.throw_eof_reading.cljs$core$IFn$_invoke$arity$variadic(G__44244,G__44245,seq44243__$2);
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.errors.throw_no_dispatch = (function cljs$tools$reader$impl$errors$throw_no_dispatch(rdr,ch){
|
||||
return cljs.tools.reader.impl.errors.throw_bad_dispatch.call(null,rdr,ch);
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_invalid_unicode_char = (function cljs$tools$reader$impl$errors$throw_invalid_unicode_char(rdr,token){
|
||||
return cljs.tools.reader.impl.errors.reader_error.call(null,rdr,"Invalid unicode character \\",token,".");
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_invalid_unicode_digit_in_token = (function cljs$tools$reader$impl$errors$throw_invalid_unicode_digit_in_token(rdr,ch,token){
|
||||
return cljs.tools.reader.impl.errors.illegal_arg_error.call(null,rdr,"Invalid digit ",ch," in unicode character \\",token,".");
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_invalid_unicode_digit = (function cljs$tools$reader$impl$errors$throw_invalid_unicode_digit(rdr,ch){
|
||||
return cljs.tools.reader.impl.errors.illegal_arg_error.call(null,rdr,"Invalid digit ",ch," in unicode character.");
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_invalid_unicode_len = (function cljs$tools$reader$impl$errors$throw_invalid_unicode_len(rdr,actual,expected){
|
||||
return cljs.tools.reader.impl.errors.illegal_arg_error.call(null,rdr,"Invalid unicode literal. Unicode literals should be ",expected,"characters long. ","value suppled is ",actual,"characters long.");
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_invalid_character_literal = (function cljs$tools$reader$impl$errors$throw_invalid_character_literal(rdr,token){
|
||||
return cljs.tools.reader.impl.errors.reader_error.call(null,rdr,"Invalid character literal \\u",token,".");
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_invalid_octal_len = (function cljs$tools$reader$impl$errors$throw_invalid_octal_len(rdr,token){
|
||||
return cljs.tools.reader.impl.errors.reader_error.call(null,rdr,"Invalid octal escape sequence in a character literal:",token,". Octal escape sequences must be 3 or fewer digits.");
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_bad_octal_number = (function cljs$tools$reader$impl$errors$throw_bad_octal_number(rdr){
|
||||
return cljs.tools.reader.impl.errors.reader_error.call(null,rdr,"Octal escape sequence must be in range [0, 377].");
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_unsupported_character = (function cljs$tools$reader$impl$errors$throw_unsupported_character(rdr,token){
|
||||
return cljs.tools.reader.impl.errors.reader_error.call(null,rdr,"Unsupported character: ",token,".");
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_eof_in_character = (function cljs$tools$reader$impl$errors$throw_eof_in_character(rdr){
|
||||
return cljs.tools.reader.impl.errors.eof_error.call(null,rdr,"Unexpected EOF while reading character.");
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_bad_escape_char = (function cljs$tools$reader$impl$errors$throw_bad_escape_char(rdr,ch){
|
||||
return cljs.tools.reader.impl.errors.reader_error.call(null,rdr,"Unsupported escape character: \\",ch,".");
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_single_colon = (function cljs$tools$reader$impl$errors$throw_single_colon(rdr){
|
||||
return cljs.tools.reader.impl.errors.reader_error.call(null,rdr,"A single colon is not a valid keyword.");
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_bad_metadata = (function cljs$tools$reader$impl$errors$throw_bad_metadata(rdr,x){
|
||||
return cljs.tools.reader.impl.errors.reader_error.call(null,rdr,"Metadata cannot be ",cljs.tools.reader.impl.inspect.inspect.call(null,x),". Metadata must be a Symbol, Keyword, String or Map.");
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_bad_metadata_target = (function cljs$tools$reader$impl$errors$throw_bad_metadata_target(rdr,target){
|
||||
return cljs.tools.reader.impl.errors.reader_error.call(null,rdr,"Metadata can not be applied to ",cljs.tools.reader.impl.inspect.inspect.call(null,target),". ","Metadata can only be applied to IMetas.");
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_feature_not_keyword = (function cljs$tools$reader$impl$errors$throw_feature_not_keyword(rdr,feature){
|
||||
return cljs.tools.reader.impl.errors.reader_error.call(null,rdr,"Feature cannot be ",cljs.tools.reader.impl.inspect.inspect.call(null,feature)," Features must be keywords.");
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_ns_map_no_map = (function cljs$tools$reader$impl$errors$throw_ns_map_no_map(rdr,ns_name){
|
||||
return cljs.tools.reader.impl.errors.reader_error.call(null,rdr,"Namespaced map with namespace ",ns_name," does not specify a map.");
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_bad_ns = (function cljs$tools$reader$impl$errors$throw_bad_ns(rdr,ns_name){
|
||||
return cljs.tools.reader.impl.errors.reader_error.call(null,rdr,"Invalid value used as namespace in namespaced map: ",ns_name,".");
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_bad_reader_tag = (function cljs$tools$reader$impl$errors$throw_bad_reader_tag(rdr,tag){
|
||||
return cljs.tools.reader.impl.errors.reader_error.call(null,rdr,"Invalid reader tag: ",cljs.tools.reader.impl.inspect.inspect.call(null,tag),". Reader tags must be symbols.");
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_unknown_reader_tag = (function cljs$tools$reader$impl$errors$throw_unknown_reader_tag(rdr,tag){
|
||||
return cljs.tools.reader.impl.errors.reader_error.call(null,rdr,"No reader function for tag ",cljs.tools.reader.impl.inspect.inspect.call(null,tag),".");
|
||||
});
|
||||
cljs.tools.reader.impl.errors.duplicate_keys_error = (function cljs$tools$reader$impl$errors$duplicate_keys_error(msg,coll){
|
||||
var duplicates = (function cljs$tools$reader$impl$errors$duplicate_keys_error_$_duplicates(seq){
|
||||
var iter__36380__auto__ = (function cljs$tools$reader$impl$errors$duplicate_keys_error_$_duplicates_$_iter__44261(s__44262){
|
||||
return (new cljs.core.LazySeq(null,(function (){
|
||||
var s__44262__$1 = s__44262;
|
||||
while(true){
|
||||
var temp__5457__auto__ = cljs.core.seq.call(null,s__44262__$1);
|
||||
if(temp__5457__auto__){
|
||||
var s__44262__$2 = temp__5457__auto__;
|
||||
if(cljs.core.chunked_seq_QMARK_.call(null,s__44262__$2)){
|
||||
var c__36378__auto__ = cljs.core.chunk_first.call(null,s__44262__$2);
|
||||
var size__36379__auto__ = cljs.core.count.call(null,c__36378__auto__);
|
||||
var b__44264 = cljs.core.chunk_buffer.call(null,size__36379__auto__);
|
||||
if((function (){var i__44263 = (0);
|
||||
while(true){
|
||||
if((i__44263 < size__36379__auto__)){
|
||||
var vec__44265 = cljs.core._nth.call(null,c__36378__auto__,i__44263);
|
||||
var id = cljs.core.nth.call(null,vec__44265,(0),null);
|
||||
var freq = cljs.core.nth.call(null,vec__44265,(1),null);
|
||||
if((freq > (1))){
|
||||
cljs.core.chunk_append.call(null,b__44264,id);
|
||||
|
||||
var G__44271 = (i__44263 + (1));
|
||||
i__44263 = G__44271;
|
||||
continue;
|
||||
} else {
|
||||
var G__44272 = (i__44263 + (1));
|
||||
i__44263 = G__44272;
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
})()){
|
||||
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__44264),cljs$tools$reader$impl$errors$duplicate_keys_error_$_duplicates_$_iter__44261.call(null,cljs.core.chunk_rest.call(null,s__44262__$2)));
|
||||
} else {
|
||||
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__44264),null);
|
||||
}
|
||||
} else {
|
||||
var vec__44268 = cljs.core.first.call(null,s__44262__$2);
|
||||
var id = cljs.core.nth.call(null,vec__44268,(0),null);
|
||||
var freq = cljs.core.nth.call(null,vec__44268,(1),null);
|
||||
if((freq > (1))){
|
||||
return cljs.core.cons.call(null,id,cljs$tools$reader$impl$errors$duplicate_keys_error_$_duplicates_$_iter__44261.call(null,cljs.core.rest.call(null,s__44262__$2)));
|
||||
} else {
|
||||
var G__44273 = cljs.core.rest.call(null,s__44262__$2);
|
||||
s__44262__$1 = G__44273;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}),null,null));
|
||||
});
|
||||
return iter__36380__auto__.call(null,cljs.core.frequencies.call(null,seq));
|
||||
});
|
||||
var dups = duplicates.call(null,coll);
|
||||
return cljs.core.apply.call(null,cljs.core.str,msg,(((cljs.core.count.call(null,dups) > (1)))?"s":null),": ",cljs.core.interpose.call(null,", ",dups));
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_dup_keys = (function cljs$tools$reader$impl$errors$throw_dup_keys(rdr,kind,ks){
|
||||
return cljs.tools.reader.impl.errors.reader_error.call(null,rdr,cljs.tools.reader.impl.errors.duplicate_keys_error.call(null,[cljs.core.str.cljs$core$IFn$_invoke$arity$1(clojure.string.capitalize.call(null,cljs.core.name.call(null,kind)))," literal contains duplicate key"].join(''),ks));
|
||||
});
|
||||
cljs.tools.reader.impl.errors.throw_eof_error = (function cljs$tools$reader$impl$errors$throw_eof_error(rdr,line){
|
||||
if(cljs.core.truth_(line)){
|
||||
return cljs.tools.reader.impl.errors.eof_error.call(null,rdr,"EOF while reading, starting at line ",line,".");
|
||||
} else {
|
||||
return cljs.tools.reader.impl.errors.eof_error.call(null,rdr,"EOF while reading.");
|
||||
}
|
||||
});
|
||||
|
||||
//# sourceMappingURL=errors.js.map?rel=1517021946468
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"\/home\/didier\/clojupyter\/website\/target\/cljsbuild\/public\/js\/out\/cljs\/tools\/reader\/impl\/errors.js","sources":["errors.cljs?rel=1517021946470"],"lineCount":413,"mappings":";AAQA;;;;;AAKA,2CAAA,3CAAOA,8FACJC,IAAIC;AADP,AAEE,cAAA,2CAAA,qDAAA,8EAAA,xLAAMC,mPACkBD;AADxB,AAEE,oBAAI,AAACE,gEAAuBH;AAC1B,yCAAA,kHAAA,kHAAA,tQAACI,0BACAF,8DACM,AAACG,uDAAoBL,yDACrB,AAACM,yDAAsBN,yDACxB,AAACO,2DAAwBP;;AAC\/BE;;;AAEN,AAAA;;;yCAAA,iDAAAM,1FAAOM;AAAP,AAAA,IAAAL,sBAAA;AAAA,AAAA,IAAAC,2BAAA,AAAA;AAAA,AAAA,IAAAC,yBAAA;;AAAA,AAAA,GAAA,CAAAA,yBAAAD;AAAA,AAAA,AAAAD,yBAAA,CAAA,UAAAE;;AAAA,eAAA,CAAAA,yBAAA;;;;AAAA;;;;AAAA,IAAAC,wBAAA,EAAA,CAAA,MAAA,AAAAH,6BAAA,AAAA,KAAAI,qBAAA,AAAAJ,0BAAA,KAAA,IAAA,OAAA;AA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;AAAA,AAAA,IAAAC,yBAAA;;AAAA,AAAA,GAAA,CAAAA,yBAAAD;AAAA,AAAA,AAAAD,yBAAA,CAAA,UAAAE;;AAAA,eAAA,CAAAA,yBAAA;;;;AAAA;;;;AALine truncated
|
||||
@@ -0,0 +1,90 @@
|
||||
;; Copyright (c) Russ Olsen, Nicola Mometto, Rich Hickey & contributors.
|
||||
;; The use and distribution terms for this software are covered by the
|
||||
;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
|
||||
;; which can be found in the file epl-v10.html at the root of this distribution.
|
||||
;; By using this software in any fashion, you are agreeing to be bound by
|
||||
;; the terms of this license.
|
||||
;; You must not remove this notice, or any other, from this software.
|
||||
|
||||
(ns cljs.tools.reader.impl.inspect)
|
||||
|
||||
(declare inspect*)
|
||||
|
||||
(defn- inspect*-col [truncate col start end]
|
||||
(let [n (count col)
|
||||
l (if truncate 0 (min 10 n))
|
||||
elements (map (partial inspect* true) (take l col))
|
||||
content (apply str (interpose " " elements))
|
||||
suffix (if (< l n) "...")]
|
||||
(str start content suffix end)))
|
||||
|
||||
(defn- dispatch-inspect
|
||||
[_ x]
|
||||
(cond
|
||||
(nil? x) :nil
|
||||
(string? x) :string
|
||||
(keyword? x) :strable
|
||||
(number? x) :strable
|
||||
(symbol? x) :strable
|
||||
(vector? x) :vector
|
||||
(list? x) :list
|
||||
(map? x) :map
|
||||
(set? x) :set
|
||||
(= x true) :strable
|
||||
(= x false) :strable
|
||||
:default (type x)))
|
||||
|
||||
(defmulti inspect* dispatch-inspect)
|
||||
|
||||
(defmethod inspect* :string [truncate ^String x]
|
||||
(let [n (if truncate 5 20)
|
||||
suffix (if (> (.-length x) n) "...\"" "\"")]
|
||||
(str
|
||||
\"
|
||||
(.substring ^String x 0 (min n (.-length x)))
|
||||
suffix)))
|
||||
|
||||
(defmethod inspect* :strable [truncate x] (str x))
|
||||
|
||||
(defmethod inspect* cljs.coreIndexedSeq [truncate x]
|
||||
"<indexed seq>")
|
||||
|
||||
(defmethod inspect* cljs.core/PersistentArrayMapSeq [truncate x]
|
||||
"<map seq>")
|
||||
|
||||
(defmethod inspect* cljs.core/NodeSeq [truncate x]
|
||||
"<map seq>")
|
||||
|
||||
(defmethod inspect* cljs.core/Cons [truncate x] "<cons>")
|
||||
|
||||
(defmethod inspect* cljs.core/LazySeq [truncate x] "<lazy seq>")
|
||||
|
||||
(defmethod inspect* :nil [_ _] "nil")
|
||||
|
||||
(defmethod inspect* :list [truncate col]
|
||||
(inspect*-col truncate col \( \)))
|
||||
|
||||
(defmethod inspect* :map [truncate m]
|
||||
(let [len (count m)
|
||||
n-shown (if truncate 0 len)
|
||||
contents (apply concat (take n-shown m))
|
||||
suffix (if (> len n-shown) "...}" \})]
|
||||
(inspect*-col truncate contents \{ suffix)))
|
||||
|
||||
(defmethod inspect* :set [truncate col]
|
||||
(inspect*-col truncate col "#{" \}))
|
||||
|
||||
(defmethod inspect* :vector [truncate col]
|
||||
(inspect*-col truncate col \[ \]))
|
||||
|
||||
(defmethod inspect* :default [truncate x]
|
||||
(pr-str (type x)))
|
||||
|
||||
(defn inspect
|
||||
"Return a string description of the value supplied.
|
||||
May be the a string version of the value itself (e.g. \"true\")
|
||||
or it may be a description (e.g. \"an instance of Foo\").
|
||||
If truncate is true then return a very terse version of
|
||||
the inspection."
|
||||
([x] (inspect* false x))
|
||||
([truncate x] (inspect* truncate x)))
|
||||
@@ -0,0 +1 @@
|
||||
{:rename-macros {}, :renames {}, :externs {Error {}}, :use-macros {}, :excludes #{}, :name cljs.tools.reader.impl.inspect, :imports nil, :requires nil, :cljs.spec/speced-vars [], :uses nil, :defs {inspect* {:name cljs.tools.reader.impl.inspect/inspect*, :file "target/cljsbuild/public/js/out/cljs/tools/reader/impl/inspect.cljs", :line 37, :column 1, :end-line 37, :end-column 19, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/tools/reader/impl/inspect.cljs", :line 37, :column 11, :end-line 37, :end-column 19}, :tag cljs.core/MultiFn}, inspect*-col {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/tools/reader/impl/inspect.cljs", :line 13, :column 8, :end-line 13, :end-column 20, :private true, :arglists (quote ([truncate col start end]))}, :private true, :name cljs.tools.reader.impl.inspect/inspect*-col, :variadic false, :file "target/cljsbuild/public/js/out/cljs/tools/reader/impl/inspect.cljs", :end-column 20, :method-params ([truncate col start end]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 13, :end-line 13, :max-fixed-arity 4, :fn-var true, :arglists (quote ([truncate col start end]))}, dispatch-inspect {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/tools/reader/impl/inspect.cljs", :line 21, :column 8, :end-line 21, :end-column 24, :private true, :arglists (quote ([_ x]))}, :private true, :name cljs.tools.reader.impl.inspect/dispatch-inspect, :variadic false, :file "target/cljsbuild/public/js/out/cljs/tools/reader/impl/inspect.cljs", :end-column 24, :method-params ([_ x]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 21, :end-line 21, :max-fixed-arity 2, :fn-var true, :arglists (quote ([_ x]))}, inspect {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/tools/reader/impl/inspect.cljs", :line 83, :column 7, :end-line 83, :end-column 14, :arglists (quote ([x] [truncate x])), :doc "Return a string description of the value supplied.\n May be the a string version of the value itself (e.g. \"true\")\n or it may be a description (e.g. \"an instance of Foo\").\n If truncate is true then return a very terse version of\n the inspection.", :top-fn {:variadic false, :max-fixed-arity 2, :method-params ([x] [truncate x]), :arglists ([x] [truncate x]), :arglists-meta (nil nil)}}, :name cljs.tools.reader.impl.inspect/inspect, :variadic false, :file "target/cljsbuild/public/js/out/cljs/tools/reader/impl/inspect.cljs", :end-column 14, :top-fn {:variadic false, :max-fixed-arity 2, :method-params ([x] [truncate x]), :arglists ([x] [truncate x]), :arglists-meta (nil nil)}, :method-params ([x] [truncate x]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 83, :end-line 83, :max-fixed-arity 2, :fn-var true, :arglists ([x] [truncate x]), :doc "Return a string description of the value supplied.\n May be the a string version of the value itself (e.g. \"true\")\n or it may be a description (e.g. \"an instance of Foo\").\n If truncate is true then return a very terse version of\n the inspection."}}, :cljs.spec/registry-ref [], :require-macros nil, :cljs.analyzer/constants {:seen #{:default :string :vector :strable :list :nil :set :hierarchy :map}, :order [:nil :string :strable :vector :list :map :set :default :hierarchy]}, :doc nil}
|
||||
@@ -0,0 +1,156 @@
|
||||
// Compiled by ClojureScript 1.9.946 {}
|
||||
goog.provide('cljs.tools.reader.impl.inspect');
|
||||
goog.require('cljs.core');
|
||||
cljs.tools.reader.impl.inspect.inspect_STAR__col = (function cljs$tools$reader$impl$inspect$inspect_STAR__col(truncate,col,start,end){
|
||||
var n = cljs.core.count.call(null,col);
|
||||
var l = (cljs.core.truth_(truncate)?(0):(function (){var x__35857__auto__ = (10);
|
||||
var y__35858__auto__ = n;
|
||||
return ((x__35857__auto__ < y__35858__auto__) ? x__35857__auto__ : y__35858__auto__);
|
||||
})());
|
||||
var elements = cljs.core.map.call(null,cljs.core.partial.call(null,cljs.tools.reader.impl.inspect.inspect_STAR_,true),cljs.core.take.call(null,l,col));
|
||||
var content = cljs.core.apply.call(null,cljs.core.str,cljs.core.interpose.call(null," ",elements));
|
||||
var suffix = (((l < n))?"...":null);
|
||||
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(start),cljs.core.str.cljs$core$IFn$_invoke$arity$1(content),cljs.core.str.cljs$core$IFn$_invoke$arity$1(suffix),cljs.core.str.cljs$core$IFn$_invoke$arity$1(end)].join('');
|
||||
});
|
||||
cljs.tools.reader.impl.inspect.dispatch_inspect = (function cljs$tools$reader$impl$inspect$dispatch_inspect(_,x){
|
||||
if((x == null)){
|
||||
return new cljs.core.Keyword(null,"nil","nil",99600501);
|
||||
} else {
|
||||
if(typeof x === 'string'){
|
||||
return new cljs.core.Keyword(null,"string","string",-1989541586);
|
||||
} else {
|
||||
if((x instanceof cljs.core.Keyword)){
|
||||
return new cljs.core.Keyword(null,"strable","strable",1877668047);
|
||||
} else {
|
||||
if(typeof x === 'number'){
|
||||
return new cljs.core.Keyword(null,"strable","strable",1877668047);
|
||||
} else {
|
||||
if((x instanceof cljs.core.Symbol)){
|
||||
return new cljs.core.Keyword(null,"strable","strable",1877668047);
|
||||
} else {
|
||||
if(cljs.core.vector_QMARK_.call(null,x)){
|
||||
return new cljs.core.Keyword(null,"vector","vector",1902966158);
|
||||
} else {
|
||||
if(cljs.core.list_QMARK_.call(null,x)){
|
||||
return new cljs.core.Keyword(null,"list","list",765357683);
|
||||
} else {
|
||||
if(cljs.core.map_QMARK_.call(null,x)){
|
||||
return new cljs.core.Keyword(null,"map","map",1371690461);
|
||||
} else {
|
||||
if(cljs.core.set_QMARK_.call(null,x)){
|
||||
return new cljs.core.Keyword(null,"set","set",304602554);
|
||||
} else {
|
||||
if(cljs.core._EQ_.call(null,x,true)){
|
||||
return new cljs.core.Keyword(null,"strable","strable",1877668047);
|
||||
} else {
|
||||
if(cljs.core._EQ_.call(null,x,false)){
|
||||
return new cljs.core.Keyword(null,"strable","strable",1877668047);
|
||||
} else {
|
||||
return cljs.core.type.call(null,x);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
if(typeof cljs.tools.reader.impl.inspect.inspect_STAR_ !== 'undefined'){
|
||||
} else {
|
||||
cljs.tools.reader.impl.inspect.inspect_STAR_ = (function (){var method_table__36553__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
|
||||
var prefer_table__36554__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
|
||||
var method_cache__36555__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
|
||||
var cached_hierarchy__36556__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
|
||||
var hierarchy__36557__auto__ = cljs.core.get.call(null,cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"hierarchy","hierarchy",-1053470341),cljs.core.get_global_hierarchy.call(null));
|
||||
return (new cljs.core.MultiFn(cljs.core.symbol.call(null,"cljs.tools.reader.impl.inspect","inspect*"),cljs.tools.reader.impl.inspect.dispatch_inspect,new cljs.core.Keyword(null,"default","default",-1987822328),hierarchy__36557__auto__,method_table__36553__auto__,prefer_table__36554__auto__,method_cache__36555__auto__,cached_hierarchy__36556__auto__));
|
||||
})();
|
||||
}
|
||||
cljs.core._add_method.call(null,cljs.tools.reader.impl.inspect.inspect_STAR_,new cljs.core.Keyword(null,"string","string",-1989541586),(function (truncate,x){
|
||||
var n = (cljs.core.truth_(truncate)?(5):(20));
|
||||
var suffix = (((x.length > n))?"...\"":"\"");
|
||||
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1("\""),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x.substring((0),(function (){var x__35857__auto__ = n;
|
||||
var y__35858__auto__ = x.length;
|
||||
return ((x__35857__auto__ < y__35858__auto__) ? x__35857__auto__ : y__35858__auto__);
|
||||
})())),cljs.core.str.cljs$core$IFn$_invoke$arity$1(suffix)].join('');
|
||||
}));
|
||||
cljs.core._add_method.call(null,cljs.tools.reader.impl.inspect.inspect_STAR_,new cljs.core.Keyword(null,"strable","strable",1877668047),(function (truncate,x){
|
||||
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(x)].join('');
|
||||
}));
|
||||
cljs.core._add_method.call(null,cljs.tools.reader.impl.inspect.inspect_STAR_,cljs.coreIndexedSeq,(function (truncate,x){
|
||||
return "<indexed seq>";
|
||||
}));
|
||||
cljs.core._add_method.call(null,cljs.tools.reader.impl.inspect.inspect_STAR_,cljs.core.PersistentArrayMapSeq,(function (truncate,x){
|
||||
return "<map seq>";
|
||||
}));
|
||||
cljs.core._add_method.call(null,cljs.tools.reader.impl.inspect.inspect_STAR_,cljs.core.NodeSeq,(function (truncate,x){
|
||||
return "<map seq>";
|
||||
}));
|
||||
cljs.core._add_method.call(null,cljs.tools.reader.impl.inspect.inspect_STAR_,cljs.core.Cons,(function (truncate,x){
|
||||
return "<cons>";
|
||||
}));
|
||||
cljs.core._add_method.call(null,cljs.tools.reader.impl.inspect.inspect_STAR_,cljs.core.LazySeq,(function (truncate,x){
|
||||
return "<lazy seq>";
|
||||
}));
|
||||
cljs.core._add_method.call(null,cljs.tools.reader.impl.inspect.inspect_STAR_,new cljs.core.Keyword(null,"nil","nil",99600501),(function (_,___$1){
|
||||
return "nil";
|
||||
}));
|
||||
cljs.core._add_method.call(null,cljs.tools.reader.impl.inspect.inspect_STAR_,new cljs.core.Keyword(null,"list","list",765357683),(function (truncate,col){
|
||||
return cljs.tools.reader.impl.inspect.inspect_STAR__col.call(null,truncate,col,"(",")");
|
||||
}));
|
||||
cljs.core._add_method.call(null,cljs.tools.reader.impl.inspect.inspect_STAR_,new cljs.core.Keyword(null,"map","map",1371690461),(function (truncate,m){
|
||||
var len = cljs.core.count.call(null,m);
|
||||
var n_shown = (cljs.core.truth_(truncate)?(0):len);
|
||||
var contents = cljs.core.apply.call(null,cljs.core.concat,cljs.core.take.call(null,n_shown,m));
|
||||
var suffix = (((len > n_shown))?"...}":"}");
|
||||
return cljs.tools.reader.impl.inspect.inspect_STAR__col.call(null,truncate,contents,"{",suffix);
|
||||
}));
|
||||
cljs.core._add_method.call(null,cljs.tools.reader.impl.inspect.inspect_STAR_,new cljs.core.Keyword(null,"set","set",304602554),(function (truncate,col){
|
||||
return cljs.tools.reader.impl.inspect.inspect_STAR__col.call(null,truncate,col,"#{","}");
|
||||
}));
|
||||
cljs.core._add_method.call(null,cljs.tools.reader.impl.inspect.inspect_STAR_,new cljs.core.Keyword(null,"vector","vector",1902966158),(function (truncate,col){
|
||||
return cljs.tools.reader.impl.inspect.inspect_STAR__col.call(null,truncate,col,"[","]");
|
||||
}));
|
||||
cljs.core._add_method.call(null,cljs.tools.reader.impl.inspect.inspect_STAR_,new cljs.core.Keyword(null,"default","default",-1987822328),(function (truncate,x){
|
||||
return cljs.core.pr_str.call(null,cljs.core.type.call(null,x));
|
||||
}));
|
||||
/**
|
||||
* Return a string description of the value supplied.
|
||||
* May be the a string version of the value itself (e.g. "true")
|
||||
* or it may be a description (e.g. "an instance of Foo").
|
||||
* If truncate is true then return a very terse version of
|
||||
* the inspection.
|
||||
*/
|
||||
cljs.tools.reader.impl.inspect.inspect = (function cljs$tools$reader$impl$inspect$inspect(var_args){
|
||||
var G__44215 = arguments.length;
|
||||
switch (G__44215) {
|
||||
case 1:
|
||||
return cljs.tools.reader.impl.inspect.inspect.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));
|
||||
|
||||
break;
|
||||
case 2:
|
||||
return cljs.tools.reader.impl.inspect.inspect.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));
|
||||
|
||||
break;
|
||||
default:
|
||||
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.inspect.inspect.cljs$core$IFn$_invoke$arity$1 = (function (x){
|
||||
return cljs.tools.reader.impl.inspect.inspect_STAR_.call(null,false,x);
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.inspect.inspect.cljs$core$IFn$_invoke$arity$2 = (function (truncate,x){
|
||||
return cljs.tools.reader.impl.inspect.inspect_STAR_.call(null,truncate,x);
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.inspect.inspect.cljs$lang$maxFixedArity = 2;
|
||||
|
||||
|
||||
//# sourceMappingURL=inspect.js.map?rel=1517021946396
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"\/home\/didier\/clojupyter\/website\/target\/cljsbuild\/public\/js\/out\/cljs\/tools\/reader\/impl\/inspect.js","sources":["inspect.cljs?rel=1517021946397"],"line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AAaC,SAASiD,aAAY\/B;;AAEvC,AAAAsB,gCAAA5B,6CAAA,kDAAA,WAA0BZ,SAASC;AAAnC,AACE,+EAAA,KAAA,7EAACF,2DAAaC,SAASC;;AAEzB,AAAAuC,gCAAA5B,6CAAA,yDAAA,WAA6BZ,SAASC;AAAtC,AACE,+EAAA,IAAA,5EAACF,2DAAaC,SAASC;;AAEzB,AAAAuC,gCAAA5B,6CAAA,4DAAA,WAA8BZ,SAASqB;AAAvC,AACE,OAAC8B,2BAAO,AAACtB,yBAAKR;;AAEhB,AAAA;;;;;;;yCAAA,iDAAA+B,1FAAME;AAAN,AAAA,IAAAD,WAAA,AAAA;AAAA,AAAA,QAAAA;KAAA;AAAA,OAAAC,qEAAA,CAAA,UAAA;;;KAAA;AAAA,OAAAA,qEAAA,CAAA,UAAA,MAAA,CAAA,UAAA;;;;AAAA,MAAA,KAAAC,MAAA,CAAA,8DAAA,AAAA;;;;;AAAA,AAAA,uEAAA,vEAAMD,kFAMFjC;AANJ,AAMO,8DAAA,vDAACT,6DAAeS;;;AANvB,AAAA,uEAAA,vEAAMiC,kFAOFtD,SAASqB;AAPb,AAOgB,OAACT,uDAASZ,SAASqB;;;AAPnC,AAAA,iEAAA,jEAAMiC;;AAAN","names":["cljs.tools.reader.impl.inspect\/inspect*-col","truncate","col","start","end","n","cljs.core\/count","l","x__35857__auto__","y__35858__auto__","elements","cljs.core\/map","cljs.core\/partial","cljs.tools.reader.impl.inspect\/inspect*","cljs.core\/take","content","cljs.core\/apply","cljs.core\/str","cljs.core\/interpose","suffix","cljs.tools.reader.impl.inspect\/dispatch-inspect","_","x","cljs.core\/Keyword","cljs.core\/Symbol","cljs.core\/vector?","cljs.core\/list?","cljs.core\/map?","cljs.core\/set?","cljs.core\/=","cljs.core\/type","method-table__36553__auto__","cljs.core\/atom","prefer-table__36554__auto__","method-cache__36555__auto__","cached-hierarchy__36556__auto__","hierarchy__36557__auto__","cljs.core\/get","cljs.core\/get-global-hierarchy","cljs.core\/MultiFn","cljs.core\/symbol","cljs.core\/-add-method","cljs\/coreIndexedSeq","cljs.core\/PersistentArrayMapSeq","cljs.core\/NodeSeq","cljs.core\/Cons","cljs.core\/LazySeq","m","len","n-shown","contents","cljs.core\/concat","cljs.core\/pr-str","var_args","G__44215","cljs.tools.reader.impl.inspect\/inspect","js\/Error"]}
|
||||
@@ -0,0 +1,97 @@
|
||||
;; Copyright (c) Nicola Mometto, Rich Hickey & contributors.
|
||||
;; The use and distribution terms for this software are covered by the
|
||||
;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
|
||||
;; which can be found in the file epl-v10.html at the root of this distribution.
|
||||
;; By using this software in any fashion, you are agreeing to be bound by
|
||||
;; the terms of this license.
|
||||
;; You must not remove this notice, or any other, from this software.
|
||||
|
||||
(ns cljs.tools.reader.impl.utils
|
||||
(:refer-clojure :exclude [char])
|
||||
(:require
|
||||
[clojure.string :as string]
|
||||
[goog.string :as gstring]))
|
||||
|
||||
(defn char [x]
|
||||
(when-not (nil? x)
|
||||
(cljs.core/char x)))
|
||||
|
||||
(defn ^boolean ex-info? [ex]
|
||||
(instance? cljs.core.ExceptionInfo ex))
|
||||
|
||||
(defrecord ReaderConditional [splicing? form])
|
||||
|
||||
(defn ^boolean reader-conditional?
|
||||
"Return true if the value is the data representation of a reader conditional"
|
||||
[value]
|
||||
(instance? ReaderConditional value))
|
||||
|
||||
(defn reader-conditional
|
||||
"Construct a data representation of a reader conditional.
|
||||
If true, splicing? indicates read-cond-splicing."
|
||||
[form splicing?]
|
||||
(ReaderConditional. splicing? form))
|
||||
|
||||
(extend-protocol IPrintWithWriter
|
||||
ReaderConditional
|
||||
(-pr-writer [coll writer opts]
|
||||
(-write writer (str "#?" (when (:splicing? coll) "@")))
|
||||
(pr-writer (:form coll) writer opts)))
|
||||
|
||||
(def ws-rx #"[\s]")
|
||||
|
||||
(defn ^boolean whitespace?
|
||||
"Checks whether a given character is whitespace"
|
||||
[ch]
|
||||
(when-not (nil? ch)
|
||||
(if (identical? ch \,)
|
||||
true
|
||||
(.test ws-rx ch))))
|
||||
|
||||
(defn ^boolean numeric?
|
||||
"Checks whether a given character is numeric"
|
||||
[ch]
|
||||
(when-not (nil? ch)
|
||||
(gstring/isNumeric ch)))
|
||||
|
||||
(defn ^boolean newline?
|
||||
"Checks whether the character is a newline"
|
||||
[c]
|
||||
(or (identical? \newline c)
|
||||
(identical? "\n" c)
|
||||
(nil? c)))
|
||||
|
||||
(defn desugar-meta
|
||||
"Resolves syntactical sugar in metadata" ;; could be combined with some other desugar?
|
||||
[f]
|
||||
(cond
|
||||
(keyword? f) {f true}
|
||||
(symbol? f) {:tag f}
|
||||
(string? f) {:tag f}
|
||||
:else f))
|
||||
|
||||
(def last-id (atom 0))
|
||||
|
||||
(defn next-id
|
||||
[]
|
||||
(swap! last-id inc))
|
||||
|
||||
(defn namespace-keys [ns keys]
|
||||
(for [key keys]
|
||||
(if (or (symbol? key)
|
||||
(keyword? key))
|
||||
(let [[key-ns key-name] ((juxt namespace name) key)
|
||||
->key (if (symbol? key) symbol keyword)]
|
||||
(cond
|
||||
(nil? key-ns)
|
||||
(->key ns key-name)
|
||||
|
||||
(= "_" key-ns)
|
||||
(->key key-name)
|
||||
|
||||
:else
|
||||
key))
|
||||
key)))
|
||||
|
||||
(defn second' [[a b]]
|
||||
(when-not a b))
|
||||
@@ -0,0 +1 @@
|
||||
{:rename-macros {}, :renames {}, :use-macros {}, :excludes #{char}, :name cljs.tools.reader.impl.utils, :imports nil, :requires {string clojure.string, clojure.string clojure.string, gstring goog.string, goog.string goog.string}, :cljs.spec/speced-vars [], :uses nil, :defs {reader-conditional {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/tools/reader/impl/utils.cljs", :line 29, :column 7, :end-line 29, :end-column 25, :arglists (quote ([form splicing?])), :doc "Construct a data representation of a reader conditional.\n If true, splicing? indicates read-cond-splicing."}, :name cljs.tools.reader.impl.utils/reader-conditional, :variadic false, :file "target/cljsbuild/public/js/out/cljs/tools/reader/impl/utils.cljs", :end-column 25, :method-params ([form splicing?]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 29, :end-line 29, :max-fixed-arity 2, :fn-var true, :arglists (quote ([form splicing?])), :doc "Construct a data representation of a reader conditional.\n If true, splicing? indicates read-cond-splicing."}, whitespace? {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/tools/reader/impl/utils.cljs", :line 43, :column 16, :end-line 43, :end-column 27, :tag boolean, :arglists (quote ([ch])), :doc "Checks whether a given character is whitespace"}, :name cljs.tools.reader.impl.utils/whitespace?, :variadic false, :file "target/cljsbuild/public/js/out/cljs/tools/reader/impl/utils.cljs", :end-column 27, :method-params ([ch]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 43, :ret-tag boolean, :end-line 43, :max-fixed-arity 1, :tag boolean, :fn-var true, :arglists (quote ([ch])), :doc "Checks whether a given character is whitespace"}, last-id {:name cljs.tools.reader.impl.utils/last-id, :file "target/cljsbuild/public/js/out/cljs/tools/reader/impl/utils.cljs", :line 73, :column 1, :end-line 73, :end-column 13, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/tools/reader/impl/utils.cljs", :line 73, :column 6, :end-line 73, :end-column 13}, :tag any}, char {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/tools/reader/impl/utils.cljs", :line 15, :column 7, :end-line 15, :end-column 11, :arglists (quote ([x]))}, :name cljs.tools.reader.impl.utils/char, :variadic false, :file "target/cljsbuild/public/js/out/cljs/tools/reader/impl/utils.cljs", :end-column 11, :method-params ([x]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 15, :end-line 15, :max-fixed-arity 1, :fn-var true, :arglists (quote ([x]))}, numeric? {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/tools/reader/impl/utils.cljs", :line 51, :column 16, :end-line 51, :end-column 24, :tag boolean, :arglists (quote ([ch])), :doc "Checks whether a given character is numeric"}, :name cljs.tools.reader.impl.utils/numeric?, :variadic false, :file "target/cljsbuild/public/js/out/cljs/tools/reader/impl/utils.cljs", :end-column 24, :method-params ([ch]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 51, :ret-tag boolean, :end-line 51, :max-fixed-arity 1, :tag boolean, :fn-var true, :arglists (quote ([ch])), :doc "Checks whether a given character is numeric"}, ReaderConditional {:num-fields 2, :protocols #{cljs.core/IRecord cljs.core/IEquiv cljs.core/IHash cljs.core/ICollection cljs.core/ICounted cljs.core/ISeqable cljs.core/IMeta cljs.core/ICloneable cljs.core/IPrintWithWriter cljs.core/IIterable cljs.core/IWithMeta cljs.core/IAssociative cljs.core/IMap cljs.core/ILookup}, :name cljs.tools.reader.impl.utils/ReaderConditional, :file "target/cljsbuild/public/js/out/cljs/tools/reader/impl/utils.cljs", :end-column 29, :type true, :column 12, :internal-ctor true, :line 22, :record true, :end-line 22, :skip-protocol-flag #{cljs.core/IRecord cljs.core/IEquiv cljs.core/IHash cljs.core/ICollection cljs.core/ICounted cljs.core/ISeqable cljs.core/IMeta cljs.core/ICloneable cljs.core/IPrintWithWriter cljs.core/IIterable cljs.core/IWithMeta cljs.core/IAssociative cljs.core/IMap cljs.core/ILookup}}, second' {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/tools/reader/impl/utils.cljs", :line 96, :column 7, :end-line 96, :end-column 14, :arglists (quote ([[a b]]))}, :name cljs.tools.reader.impl.utils/second', :variadic false, :file "target/cljsbuild/public/js/out/cljs/tools/reader/impl/utils.cljs", :end-column 14, :method-params ([p__44193]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 96, :end-line 96, :max-fixed-arity 1, :fn-var true, :arglists (quote ([[a b]]))}, desugar-meta {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/tools/reader/impl/utils.cljs", :line 64, :column 7, :end-line 64, :end-column 19, :arglists (quote ([f])),Line truncated
|
||||
@@ -0,0 +1,356 @@
|
||||
// Compiled by ClojureScript 1.9.946 {}
|
||||
goog.provide('cljs.tools.reader.impl.utils');
|
||||
goog.require('cljs.core');
|
||||
goog.require('clojure.string');
|
||||
goog.require('goog.string');
|
||||
cljs.tools.reader.impl.utils.char$ = (function cljs$tools$reader$impl$utils$char(x){
|
||||
if((x == null)){
|
||||
return null;
|
||||
} else {
|
||||
return cljs.core.char$.call(null,x);
|
||||
}
|
||||
});
|
||||
cljs.tools.reader.impl.utils.ex_info_QMARK_ = (function cljs$tools$reader$impl$utils$ex_info_QMARK_(ex){
|
||||
return (ex instanceof cljs.core.ExceptionInfo);
|
||||
});
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @implements {cljs.core.IRecord}
|
||||
* @implements {cljs.core.IEquiv}
|
||||
* @implements {cljs.core.IHash}
|
||||
* @implements {cljs.core.ICollection}
|
||||
* @implements {cljs.core.ICounted}
|
||||
* @implements {cljs.core.ISeqable}
|
||||
* @implements {cljs.core.IMeta}
|
||||
* @implements {cljs.core.ICloneable}
|
||||
* @implements {cljs.core.IPrintWithWriter}
|
||||
* @implements {cljs.core.IIterable}
|
||||
* @implements {cljs.core.IWithMeta}
|
||||
* @implements {cljs.core.IAssociative}
|
||||
* @implements {cljs.core.IMap}
|
||||
* @implements {cljs.core.ILookup}
|
||||
*/
|
||||
cljs.tools.reader.impl.utils.ReaderConditional = (function (splicing_QMARK_,form,__meta,__extmap,__hash){
|
||||
this.splicing_QMARK_ = splicing_QMARK_;
|
||||
this.form = form;
|
||||
this.__meta = __meta;
|
||||
this.__extmap = __extmap;
|
||||
this.__hash = __hash;
|
||||
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
|
||||
this.cljs$lang$protocol_mask$partition1$ = 139264;
|
||||
});
|
||||
cljs.tools.reader.impl.utils.ReaderConditional.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__36186__auto__,k__36187__auto__){
|
||||
var self__ = this;
|
||||
var this__36186__auto____$1 = this;
|
||||
return this__36186__auto____$1.cljs$core$ILookup$_lookup$arity$3(null,k__36187__auto__,null);
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.utils.ReaderConditional.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__36188__auto__,k44173,else__36189__auto__){
|
||||
var self__ = this;
|
||||
var this__36188__auto____$1 = this;
|
||||
var G__44177 = k44173;
|
||||
var G__44177__$1 = (((G__44177 instanceof cljs.core.Keyword))?G__44177.fqn:null);
|
||||
switch (G__44177__$1) {
|
||||
case "splicing?":
|
||||
return self__.splicing_QMARK_;
|
||||
|
||||
break;
|
||||
case "form":
|
||||
return self__.form;
|
||||
|
||||
break;
|
||||
default:
|
||||
return cljs.core.get.call(null,self__.__extmap,k44173,else__36189__auto__);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.utils.ReaderConditional.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__36200__auto__,writer__36201__auto__,opts__36202__auto__){
|
||||
var self__ = this;
|
||||
var this__36200__auto____$1 = this;
|
||||
var pr_pair__36203__auto__ = ((function (this__36200__auto____$1){
|
||||
return (function (keyval__36204__auto__){
|
||||
return cljs.core.pr_sequential_writer.call(null,writer__36201__auto__,cljs.core.pr_writer,""," ","",opts__36202__auto__,keyval__36204__auto__);
|
||||
});})(this__36200__auto____$1))
|
||||
;
|
||||
return cljs.core.pr_sequential_writer.call(null,writer__36201__auto__,pr_pair__36203__auto__,"#cljs.tools.reader.impl.utils.ReaderConditional{",", ","}",opts__36202__auto__,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"splicing?","splicing?",-428596366),self__.splicing_QMARK_],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"form","form",-1624062471),self__.form],null))], null),self__.__extmap));
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.utils.ReaderConditional.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__44172){
|
||||
var self__ = this;
|
||||
var G__44172__$1 = this;
|
||||
return (new cljs.core.RecordIter((0),G__44172__$1,2,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"splicing?","splicing?",-428596366),new cljs.core.Keyword(null,"form","form",-1624062471)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.utils.ReaderConditional.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__36184__auto__){
|
||||
var self__ = this;
|
||||
var this__36184__auto____$1 = this;
|
||||
return self__.__meta;
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.utils.ReaderConditional.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__36181__auto__){
|
||||
var self__ = this;
|
||||
var this__36181__auto____$1 = this;
|
||||
return (new cljs.tools.reader.impl.utils.ReaderConditional(self__.splicing_QMARK_,self__.form,self__.__meta,self__.__extmap,self__.__hash));
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.utils.ReaderConditional.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__36190__auto__){
|
||||
var self__ = this;
|
||||
var this__36190__auto____$1 = this;
|
||||
return (2 + cljs.core.count.call(null,self__.__extmap));
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.utils.ReaderConditional.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__36182__auto__){
|
||||
var self__ = this;
|
||||
var this__36182__auto____$1 = this;
|
||||
var h__35954__auto__ = self__.__hash;
|
||||
if(!((h__35954__auto__ == null))){
|
||||
return h__35954__auto__;
|
||||
} else {
|
||||
var h__35954__auto____$1 = ((function (h__35954__auto__,this__36182__auto____$1){
|
||||
return (function (coll__36183__auto__){
|
||||
return (-209062840 ^ cljs.core.hash_unordered_coll.call(null,coll__36183__auto__));
|
||||
});})(h__35954__auto__,this__36182__auto____$1))
|
||||
.call(null,this__36182__auto____$1);
|
||||
self__.__hash = h__35954__auto____$1;
|
||||
|
||||
return h__35954__auto____$1;
|
||||
}
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.utils.ReaderConditional.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this44174,other44175){
|
||||
var self__ = this;
|
||||
var this44174__$1 = this;
|
||||
return (!((other44175 == null))) && ((this44174__$1.constructor === other44175.constructor)) && (cljs.core._EQ_.call(null,this44174__$1.splicing_QMARK_,other44175.splicing_QMARK_)) && (cljs.core._EQ_.call(null,this44174__$1.form,other44175.form)) && (cljs.core._EQ_.call(null,this44174__$1.__extmap,other44175.__extmap));
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.utils.ReaderConditional.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__36195__auto__,k__36196__auto__){
|
||||
var self__ = this;
|
||||
var this__36195__auto____$1 = this;
|
||||
if(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"splicing?","splicing?",-428596366),null,new cljs.core.Keyword(null,"form","form",-1624062471),null], null), null),k__36196__auto__)){
|
||||
return cljs.core.dissoc.call(null,cljs.core._with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__36195__auto____$1),self__.__meta),k__36196__auto__);
|
||||
} else {
|
||||
return (new cljs.tools.reader.impl.utils.ReaderConditional(self__.splicing_QMARK_,self__.form,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__36196__auto__)),null));
|
||||
}
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.utils.ReaderConditional.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__36193__auto__,k__36194__auto__,G__44172){
|
||||
var self__ = this;
|
||||
var this__36193__auto____$1 = this;
|
||||
var pred__44178 = cljs.core.keyword_identical_QMARK_;
|
||||
var expr__44179 = k__36194__auto__;
|
||||
if(cljs.core.truth_(pred__44178.call(null,new cljs.core.Keyword(null,"splicing?","splicing?",-428596366),expr__44179))){
|
||||
return (new cljs.tools.reader.impl.utils.ReaderConditional(G__44172,self__.form,self__.__meta,self__.__extmap,null));
|
||||
} else {
|
||||
if(cljs.core.truth_(pred__44178.call(null,new cljs.core.Keyword(null,"form","form",-1624062471),expr__44179))){
|
||||
return (new cljs.tools.reader.impl.utils.ReaderConditional(self__.splicing_QMARK_,G__44172,self__.__meta,self__.__extmap,null));
|
||||
} else {
|
||||
return (new cljs.tools.reader.impl.utils.ReaderConditional(self__.splicing_QMARK_,self__.form,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__36194__auto__,G__44172),null));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.utils.ReaderConditional.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__36198__auto__){
|
||||
var self__ = this;
|
||||
var this__36198__auto____$1 = this;
|
||||
return cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"splicing?","splicing?",-428596366),self__.splicing_QMARK_],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"form","form",-1624062471),self__.form],null))], null),self__.__extmap));
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.utils.ReaderConditional.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__36185__auto__,G__44172){
|
||||
var self__ = this;
|
||||
var this__36185__auto____$1 = this;
|
||||
return (new cljs.tools.reader.impl.utils.ReaderConditional(self__.splicing_QMARK_,self__.form,G__44172,self__.__extmap,self__.__hash));
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.utils.ReaderConditional.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__36191__auto__,entry__36192__auto__){
|
||||
var self__ = this;
|
||||
var this__36191__auto____$1 = this;
|
||||
if(cljs.core.vector_QMARK_.call(null,entry__36192__auto__)){
|
||||
return this__36191__auto____$1.cljs$core$IAssociative$_assoc$arity$3(null,cljs.core._nth.call(null,entry__36192__auto__,(0)),cljs.core._nth.call(null,entry__36192__auto__,(1)));
|
||||
} else {
|
||||
return cljs.core.reduce.call(null,cljs.core._conj,this__36191__auto____$1,entry__36192__auto__);
|
||||
}
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.utils.ReaderConditional.getBasis = (function (){
|
||||
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"splicing?","splicing?",1211935161,null),new cljs.core.Symbol(null,"form","form",16469056,null)], null);
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.utils.ReaderConditional.cljs$lang$type = true;
|
||||
|
||||
cljs.tools.reader.impl.utils.ReaderConditional.cljs$lang$ctorPrSeq = (function (this__36224__auto__){
|
||||
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"cljs.tools.reader.impl.utils/ReaderConditional");
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.utils.ReaderConditional.cljs$lang$ctorPrWriter = (function (this__36224__auto__,writer__36225__auto__){
|
||||
return cljs.core._write.call(null,writer__36225__auto__,"cljs.tools.reader.impl.utils/ReaderConditional");
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.utils.__GT_ReaderConditional = (function cljs$tools$reader$impl$utils$__GT_ReaderConditional(splicing_QMARK_,form){
|
||||
return (new cljs.tools.reader.impl.utils.ReaderConditional(splicing_QMARK_,form,null,null,null));
|
||||
});
|
||||
|
||||
cljs.tools.reader.impl.utils.map__GT_ReaderConditional = (function cljs$tools$reader$impl$utils$map__GT_ReaderConditional(G__44176){
|
||||
return (new cljs.tools.reader.impl.utils.ReaderConditional(new cljs.core.Keyword(null,"splicing?","splicing?",-428596366).cljs$core$IFn$_invoke$arity$1(G__44176),new cljs.core.Keyword(null,"form","form",-1624062471).cljs$core$IFn$_invoke$arity$1(G__44176),null,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,G__44176,new cljs.core.Keyword(null,"splicing?","splicing?",-428596366),new cljs.core.Keyword(null,"form","form",-1624062471))),null));
|
||||
});
|
||||
|
||||
/**
|
||||
* Return true if the value is the data representation of a reader conditional
|
||||
*/
|
||||
cljs.tools.reader.impl.utils.reader_conditional_QMARK_ = (function cljs$tools$reader$impl$utils$reader_conditional_QMARK_(value){
|
||||
return (value instanceof cljs.tools.reader.impl.utils.ReaderConditional);
|
||||
});
|
||||
/**
|
||||
* Construct a data representation of a reader conditional.
|
||||
* If true, splicing? indicates read-cond-splicing.
|
||||
*/
|
||||
cljs.tools.reader.impl.utils.reader_conditional = (function cljs$tools$reader$impl$utils$reader_conditional(form,splicing_QMARK_){
|
||||
return (new cljs.tools.reader.impl.utils.ReaderConditional(splicing_QMARK_,form,null,null,null));
|
||||
});
|
||||
cljs.tools.reader.impl.utils.ReaderConditional.prototype.cljs$core$IPrintWithWriter$ = cljs.core.PROTOCOL_SENTINEL;
|
||||
|
||||
cljs.tools.reader.impl.utils.ReaderConditional.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (coll,writer,opts){
|
||||
var coll__$1 = this;
|
||||
cljs.core._write.call(null,writer,["#?",cljs.core.str.cljs$core$IFn$_invoke$arity$1((cljs.core.truth_(new cljs.core.Keyword(null,"splicing?","splicing?",-428596366).cljs$core$IFn$_invoke$arity$1(coll__$1))?"@":null))].join(''));
|
||||
|
||||
return cljs.core.pr_writer.call(null,new cljs.core.Keyword(null,"form","form",-1624062471).cljs$core$IFn$_invoke$arity$1(coll__$1),writer,opts);
|
||||
});
|
||||
cljs.tools.reader.impl.utils.ws_rx = /[\s]/;
|
||||
/**
|
||||
* Checks whether a given character is whitespace
|
||||
*/
|
||||
cljs.tools.reader.impl.utils.whitespace_QMARK_ = (function cljs$tools$reader$impl$utils$whitespace_QMARK_(ch){
|
||||
if((ch == null)){
|
||||
return null;
|
||||
} else {
|
||||
if((ch === ",")){
|
||||
return true;
|
||||
} else {
|
||||
return cljs.tools.reader.impl.utils.ws_rx.test(ch);
|
||||
}
|
||||
}
|
||||
});
|
||||
/**
|
||||
* Checks whether a given character is numeric
|
||||
*/
|
||||
cljs.tools.reader.impl.utils.numeric_QMARK_ = (function cljs$tools$reader$impl$utils$numeric_QMARK_(ch){
|
||||
if((ch == null)){
|
||||
return null;
|
||||
} else {
|
||||
return goog.string.isNumeric(ch);
|
||||
}
|
||||
});
|
||||
/**
|
||||
* Checks whether the character is a newline
|
||||
*/
|
||||
cljs.tools.reader.impl.utils.newline_QMARK_ = (function cljs$tools$reader$impl$utils$newline_QMARK_(c){
|
||||
return (("\n" === c)) || (("\n" === c)) || ((c == null));
|
||||
});
|
||||
/**
|
||||
* Resolves syntactical sugar in metadata
|
||||
*/
|
||||
cljs.tools.reader.impl.utils.desugar_meta = (function cljs$tools$reader$impl$utils$desugar_meta(f){
|
||||
if((f instanceof cljs.core.Keyword)){
|
||||
return cljs.core.PersistentArrayMap.createAsIfByAssoc([f,true]);
|
||||
} else {
|
||||
if((f instanceof cljs.core.Symbol)){
|
||||
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"tag","tag",-1290361223),f], null);
|
||||
} else {
|
||||
if(typeof f === 'string'){
|
||||
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"tag","tag",-1290361223),f], null);
|
||||
} else {
|
||||
return f;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
cljs.tools.reader.impl.utils.last_id = cljs.core.atom.call(null,(0));
|
||||
cljs.tools.reader.impl.utils.next_id = (function cljs$tools$reader$impl$utils$next_id(){
|
||||
return cljs.core.swap_BANG_.call(null,cljs.tools.reader.impl.utils.last_id,cljs.core.inc);
|
||||
});
|
||||
cljs.tools.reader.impl.utils.namespace_keys = (function cljs$tools$reader$impl$utils$namespace_keys(ns,keys){
|
||||
var iter__36380__auto__ = (function cljs$tools$reader$impl$utils$namespace_keys_$_iter__44182(s__44183){
|
||||
return (new cljs.core.LazySeq(null,(function (){
|
||||
var s__44183__$1 = s__44183;
|
||||
while(true){
|
||||
var temp__5457__auto__ = cljs.core.seq.call(null,s__44183__$1);
|
||||
if(temp__5457__auto__){
|
||||
var s__44183__$2 = temp__5457__auto__;
|
||||
if(cljs.core.chunked_seq_QMARK_.call(null,s__44183__$2)){
|
||||
var c__36378__auto__ = cljs.core.chunk_first.call(null,s__44183__$2);
|
||||
var size__36379__auto__ = cljs.core.count.call(null,c__36378__auto__);
|
||||
var b__44185 = cljs.core.chunk_buffer.call(null,size__36379__auto__);
|
||||
if((function (){var i__44184 = (0);
|
||||
while(true){
|
||||
if((i__44184 < size__36379__auto__)){
|
||||
var key = cljs.core._nth.call(null,c__36378__auto__,i__44184);
|
||||
cljs.core.chunk_append.call(null,b__44185,((((key instanceof cljs.core.Symbol)) || ((key instanceof cljs.core.Keyword)))?(function (){var vec__44186 = cljs.core.juxt.call(null,cljs.core.namespace,cljs.core.name).call(null,key);
|
||||
var key_ns = cljs.core.nth.call(null,vec__44186,(0),null);
|
||||
var key_name = cljs.core.nth.call(null,vec__44186,(1),null);
|
||||
var __GT_key = (((key instanceof cljs.core.Symbol))?cljs.core.symbol:cljs.core.keyword);
|
||||
if((key_ns == null)){
|
||||
return __GT_key.call(null,ns,key_name);
|
||||
} else {
|
||||
if(cljs.core._EQ_.call(null,"_",key_ns)){
|
||||
return __GT_key.call(null,key_name);
|
||||
} else {
|
||||
return key;
|
||||
|
||||
}
|
||||
}
|
||||
})():key));
|
||||
|
||||
var G__44192 = (i__44184 + (1));
|
||||
i__44184 = G__44192;
|
||||
continue;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
})()){
|
||||
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__44185),cljs$tools$reader$impl$utils$namespace_keys_$_iter__44182.call(null,cljs.core.chunk_rest.call(null,s__44183__$2)));
|
||||
} else {
|
||||
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__44185),null);
|
||||
}
|
||||
} else {
|
||||
var key = cljs.core.first.call(null,s__44183__$2);
|
||||
return cljs.core.cons.call(null,((((key instanceof cljs.core.Symbol)) || ((key instanceof cljs.core.Keyword)))?(function (){var vec__44189 = cljs.core.juxt.call(null,cljs.core.namespace,cljs.core.name).call(null,key);
|
||||
var key_ns = cljs.core.nth.call(null,vec__44189,(0),null);
|
||||
var key_name = cljs.core.nth.call(null,vec__44189,(1),null);
|
||||
var __GT_key = (((key instanceof cljs.core.Symbol))?cljs.core.symbol:cljs.core.keyword);
|
||||
if((key_ns == null)){
|
||||
return __GT_key.call(null,ns,key_name);
|
||||
} else {
|
||||
if(cljs.core._EQ_.call(null,"_",key_ns)){
|
||||
return __GT_key.call(null,key_name);
|
||||
} else {
|
||||
return key;
|
||||
|
||||
}
|
||||
}
|
||||
})():key),cljs$tools$reader$impl$utils$namespace_keys_$_iter__44182.call(null,cljs.core.rest.call(null,s__44183__$2)));
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}),null,null));
|
||||
});
|
||||
return iter__36380__auto__.call(null,keys);
|
||||
});
|
||||
cljs.tools.reader.impl.utils.second_SINGLEQUOTE_ = (function cljs$tools$reader$impl$utils$second_SINGLEQUOTE_(p__44193){
|
||||
var vec__44194 = p__44193;
|
||||
var a = cljs.core.nth.call(null,vec__44194,(0),null);
|
||||
var b = cljs.core.nth.call(null,vec__44194,(1),null);
|
||||
if(cljs.core.truth_(a)){
|
||||
return null;
|
||||
} else {
|
||||
return b;
|
||||
}
|
||||
});
|
||||
|
||||
//# sourceMappingURL=utils.js.map?rel=1517021946268
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"\/home\/didier\/clojupyter\/website\/target\/cljsbuild\/public\/js\/out\/cljs\/tools\/reader\/impl\/utils.js","sources":["utils.cljs?rel=1517021946269"],"lineCount":356,"mappings":";AAQA;;;;AAMA,qCAAA,rCAAMA,iFAAMC;AAAZ,AACE,GAAU,MAAA,LAAMA;AAAhB;;AAAA,AACE,OAACC,0BAAeD;;;AAEpB,8CAAA,9CAAeE,oGAAUC;AAAzB,AACE,sBAAWC,dAAwBD;;AAErC,AAAA,AAAA,AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,AAAA,AAAA,AAAA,6FAAA,WAAAE,oBAAAC,5HAAW0D;;AAAX,AAAA,IAAA3D,0BAAA;AAAA,AAAA,OAAAA,+DAAAC,iBAAA;;;AAAA,AAAA,AAAA,6FAAA,WAAAC,oBAAAC,OAAAC,nIAAWuD;;AAAX,AAAA,IAAAzD,0BAAA;AAAA,AAAA,IAAAG,WAAAF;IAAAE,eAAA,EAAA,CAAAA,oBAAAC,oBAAA,AAAAD,aAAA;AAAA,AAAA,QAAAA;KAAA;AAAAE;;;KAAA;AAAAC;;;;AAAA,OAAAC,wBAAAC,gBAAAP,OAAAC;;;;;AAAA,AAAA,AAAA,yGAAA,WAAAO,oBAAAC,sBAAAC,9JAAW8C;;AAAX,AAAA,IAAAhD,0BAAA;AAAA,AAAA,IAAAG,yBAAA;kBAAAC;AAAA,AAAA,OAAAC,yCAAAJ,sBAAAK,oBAAA,GAAA,IAAA,GAAAJ,oBAAAE;;;AAAA,AAAA,OAAAC,yCAAAJ,sBAAAE,uBAAA,mDAAA,KAAA,IAAAD,oBAAA,AAAAK,2BAAA,mFAAA,KAAAC,2BAAA,KAAA,EAAA,IAAA,AAAAA,sCAAA,CAAA,+DAAAZ,wBAAA,OAAA,KAAAY,2BAAA,KAAA,EAAA,IAAA,AAAAA,sCAAA,CAAA,sDAAAX,aAAA,eAAAE;;;AAAA,AAAA,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