diff --git a/autotests/folding/clojure.clj.fold b/autotests/folding/clojure.clj.fold index 967e605..b2f3768 100644 --- a/autotests/folding/clojure.clj.fold +++ b/autotests/folding/clojure.clj.fold @@ -1,71 +1,73 @@ ; Test file, released under MIT License (ns ^{:doc "Syntax highlighting test file" :author "Markus Brenneis"} highlighting) (defn something-else [f xs] #_(map #(apply f (% [%])) (cons 1 xs)) (map #(apply f (% xs)) (cons 1 xs)) #_[1 '(2)] xs) (def foo [\a \b \n \ucafe \o123 \n \newline \tab \space \formfeed \backspace]) (def fizz {#{\a \b} #{\n \newline}}) (def fizz' #{{\a \b} {\n \newline}}) (defn bar [xs] (as-> xs <> (cons :a <>) (map #(%1 %2) <>) ; TODO improve (into <> [:konjure.logic.specs/numShips]))) (def x-2-y #_"do \" sth" (domonad set-m [x #{1.1, (+ -2 +4)} y #{1.1, (- -2.0 4.0)}] (*' x y))) (def bases (and (= -1 -1N) (= 1/4 -2.5e-1) (= -1/2 -0.5M) (= -0x1Ab -0X1ab) (= +2r101010 25R1h) (= 39r13 42R10))) ; FIXME this one is not correct (def ^{:private true} (= (last #{#{}}) #{{#{}}})) (def s "#repl\n") (def r #"repl") (defn- stuff! [a] "This is no \"documentation\"!" (= (class #'+) (class #'foo)) (let [+ -] [(+ a 1) (@#'+ a 1)])) (defn- throwIllegalArgumentException! "Throws an \"IllegalArgumentException\" or a js/Error." [message] #?(:clj (throw (IllegalArgumentException. message)) :cljs (throw (js/Error. message)))) (defmacro let-fn "a nonsense macro" [one-binding & body] `(+ 1 ~(inc' 1)) (let [[identifier & fn-body] one-binding] `(let [~identifier (fn ~identifier ~@fn-body)] ~@body `a#))) (def state (atom [(= false true) nil])) (defn something-cool [] (first @state)) (defn- something-different [] (first (into @state [12]))) + +(defn- instance-getfield [this k] (@(.state this) k)) diff --git a/autotests/html/clojure.clj.html b/autotests/html/clojure.clj.html index 490c429..b715b57 100644 --- a/autotests/html/clojure.clj.html +++ b/autotests/html/clojure.clj.html @@ -1,78 +1,80 @@ clojure.clj
 ; Test file, released under MIT License
 (ns ^{:doc "Syntax highlighting test file"
       :author "Markus Brenneis"}
     highlighting)
 
 (defn something-else [f xs]
   #_(map #(apply f (% [%])) (cons 1 xs))
   (map #(apply f (% xs)) (cons 1 xs))
   #_[1 '(2)]
   xs)
 
 (def foo [\a \b \n \ucafe \o123 \n
           \newline \tab \space \formfeed \backspace])
 
 (def fizz {#{\a \b}
            #{\n \newline}})
 
 (def fizz' #{{\a \b}
              {\n \newline}})
 
 (defn bar [xs]
   (as-> xs <>
         (cons :a <>)
         (map #(%1 %2) <>) ; TODO improve
         (into <> [:konjure.logic.specs/numShips])))
 
 (def x-2-y
   #_"do \" sth"
   (domonad set-m
     [x #{1.1, (+ -2 +4)}
      y #{1.1, (- -2.0 4.0)}]
     (*' x y)))
 
 (def bases
   (and (= -1 -1N)
        (= 1/4 -2.5e-1)
        (= -1/2 -0.5M)
        (= -0x1Ab -0X1ab)
        (= +2r101010 25R1h)
        (= 39r13 42R10))) ; FIXME this one is not correct
 
 (def ^{:private true}
   (= (last #{#{}}) #{{#{}}}))
 
 (def s "#repl\n")
 (def r #"repl")
 
 (defn- stuff!
   [a]
   "This is no \"documentation\"!"
   (= (class #'+) (class #'foo))
   (let [+ -] [(+ a 1) (@#'+ a 1)]))
 
 (defn- throwIllegalArgumentException!
   "Throws an \"IllegalArgumentException\" or
   a js/Error."
   [message]
   #?(:clj  (throw (IllegalArgumentException. message))
      :cljs (throw (js/Error. message))))
 
 (defmacro let-fn "a nonsense macro" [one-binding & body]
   `(+ 1 ~(inc' 1))
   (let [[identifier & fn-body] one-binding]
     `(let [~identifier (fn ~identifier ~@fn-body)]
       ~@body `a#)))
 
 (def state (atom [(= false true) nil]))
 
 (defn something-cool [] (first @state))
 
 (defn- something-different [] (first (into @state [12])))
+
+(defn- instance-getfield [this k] (@(.state this) k))
 
diff --git a/autotests/input/clojure.clj b/autotests/input/clojure.clj index 967e605..b2f3768 100644 --- a/autotests/input/clojure.clj +++ b/autotests/input/clojure.clj @@ -1,71 +1,73 @@ ; Test file, released under MIT License (ns ^{:doc "Syntax highlighting test file" :author "Markus Brenneis"} highlighting) (defn something-else [f xs] #_(map #(apply f (% [%])) (cons 1 xs)) (map #(apply f (% xs)) (cons 1 xs)) #_[1 '(2)] xs) (def foo [\a \b \n \ucafe \o123 \n \newline \tab \space \formfeed \backspace]) (def fizz {#{\a \b} #{\n \newline}}) (def fizz' #{{\a \b} {\n \newline}}) (defn bar [xs] (as-> xs <> (cons :a <>) (map #(%1 %2) <>) ; TODO improve (into <> [:konjure.logic.specs/numShips]))) (def x-2-y #_"do \" sth" (domonad set-m [x #{1.1, (+ -2 +4)} y #{1.1, (- -2.0 4.0)}] (*' x y))) (def bases (and (= -1 -1N) (= 1/4 -2.5e-1) (= -1/2 -0.5M) (= -0x1Ab -0X1ab) (= +2r101010 25R1h) (= 39r13 42R10))) ; FIXME this one is not correct (def ^{:private true} (= (last #{#{}}) #{{#{}}})) (def s "#repl\n") (def r #"repl") (defn- stuff! [a] "This is no \"documentation\"!" (= (class #'+) (class #'foo)) (let [+ -] [(+ a 1) (@#'+ a 1)])) (defn- throwIllegalArgumentException! "Throws an \"IllegalArgumentException\" or a js/Error." [message] #?(:clj (throw (IllegalArgumentException. message)) :cljs (throw (js/Error. message)))) (defmacro let-fn "a nonsense macro" [one-binding & body] `(+ 1 ~(inc' 1)) (let [[identifier & fn-body] one-binding] `(let [~identifier (fn ~identifier ~@fn-body)] ~@body `a#))) (def state (atom [(= false true) nil])) (defn something-cool [] (first @state)) (defn- something-different [] (first (into @state [12]))) + +(defn- instance-getfield [this k] (@(.state this) k)) diff --git a/autotests/reference/clojure.clj.ref b/autotests/reference/clojure.clj.ref index afe81bd..16ba386 100644 --- a/autotests/reference/clojure.clj.ref +++ b/autotests/reference/clojure.clj.ref @@ -1,71 +1,73 @@ ; Test file, released under MIT License
(ns ^{:doc "Syntax highlighting test file"
:author "Markus Brenneis"}
highlighting)

(defn something-else [f xs]
#_(map #(apply f (% [%])) (cons 1 xs))
(map #(apply f (% xs)) (cons 1 xs))
#_[1 '(2)]
xs)

(def foo [\a \b \n \ucafe \o123 \n
\newline \tab \space \formfeed \backspace])

(def fizz {#{\a \b}
#{\n \newline}})

(def fizz' #{{\a \b}
{\n \newline}})

(defn bar [xs]
(as-> xs <>
(cons :a <>)
(map #(%1 %2) <>) ; TODO improve
(into <> [:konjure.logic.specs/numShips])))

(def x-2-y
#_"do \" sth"
(domonad set-m
[x #{1.1, (+ -2 +4)}
y #{1.1, (- -2.0 4.0)}]
(*' x y)))

(def bases
(and (= -1 -1N)
(= 1/4 -2.5e-1)
(= -1/2 -0.5M)
(= -0x1Ab -0X1ab)
(= +2r101010 25R1h)
(= 39r13 42R10))) ; FIXME this one is not correct

(def ^{:private true}
(= (last #{#{}}) #{{#{}}}))

(def s "#repl\n")
(def r #"repl")

(defn- stuff!
[a]
"This is no \"documentation\"!"
(= (class #'+) (class #'foo))
(let [+ -] [(+ a 1) (@#'+ a 1)]))

(defn- throwIllegalArgumentException!
"Throws an \"IllegalArgumentException\" or
a js/Error."
[message]
#?(:clj (throw (IllegalArgumentException. message))
:cljs (throw (js/Error. message))))

(defmacro let-fn "a nonsense macro" [one-binding & body]
`(+ 1 ~(inc' 1))
(let [[identifier & fn-body] one-binding]
`(let [~identifier (fn ~identifier ~@fn-body)]
~@body `a#)))

(def state (atom [(= false true) nil]))

(defn something-cool [] (first @state))

(defn- something-different [] (first (into @state [12])))
+
+(defn- instance-getfield [this k] (@(.state this) k))
diff --git a/data/syntax/clojure.xml b/data/syntax/clojure.xml index 246ef66..b0fd4aa 100644 --- a/data/syntax/clojure.xml +++ b/data/syntax/clojure.xml @@ -1,876 +1,883 @@ - + def def- defalias defhinted definline defmethod defmulti defnk defn-memo defonce defonce- defprotocol defrecord defstruct defstruct- deftest deftest- deftype defunbound defunbound- defvar defvar- defn defn- defmacro defmacro- < <= = == > >= - -' -> ->> / . .. * *' + +' accessor aclone add-classpath add-watch agent agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and append-child apply apply-template are areduce array-map as-> aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assert-any assert-expr assert-predicate assoc assoc! associative? assoc-in atom atom? attrs await await1 await-for bases bean bigdec bigint binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* branch? butlast byte byte-array bytes case cast catch char char? char-array char-escape-string char-name-string chars children chunk chunk-append chunk-buffer chunk-cons chunked-seq? chunk-first chunk-next chunk-rest class class? clear-agent-errors clojure-version coll? collection-tag comment commute comp comparator compare compare-and-set! compile complement compose-fixtures concat cond condp conj conj! cons constantly construct-proxy contains? content content-handler count counted? create-ns create-struct cycle dec dec' decimal? declare delay delay? deliver deref derive descendants destructure difference disj disj! dissoc dissoc! distinct distinct? do doall doc dorun doseq dosync do-template dotimes doto double double-array doubles down drop drop-last drop-while e edit element emit emit-element empty empty? end? ensure enumeration-seq eval even? every? extend extenders extend-protocol extends? extend-type false? ffirst file-position file-seq filter filterv finally find find-doc find-ns find-var first float float? float-array floats flush fn fn? fnext fnil for force format frequencies function? future future? future-call future-cancel future-cancelled? future-done? gen-and-load-class gen-and-save-class gen-class gen-interface gensym get get-child get-child-count get-in get-method get-possibly-unbound-var get-proxy-class get-thread-bindings get-validator group-by handle handler-case hash hash-map hash-set identical? identity if if-let ifn? if-not import inc inc' inc-report-counter index init-proxy in-ns insert-child insert-left insert-right inspect inspect-table inspect-tree instance? int int-array integer? interleave intern interpose intersection into into-array ints io! is isa? is-leaf iterate iterator-seq join join-fixtures juxt key keys keyword keyword? keywordize-keys last lazy-cat lazy-seq left leftmost lefts let letfn line-seq list list* list? list-model list-provider load loaded-libs load-file load-reader load-script load-string locking long long-array longs loop macroexpand macroexpand-1 macroexpand-all main make-array make-hierarchy make-node map map? mapcat mapv map-invert max max-key memfn memoize merge merge-with meta methods method-sig min min-key mod name namespace neg? newline next nfirst nil? nnext node not not= not-any? not-empty not-every? ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext num number? odd? or parents partial partition path pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? postwalk postwalk-demo postwalk-replace pr prefer-method prefers prev prewalk prewalk-demo prewalk-replace primitives-classnames print print-cause-trace print-ctor print-doc print-dup printf println println-str print-method print-namespace-doc print-simple print-special-doc print-stack-trace print-str print-throwable print-trace-element prn prn-str project promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super pr-str push-thread-bindings pvalues quot rand rand-int rand-nth range ratio? rational? rationalize read read-line read-string recur reduce ref refer refer-clojure ref-history-count re-find ref-max-history ref-min-history ref-set re-groups reify release-pending-sends rem re-matcher re-matches remove remove-method remove-ns remove-watch rename rename-keys re-pattern repeat repeatedly repl replace repl-caught repl-exception replicate repl-prompt repl-read report require re-seq reset! reset-meta! resolve rest resultset-seq reverse reversible? right rightmost rights root rseq rsubseq run-all-tests run-tests satisfies? second select select-keys send send-off seq seq? seque sequence sequential? seq-zip set set? set-test set-validator! short short-array shorts shutdown-agents skip-if-eol skip-whitespace slurp some sort sort-by sorted? sorted-map sorted-map-by sorted-set sorted-set-by special-form-anchor special-symbol? split-at split-with str stream? string? stringify-keys struct struct-map subs subseq subvec successful? supers swap! symbol symbol? sync syntax-symbol-anchor take take-last take-nth take-while test test-all-vars testing testing-contexts-str testing-vars-str test-ns test-var the-ns throw time to-array to-array-2d trampoline transient tree-seq true? try try-expr type unchecked-add unchecked-dec unchecked-divide unchecked-inc unchecked-multiply unchecked-negate unchecked-remainder unchecked-subtract underive unimport union unquote unquote-splicing up update update-in update-proxy use use-fixtures val vals var? var-get var-set vary-meta vec vector vector? vector-of walk when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision with-test with-test-out xml-seq zero? zipmap *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* *compile-path* *current* *e *err* *file* *flush-on-newline* *in* *initial-report-counters* *load-tests* *macro-meta* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *report-counters* *sb* *source-path* *stack* *stack-trace-depth* *state* *testing-contexts* *testing-vars* *test-out* *use-context-classloader* *warn-on-reflection* *warn-on-reflection* false nil true + + + + + + +