Skip to content
Browse files

Initial placeholders for extensible/record reader

  • Loading branch information...
1 parent 481b10e commit 7516411ce6b88f70ccd80f9babc352db9e38224a @fogus fogus committed
Showing with 6 additions and 1 deletion.
  1. +1 −1 src/cljs/cljs/reader.cljs
  2. +5 −0 test/cljs/cljs/reader_test.cljs
View
2 src/cljs/cljs/reader.cljs
@@ -187,7 +187,7 @@ nil if the end of stream has been reached")
(defn not-implemented
[rdr ch]
(reader-error rdr "Reader for " ch " not implemented yet"))
-
+;; TODO: extensible dispatch here.
(defn read-dispatch
[rdr _]
(let [ch (read-char rdr)
View
5 test/cljs/cljs/reader_test.cljs
@@ -26,5 +26,10 @@
(assert (= false (reader/read-string "false")))
(assert (= "string" (reader/read-string "\"string\"")))
(assert (= "escape chars \t \r \n \\ \" \b \f" (reader/read-string "\"escape chars \\t \\r \\n \\\\ \\\" \\b \\f\"")))
+
+ ;; defrecords tests
+ (defrecord R [a b])
+
+ ;; extensible reader tests
:ok)

0 comments on commit 7516411

Please sign in to comment.
Something went wrong with that request. Please try again.