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
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
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.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: