tools.reader

starting column number too large by 1 for sets

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

user=> (require '[clojure.tools.reader :as tr])
nil
user=> (require '[clojure.tools.reader.reader-types :as rt])
nil
user=> (defn rs [s]
  #_=>   (tr/read (rt/source-logging-push-back-reader s)))
#'user/rs
user=> (meta (rs "#{1 2}"))
{:line 1, :column 2, :end-line 1, :end-column 7, :source "#{1 2}"}

The :column metadata starts at the "{" in the "#{}" delimiter of the set.

Activity

Hide
Andy Fingerhut added a comment -

Patch trdr-20-v1.patch simply subtracts 1 from the starting column in read-set. This should be correct, since no whitespace or other characters can appear after the # but before the { in the #{} delimiters of a set.

Show
Andy Fingerhut added a comment - Patch trdr-20-v1.patch simply subtracts 1 from the starting column in read-set. This should be correct, since no whitespace or other characters can appear after the # but before the { in the #{} delimiters of a set.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: