Skip to content

Commit

Permalink
Merge 85dbee5 into 38a7df4
Browse files Browse the repository at this point in the history
  • Loading branch information
taku0 committed May 16, 2021
2 parents 38a7df4 + 85dbee5 commit ec06348
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 11 additions & 1 deletion lispy-test.el
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
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

0 comments on commit ec06348

Please sign in to comment.