Skip to content

Commit 3910e20

Browse files
authored
Fix parsing of b// symbol (#324)
Fixes #323
1 parent b8a4804 commit 3910e20

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

CHANGELOG.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ A release with known breaking changes is marked with:
2424
// (adjust these in publish.clj as you see fit)
2525
=== Unreleased
2626

27+
* Fix parsing of `b//` symbol
28+
{issue}323[#323] ({borkdude})
2729
* bump `org.clojure/tools.reader` to version `1.5.0`
2830
({lread})
2931
* `sexpr` now better matches clojure `read-string` for `~`, `@` and `~@`

src/rewrite_clj/reader.cljc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,13 +223,13 @@
223223
[ns sym]
224224

225225
(and (not (interop/numeric? (nth sym 0)))
226-
(not (identical? "" sym))
226+
(not (= "" sym))
227227
(not (string/ends-with? ns ":"))
228-
(or (identical? sym "/")
228+
(or (= sym "/")
229229
(nil? (string/index-of sym "/"))))
230230
[ns sym]))))
231-
(when (or (identical? token "/")
232-
(nil? (string/index-of token "/")))
231+
(when (or (= token "/")
232+
(nil? (string/index-of token "/")))
233233
[nil token]))))
234234

235235
(defn read-symbol

test/rewrite_clj/parser_test.cljc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@
6363
["sym'" 'sym']
6464
["sym'sym" 'sym'sym]
6565
["sym:sym" 'sym:sym]
66-
["\"string\"" "string"]]]
66+
["\"string\"" "string"]
67+
["b//" 'b//]]]
6768
(let [n (p/parse-string s)]
6869
(is (= :token (node/tag n)))
6970
(is (= s (node/string n)))

0 commit comments

Comments
 (0)