(->IndexingPushbackReader rdr line column line-start? prev prev-column file-name)
Positional factory function for class clojure.tools.reader.reader_types.IndexingPushbackReader.
Source
(deftype IndexingPushbackReader
[rdr ^:unsynchronized-mutable ^long line ^:unsynchronized-mutable ^long column
^:unsynchronized-mutable line-start? ^:unsynchronized-mutable prev
^:unsynchronized-mutable ^long prev-column file-name]
Reader
(read-char [reader]
(when-let [ch (read-char rdr)]
(let [ch (normalize-newline rdr ch)]
(set! prev line-start?)
(set! line-start? (newline? ch))
(when line-start?
(set! prev-column column)
(set! column 0)
(update! line inc))
(update! column inc)
ch)))
(peek-char [reader]
(peek-char rdr))
IPushbackReader
(unread [reader ch]
(if line-start?
(do (update! line dec)
(set! column prev-column))
(update! column dec))
(set! line-start? prev)
(unread rdr ch))
IndexingReader
(get-line-number [reader] (int line))
(get-column-number [reader] (int column))
(get-file-name [reader] file-name)
Closeable
(close [this]
(when (instance? Closeable rdr)
(.close ^Closeable rdr))))