[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/clojure-ts-mode faae888096 07/71: Add test file
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/clojure-ts-mode faae888096 07/71: Add test file |
Date: |
Fri, 25 Aug 2023 03:59:23 -0400 (EDT) |
branch: elpa/clojure-ts-mode
commit faae8880964744e80638e4784b2a5442d890aac6
Author: dannyfreeman <danny@dfreeman.email>
Commit: dannyfreeman <danny@dfreeman.email>
Add test file
---
test.clj | 290 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 290 insertions(+)
diff --git a/test.clj b/test.clj
new file mode 100644
index 0000000000..a5d58ee0b1
--- /dev/null
+++ b/test.clj
@@ -0,0 +1,290 @@
+;;; font locking
+(ns clojure-mode.demo
+ (:require
+ [oneword]
+ [seg.mnt]
+ [mxdCase]
+ [CmlCase]
+ [ve/yCom|pLex.stu-ff]))
+
+(defn foo [x] x)
+;; try to byte-recompile the clojure-mode.el when the face of 'fn' is 't'
+(fn foo [x] x)
+
+(fn ^:m hello [x] @x)
+
+(def ^Boolean x true)
+
+(clojure.core/defmacro my-mac []
+ `(let [x 1]
+ ~x
+ ~@x))
+
+;; the myfn sexp should have a comment face
+(mysfn 101
+ foo
+
+ 0 0i)
+
+;; examples of valid namespace definitions
+(comment
+ (ns .validns)
+ (ns =validns)
+ (ns .ValidNs=<>?+|?*.)
+ (ns ValidNs<>?+|?*.b*ar.ba*z)
+ (ns other.valid.ns)
+ (ns oneword)
+ (ns one.X)
+ (ns foo.bar)
+ (ns Foo.bar)
+ (ns Foo.Bar)
+ (ns foo.Bar)
+ (ns Foo-bar)
+ (ns Foo-Bar)
+ (ns foo-Bar))
+
+(comment ;; for indentation
+ 'some/symbol
+
+ (with-hi heya
+ somebuddy)
+
+ (deftoggle cap
+ gabba)
+
+ (couch/with-db hi
+ your-db)
+
+ (clo/defguppy gurgle
+ minnow))
+
+;; character literals
+[\a \newline \u0032 \/ \+ \,, \; \( \% \)]
+
+;; TODO change font-face for sexps starting with @,#
+(comment ;; examples
+
+ SCREAMING_UPPER_CASE
+ ve/yCom|pLex.stu-ff/.SCREAMING_UPPER_CASE
+
+ ^oneword
+ @oneword
+ #oneword
+ #^oneword ;; type-hint
+ .oneword
+ (oneword)
+ (oneword/oneword)
+ (oneword/seg.mnt)
+ (oneword/CmlCase)
+ (oneword/mxdCase)
+ (oneword/ve/yCom|pLex.stu-ff)
+ (oneword/.ve/yCom|pLex.stu-ff)
+
+ seg.mnt
+ @seg.mnt
+ #seg.mnt
+ #^seg.mnt ;; type-hint
+ .seg.mnt
+ (seg.mnt)
+ (seg.mnt/oneword)
+ (seg.mnt/seg.mnt)
+ (seg.mnt/CmlCase)
+ (seg.mnt/mxdCase)
+ (seg.mnt/ve/yCom|pLex.stu-ff)
+ (seg.mnt/.ve/yCom|pLex.stu-ff)
+
+ CmlCase
+ @CmlCase
+ #CmlCase
+ #^CmlCase ;; type-hint
+ .CmlCase
+ (CmlCase)
+ (CmlCase/oneword)
+ (CmlCase/seg.mnt)
+ (CmlCase/CmlCase)
+ (CmlCase/mxdCase)
+ (CmlCase/ve/yCom|pLex.stu-ff)
+ (CmlCase/.ve/yCom|pLex.stu-ff)
+
+ mxdCase
+ @mxdCase
+ #mxdCase
+ #^mxdCase ;; type-hint
+ .mxdCase
+ (mxdCase)
+ (mxdCase/oneword)
+ (mxdCase/seg.mnt)
+ (mxdCase/CmlCase)
+ (mxdCase/mxdCase)
+ (mxdCase/ve/yCom|pLex.stu-ff)
+ (mxdCase/.ve/yCom|pLex.stu-ff)
+
+ ve/yCom|pLex.stu-ff
+ @ve/yCom|pLex.stu-ff
+ #ve/yCom|pLex.stu-ff
+ #^ve/yCom|pLex.stu-ff ;; type-hint
+ .ve/yCom|pLex.stu-ff
+ (ve/yCom|pLex.stu-ff)
+ (ve/yCom|pLex.stu-ff/oneword)
+ (ve/yCom|pLex.stu-ff/seg.mnt)
+ (ve/yCom|pLex.stu-ff/CmlCase)
+ (ve/yCom|pLex.stu-ff/mxdCase)
+ (ve/yCom|pLex.stu-ff/ve/yCom|pLex.stu-ff)
+ (ve/yCom|pLex.stu-ff/.ve/yCom|pLex.stu-ff)
+
+ ::foo
+ :_::_:foo
+ :_:_:foo
+ :foo/:bar
+ ::_:foo
+ ::_:_:foo
+
+ :_:_:foo/_
+ :_:_:foo/bar
+ :_:_:foo/bar/eee
+ :_:_:foo/bar_:foo
+ :_:_:foo/bar_:_:foo
+
+ ;; :_::_:foo/ ; invalid
+ ;; :_::_:foo/: ; invalid
+ ;; :_::_:foo/_ ; invalid
+ ;; :_::_:foo/bar ; invalid
+ ;; :_:_:foo/ ; invalid
+ ;; :_:_:foo/: ; invalid
+ ;; :::foo ; invalid
+ ;; :_::foo ; invalid
+ ;; :_:_:foo/: ; invalid
+ ;; :_:_:foo/_: ; invalid
+ ;; :_:_:foo/bar_: ; invalid
+ ;; :_:_:foo/bar_::_:foo ; invalid
+ ;; :foo/::bar ; invalid
+
+ :oneword
+ {:oneword 0}
+ ;; {:@oneword 0} ; not allowed
+ {:#oneword 0}
+ {:.oneword 0}
+ {:oneword/oneword 0}
+ {:oneword/seg.mnt 0}
+ {:oneword/CmlCase 0}
+ {:oneword/mxdCase 0}
+ {:oneword/ve/yCom|pLex.stu-ff 0}
+ {:oneword/.ve/yCom|pLex.stu-ff 0}
+
+ :1oneword
+ :ns/1word
+ :1ns/word
+ :1ns/1word
+
+ {:seg.mnt 0}
+ ;; {:@seg.mnt 0} ; not allowed
+ {:#seg.mnt 0}
+ {:.seg.mnt 0}
+ {:seg.mnt/oneword 0}
+ {:seg.mnt/seg.mnt 0}
+ {:seg.mnt/CmlCase 0}
+ {:seg.mnt/mxdCase 0}
+ {:seg.mnt/ve/yCom|pLex.stu-ff 0}
+ {:seg.mnt/.ve/yCom|pLex.stu-ff 0}
+
+ :CmlCase
+ {:CmlCase 0}
+ ;; {:@CmlCase 0} ; not allowed
+ {:#CmlCase 0}
+ {:.CmlCase 0}
+ {:CmlCase/oneword 0}
+ {:CmlCase/seg.mnt 0}
+ {:CmlCase/CmlCase 0}
+ {:CmlCase/mxdCase 0}
+ {:CmlCase/ve/yCom|pLex.stu-ff 0}
+ {:CmlCase/.ve/yCom|pLex.stu-ff 0}
+
+ :mxdCase
+ {:mxdCase 0}
+ ;; {:@mxdCase 0} ; not allowed
+ {:#mxdCase 0}
+ {:.mxdCase 0}
+ {:mxdCase/oneword 0}
+ {:mxdCase/seg.mnt 0}
+ {:mxdCase/CmlCase 0}
+ {:mxdCase/mxdCase 0}
+ {:mxdCase/ve/yCom|pLex.stu-ff 0}
+ {:mxdCase/.ve/yCom|pLex.stu-ff 0}
+
+ :ve/yCom|pLex.stu-ff
+ {:ve/yCom|pLex.stu-ff 0}
+ ;; {:@ve/yCom|pLex.stu-ff 0} ; not allowed
+ {:#ve/yCom|pLex.stu-ff 0}
+ {:.ve/yCom|pLex.stu-ff 0}
+ {:ve/yCom|pLex.stu-ff 0}
+ {:ve/yCom|pLex.stu-ff/oneword 0}
+ {:ve/yCom|pLex.stu-ff/seg.mnt 0}
+ {:ve/yCom|pLex.stu-ff/CmlCase 0}
+ {:ve/yCom|pLex.stu-ff/mxdCase 0}
+ {:ve/yCom|pLex.stu-ff/ve/yCom|pLex.stu-ff 0}
+ {:ve/yCom|pLex.stu-ff/.ve/yCom|pLex.stu-ff 0}
+ )
+
+;; metadata doesn't break docstrings
+(defn ^:mathy? max
+ "Returns the greatest of the nums."
+ {:added "1.0"
+ :inline-arities >1?
+ :inline (nary-inline 'max)}
+ ([x] x)
+ ([x y] (. clojure.lang.Numbers (max x y)))
+ ([x y & more]
+ (reduce1 max (max x y) more)))
+
+
+;; definitions with metadata only don't cause freezing
+(def ^String)
+;; clojure-mode regression: the hanging metadata doesn't cause freezing
+;; However, it does cause font locking on the top level of the next form
(defmulti) to break.
+;; Font locking resumes 1 list down in the next form, or picks back up on the
following form (the defmethod)
+;; There isn't much I can do to fix this, it's caused by an error thrown in
the parser
+;; which makes sense because it is an invalid form.
+(defmulti multi (fn [a _] a))
+(defmethod multi :test [_ b] b)
+(defmethod multi :best [_ b] b)
+
+(defn ^String reverse
+ "Returns s with its characters reversed."
+ {:added "1.2"}
+ [^CharSequence s]
+ (.toString (.reverse (StringBuilder. s))))
+
+;; useful for testing docstring filling
+(defn ^{::metadata "map"} say-hello
+ "This is a long doc string to test clojure-fill-docstring. Lorem ipsum dolor
sit amet, consectetur adipiscing elit. Phasellus sed nunc luctus leo ultricies
semper. Nullam id tempor mi. Cras adipiscing scelerisque purus, at semper magna
tincidunt ut. Sed eget dolor vitae enim feugiat porttitor. Etiam vulputate
pulvinar lacinia. Nam vitae nisl sit amet libero pulvinar pretium nec a dui. Ut
luctus elit eu nulla posuere nec feugiat ipsum vehicula. Quisque eu pulvinar
neque. Fusce fermentum [...]
+
+Etiam commodo nulla id risus convallis pharetra. Integer dapibus, eros vitae
vehicula rhoncus, nisl lorem ornare magna, eu vehicula justo nunc ac nunc. In
dolor sem, vulputate eget vulputate id, euismod eu ligula. Nullam elit augue,
ultrices ut pretium vel, bibendum sit amet est. Curabitur vulputate arcu vitae
neque adipiscing vel commodo ante faucibus. Cras tempor placerat erat. Sed
ultrices faucibus sodales. Vestibulum sollicitudin consectetur mauris, nec
mollis quam accumsan ultrices. [...]
+ []
+ (println "Hello, World!"))
+
+(binding [*out* nil]
+ #"regex string"
+ (def #^Typehint x 1)
+ (def #^:metadata x 1)
+ (def ^Typehint x 2)
+ (def ^:metadata x 2)
+ #'name.sp-ace/var
+ :name.spa-ce/keyword
+ ::aliased/keyword
+ 'namespace/var
+ :normal-keyword
+ "string"
+ 123
+ 123.456
+ true
+ false
+ nil
+ @(atom #{1})
+)
+
+clojure.core/map
+
+(.get ^ByteBuffer test/b)
+
+(def ^Integer x 1)
+
- [nongnu] elpa/clojure-ts-mode d6985289f8 70/71: Add info about mailing list alternative in CONTRIBUTING.md, (continued)
- [nongnu] elpa/clojure-ts-mode d6985289f8 70/71: Add info about mailing list alternative in CONTRIBUTING.md, ELPA Syncer, 2023/08/25
- [nongnu] elpa/clojure-ts-mode 359521e61f 52/71: Add MELPA Stable badge and Make 0.1.0 version, ELPA Syncer, 2023/08/25
- [nongnu] elpa/clojure-ts-mode 54a69be9cd 29/71: Use eldev to lint the project, ELPA Syncer, 2023/08/25
- [nongnu] elpa/clojure-ts-mode aaac7df2cc 26/71: Remove unneeded progn, ELPA Syncer, 2023/08/25
- [nongnu] elpa/clojure-ts-mode ae3790adc0 65/71: Allow user to configure highlighting comment macro body, ELPA Syncer, 2023/08/25
- [nongnu] elpa/clojure-ts-mode 3e4c55fab1 71/71: 0.1.4 in package header, ELPA Syncer, 2023/08/25
- [nongnu] elpa/clojure-ts-mode c9f1ed357d 13/71: Refer users to upstream tree-sitter-clojure, ELPA Syncer, 2023/08/25
- [nongnu] elpa/clojure-ts-mode 30d1d8a3f3 02/71: Add dir-locals, try to fix license badge, ELPA Syncer, 2023/08/25
- [nongnu] elpa/clojure-ts-mode 25df890b68 21/71: Remove old test file, no longer needed, ELPA Syncer, 2023/08/25
- [nongnu] elpa/clojure-ts-mode 19b8e4260b 53/71: Require Emacs 29, not 29.1, ELPA Syncer, 2023/08/25
- [nongnu] elpa/clojure-ts-mode faae888096 07/71: Add test file,
ELPA Syncer <=
- [nongnu] elpa/clojure-ts-mode 6ddcd2cc0f 39/71: Further documentation on syntax trees and nodes, ELPA Syncer, 2023/08/25
- [nongnu] elpa/clojure-ts-mode 5aa548a8a5 41/71: Remove outdated comment, ELPA Syncer, 2023/08/25
- [nongnu] elpa/clojure-ts-mode fefab3540c 58/71: Explicitly declare the syntax-table used by clojure-ts-mode, ELPA Syncer, 2023/08/25
- [nongnu] elpa/clojure-ts-mode d8207ac7c3 34/71: Update the names of a couple of identifiers, ELPA Syncer, 2023/08/25
- [nongnu] elpa/clojure-ts-mode 2d78f6be4f 59/71: Remove redundant docstring info from major mode, ELPA Syncer, 2023/08/25
- [nongnu] elpa/clojure-ts-mode 061d1b3e23 50/71: Add melpa badge to readme, ELPA Syncer, 2023/08/25
- [nongnu] elpa/clojure-ts-mode ae8f3e3805 30/71: Shorten clojure-ts-mode-* to clojure-ts-* for non-public functions, ELPA Syncer, 2023/08/25
- [nongnu] elpa/clojure-ts-mode b2380557c9 51/71: Add missing markdown reference, ELPA Syncer, 2023/08/25
- [nongnu] elpa/clojure-ts-mode 3e2a1b8ec9 03/71: More readme badge and link fixes, ELPA Syncer, 2023/08/25
- [nongnu] elpa/clojure-ts-mode 9640b445eb 33/71: Add a badge for the lint workflow, ELPA Syncer, 2023/08/25