Skip to content
Merged
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: 2 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ A release with known breaking changes is marked with:
// (adjust these in publish.clj as you see fit)
=== Unreleased

* Fix parsing of `b//` symbol
{issue}323[#323] ({borkdude})
* bump `org.clojure/tools.reader` to version `1.5.0`
({lread})
* `sexpr` now better matches clojure `read-string` for `~`, `@` and `~@`
Expand Down
8 changes: 4 additions & 4 deletions src/rewrite_clj/reader.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,13 @@
[ns sym]

(and (not (interop/numeric? (nth sym 0)))
(not (identical? "" sym))
(not (= "" sym))
(not (string/ends-with? ns ":"))
(or (identical? sym "/")
(or (= sym "/")
(nil? (string/index-of sym "/"))))
[ns sym]))))
(when (or (identical? token "/")
(nil? (string/index-of token "/")))
(when (or (= token "/")
(nil? (string/index-of token "/")))
[nil token]))))

(defn read-symbol
Expand Down
3 changes: 2 additions & 1 deletion test/rewrite_clj/parser_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
["sym'" 'sym']
["sym'sym" 'sym'sym]
["sym:sym" 'sym:sym]
["\"string\"" "string"]]]
["\"string\"" "string"]
["b//" 'b//]]]
(let [n (p/parse-string s)]
(is (= :token (node/tag n)))
(is (= s (node/string n)))
Expand Down