<< Back to previous view

[CLJS-668] read-string doesn't correctly handle comments Created: 07/Nov/13  Updated: 09/Nov/13  Resolved: 09/Nov/13

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Chris Granger Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None

Attachments: Text File fix_reading_comments2.patch     Text File fix_reading_comments.patch    
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.



 Comments   
Comment by Eric Normand [ 07/Nov/13 9:06 PM ]

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

\newline and \return are what you want.

Comment by Chris Granger [ 07/Nov/13 10:21 PM ]

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

Comment by David Nolen [ 09/Nov/13 3:38 PM ]

fixed, https://github.com/clojure/clojurescript/commit/50368f88a14bc7334232acb13bb7099a6c27d1a4

Generated at Wed Nov 26 22:40:04 CST 2014 using JIRA 4.4#649-r158309.