Skip to content

Commit e496ded

Browse files
committed
fix: EOF col number for numbers
1 parent d577a8f commit e496ded

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

src/main/cljs/cljs/tools/reader.cljs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,8 @@
276276
ch (read-char rdr)]
277277
(if (or (whitespace? ch) (macros ch) (nil? ch))
278278
(let [s (str sb)]
279-
(unread rdr ch)
279+
(when-not (nil? ch)
280+
(unread rdr ch))
280281
(or (match-number s)
281282
(err/throw-invalid-number rdr s)))
282283
(recur (doto sb (.append ch)) (read-char rdr)))))

src/main/cljs/cljs/tools/reader/edn.cljs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@
211211
ch (read-char rdr)]
212212
(if (or (whitespace? ch) (macros ch) (nil? ch))
213213
(let [s (str sb)]
214-
(unread rdr ch)
214+
(when-not (nil? ch)
215+
(unread rdr ch))
215216
(or (match-number s)
216217
(err/throw-invalid-number rdr s)))
217218
(recur (doto sb (.append ch)) (read-char rdr)))))

src/main/clojure/clojure/tools/reader.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@
266266
ch (read-char rdr)]
267267
(if (or (whitespace? ch) (macros ch) (nil? ch))
268268
(let [s (str sb)]
269-
(unread rdr ch)
269+
(when ch (unread rdr ch))
270270
(or (match-number s)
271271
(err/throw-invalid-number rdr s)))
272272
(recur (doto sb (.append ch)) (read-char rdr)))))

src/main/clojure/clojure/tools/reader/edn.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@
209209
ch (read-char rdr)]
210210
(if (or (whitespace? ch) (macros ch) (nil? ch))
211211
(let [s (str sb)]
212-
(unread rdr ch)
212+
(when ch (unread rdr ch))
213213
(or (match-number s)
214214
(err/throw-invalid-number rdr s)))
215215
(recur (doto sb (.append ch)) (read-char rdr)))))

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy