filter out carriage returns for quasiquotes #113
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There is a consistency problem when handling carriage returns across Shakespeare and Shelly.
In windows, 'st' returns \r\n but 'textFile' returns \n.
Shelly.readfile returns \r\n but Data.Text.IO.readFile retuns \n. I will add a pull request for Shelly as gregwebs/Shelly.hs#44
(interpolated-string-perl6 'q' and 'qc' return \n only)
I think most consistent behavior is to just drop the '\r' across the board when reading and leave the writing the way it is. This is consistent with Data.Text.IO readFile writeFile.
https://gist.github.com/gbwey/6833805
from the above gist: this is what we have now:
*Test6> main
120 13 10 121 :st
120 10 121 :interpolated string perl6
120 13 13 10 121 :Shelly.writefile st as abc then Shelly.readfile
120 10 10 121 :T.readFile abc
120 10 10 121 :textFile abc
120 13 10 121 :Shelly.readfile ab
120 10 121 :T.readFile ab
120 10 121 :textFile ab
and after the changes for the two pull requests this is the result
*Test6> main
120 10 121 :st
120 10 121 :interpolated string perl6
120 10 121 :Shelly.writefile st as abc then Shelly.readfile
120 10 121 :T.readFile abc
120 10 121 :textFile abc
120 10 121 :Shelly.readfile ab
120 10 121 :T.readFile ab
120 10 121 :textFile ab
Thanks,
Grant