ClojureScript

read-string doesn't correctly handle comments

Details

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

Description

If you try to read a string that has a comment, extra lines are skipped seemingly due to some aspect of equality that I don't understand. The code in master checks for (identical? ch \n), which doesn't appear to be true. Switching this to (identical? ch "\n") fixes this, but is JS specific. I've included tests that fail in master but pass with this change.

Activity

Hide
Eric Normand added a comment -

\n is the character 'n', \r is the character 'r'.

\newline and \return are what you want.

Show
Eric Normand added a comment - \n is the character 'n', \r is the character 'r'. \newline and \return are what you want.
Chris Granger made changes -
Field Original Value New Value
Attachment fix_reading_comments2.patch [ 12455 ]
Hide
Chris Granger added a comment -

hah - duh. Added a new version of the patch that uses \newline and \return

Show
Chris Granger added a comment - hah - duh. Added a new version of the patch that uses \newline and \return
David Nolen made changes -
Resolution Completed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
David Nolen made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: