Conversation
An alternative would be to replace the parseStringLit function with `reads @String` and remove the `readMaybe` from `render`, but that wouldn't handle malfromed and unclosed strings as nicely.
Btw, the old version of `parseStringLit` could be replaced with `parseStringLit = first (drop 1) . span (/='"')`. Same thing with `parseOther` which can be replaced with
parseOther :: String -> (String, String)
parseOther = span (flip notElem "{[()]}\",")
|
An alternative would be to replace the parseStringLit function with Btw, the old version of |
|
I should also add a test case for this. |
|
Thanks, good catch! I will write up a test case and merge. The reason |
|
@anka-213 Yes, a test case would be great! @andrew-lei After @anka-213 adds a test case, does this look reasonable to merge? If so, please feel free to go ahead and merge it. |
|
Yes, in fact I've already added the test from #40. Although I don't think I did the commit correctly since it ended up on a different branch instead of to this pull request. Regardless, when Travis is done checking it, I will merge that branch. |
|
Okay thanks @andrew-lei! |
|
OK merged. |
|
@andrew-lei Regarding the lazy parsing, we might be able to use the function |
I simply added a case for ignoring the next character after a backslash in
parseStringLit.Fixes #40.