Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix square and curly brackets #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion src/tawny/read.clj
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ starts-with. Use this partially applied with a filter for 'read'."
"Takes a string and treats characters not legal in a
Clojure symbol. Use this composed with a entity transform function"
[s]
(let [r (clojure.string/replace s #"[() /,]" "_")
(let [r (clojure.string/replace s #"[() /, \[\] {}]" "_")
^Character f (first r)]
(str
(if (or (Character/isLetter f)
Expand Down
7 changes: 5 additions & 2 deletions test/tawny/read_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,11 @@
(is (= "bob_bob" (r/stop-characters-transform "bob bob")))
(is (= "_9bob" (r/stop-characters-transform "9bob")))
(is (= "_9_bob" (r/stop-characters-transform "9 bob")))
(is (= "_9_bob" (r/stop-characters-transform " 9 bob"))))

(is (= "_9_bob" (r/stop-characters-transform " 9 bob")))
(is (= "bob_" (r/stop-characters-transform "bob[")))
(is (= "bob_" (r/stop-characters-transform "bob]")))
(is (= "bob_" (r/stop-characters-transform "bob{")))
(is (= "bob_" (r/stop-characters-transform "bob}"))))

(deftest intern-entity-bug57
(is
Expand Down