tools.reader

Fix for parsing of tagged literals

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Patch:
    Code
  • Approval:
    Ok

Description

Parsing of tagged literals fails at the moment, e.g.

user> (require '[clojure.tools.reader :as r] :reload) (r/read-string "#java.lang.String[\"Hi\"]")
nil
ArrayIndexOutOfBoundsException 15 clojure.lang.RT.aget (RT.java:2239)

Attached patch corrects this problem, and brings the clojure logic in line with what's in LispReader.java

  1. 0001-Fix-for-ctor-reading.patch
    13/Sep/13 12:06 PM
    3 kB
    Alex Coventry
  2. reader.patch
    12/Sep/13 10:47 PM
    2 kB
    Alex Coventry

Activity

Hide
Nicola Mometto added a comment -

Thanks for the patch, can you post a patch that is the result of git format-patch so that we can keep your authorship on the commit?
(apply the patch, git add <path/to/reader.clj>, git commit -m "Fix ctor reading", git format-patch origin/master)

Also, can you please put the result of (count entries) in the let so that we compute it only once?

Thanks

Show
Nicola Mometto added a comment - Thanks for the patch, can you post a patch that is the result of git format-patch so that we can keep your authorship on the commit? (apply the patch, git add <path/to/reader.clj>, git commit -m "Fix ctor reading", git format-patch origin/master) Also, can you please put the result of (count entries) in the let so that we compute it only once? Thanks
Hide
Alex Coventry added a comment - - edited

No worries, Nicola. I've attached a revised patch.

Best regards,
Alex

Show
Alex Coventry added a comment - - edited No worries, Nicola. I've attached a revised patch. Best regards, Alex

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: