Skip to content

Commit

Permalink
CLJS-356: make cljs.reader errors conform to Clojure JVM.
Browse files Browse the repository at this point in the history
  • Loading branch information
David Nolen authored and David Nolen committed Aug 17, 2012
1 parent 5035eb9 commit df6f316
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cljs/cljs/reader.cljs
Expand Up @@ -234,7 +234,7 @@ nil if the end of stream has been reached")
[delim rdr recursive?]
(loop [a (transient [])]
(let [ch (read-past whitespace? rdr)]
(when-not ch (reader-error rdr "EOF"))
(when-not ch (reader-error rdr "EOF while reading"))
(if (identical? delim ch)
(persistent! a)
(if-let [macrofn (macros ch)]
Expand Down Expand Up @@ -303,7 +303,7 @@ nil if the end of stream has been reached")
(loop [buffer (gstring/StringBuffer.)
ch (read-char reader)]
(cond
(nil? ch) (reader-error reader "EOF while reading string")
(nil? ch) (reader-error reader "EOF while reading")
(identical? "\\" ch) (recur (do (.append buffer (escape-char buffer reader)) buffer)
(read-char reader))
(identical? \" ch) (. buffer (toString))
Expand Down Expand Up @@ -418,7 +418,7 @@ nil if the end of stream has been reached")
[reader eof-is-error sentinel is-recursive]
(let [ch (read-char reader)]
(cond
(nil? ch) (if eof-is-error (reader-error reader "EOF") sentinel)
(nil? ch) (if eof-is-error (reader-error reader "EOF while reading") sentinel)
(whitespace? ch) (recur reader eof-is-error sentinel is-recursive)
(comment-prefix? ch) (recur (read-comment reader ch) eof-is-error sentinel is-recursive)
:else (let [f (macros ch)
Expand Down

0 comments on commit df6f316

Please sign in to comment.