Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion lispy-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -1865,6 +1865,12 @@ Insert KEY if there's no command."
(should (equal
(lispy--read "#m(foo bar)")
'(ly-raw lisp-macro "#m(foo bar)")))
(should (equal
(lispy--read "#xFF00")
'(ly-raw lisp-macro "#xFF00")))
(should (equal
(lispy--read "#b0101")
'(ly-raw lisp-macro "#b0101")))
(should (equal
(lispy--read ",(or body)")
'(ly-raw \, (or body))))
Expand Down Expand Up @@ -1914,7 +1920,11 @@ Insert KEY if there's no command."
(ly-raw clojure-symbol ":bar")
((ly-raw clojure-symbol ".") % (ly-raw clojure-symbol ".-value"))))))
(should (equal (lispy--read ":.name")
'(ly-raw clojure-keyword ":.name"))))
'(ly-raw clojure-keyword ":.name")))
(should (equal (lispy--read "1.0e+INF")
'(ly-raw float "1.0e+INF")))
(should (equal (lispy--read "1.0e+NaN")
'(ly-raw float "1.0e+NaN"))))

(ert-deftest lispy-tick ()
(should (string= (lispy-with "|" "'") "'|"))
Expand Down
4 changes: 2 additions & 2 deletions lispy.el
Original file line number Diff line number Diff line change
Expand Up @@ -7395,7 +7395,7 @@ See https://clojure.org/guides/weird_characters#_character_literal.")
(insert (format "(ly-raw comment %S)" str)))
;; ——— reader macro syntax (LISP)
(goto-char (point-min))
(while (re-search-forward "#[a-z][\"(]" nil t)
(while (re-search-forward "#[a-z]\\(?:[\"(]\\|[0-9a-f]+\\b\\)" nil t)
(forward-char -1)
(unless (lispy--in-string-or-comment-p)
(let ((beg (match-beginning 0))
Expand All @@ -7422,7 +7422,7 @@ See https://clojure.org/guides/weird_characters#_character_literal.")
(lispy--replace-regexp-in-code "\n" " (ly-raw newline)")
;; ——— numbers ————————————————
(goto-char (point-min))
(while (re-search-forward "\\b[+-]?[0-9]+\\(?:\\.[0-9]+\\)?\\(?:e[+-]?[0-9]*\\)" nil t)
(while (re-search-forward "\\b[+-]?[0-9]+\\(?:\\.[0-9]+\\)?\\(?:e[+-]?\\(?:INF\\|NaN\\|[0-9]+\\)\\)" nil t)
(if (setq cbnd (lispy--bounds-string))
(goto-char (cdr cbnd))
(let ((s (match-string-no-properties 0)))
Expand Down