{"action":"created","issue":{"url":"https://api.github.com/repos/mrkkrp/megaparsec/issues/26","labels_url":"https://api.github.com/repos/mrkkrp/megaparsec/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/mrkkrp/megaparsec/issues/26/comments","events_url":"https://api.github.com/repos/mrkkrp/megaparsec/issues/26/events","html_url":"https://github.com/mrkkrp/megaparsec/issues/26","id":103271181,"number":26,"title":"multiline string literals","user":{"login":"minad","id":50754,"avatar_url":"https://avatars.githubusercontent.com/u/50754?v=3","gravatar_id":"","url":"https://api.github.com/users/minad","html_url":"https://github.com/minad","followers_url":"https://api.github.com/users/minad/followers","following_url":"https://api.github.com/users/minad/following{/other_user}","gists_url":"https://api.github.com/users/minad/gists{/gist_id}","starred_url":"https://api.github.com/users/minad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minad/subscriptions","organizations_url":"https://api.github.com/users/minad/orgs","repos_url":"https://api.github.com/users/minad/repos","events_url":"https://api.github.com/users/minad/events{/privacy}","received_events_url":"https://api.github.com/users/minad/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-08-26T13:33:13Z","updated_at":"2015-09-08T11:57:29Z","closed_at":null,"body":"Hi,\r\n\r\nI would like to have such a feature, however using that in parsec requires to copy this whole text.parsec.token code. Maybe you have some ideas on how to make this token generator more flexible? This is also related to the whitespace issue we discussed before.\r\n"},"comment":{"url":"https://api.github.com/repos/mrkkrp/megaparsec/issues/comments/138531695","html_url":"https://github.com/mrkkrp/megaparsec/issues/26#issuecomment-138531695","issue_url":"https://api.github.com/repos/mrkkrp/megaparsec/issues/26","id":138531695,"user":{"login":"mrkkrp","id":8165792,"avatar_url":"https://avatars.githubusercontent.com/u/8165792?v=3","gravatar_id":"","url":"https://api.github.com/users/mrkkrp","html_url":"https://github.com/mrkkrp","followers_url":"https://api.github.com/users/mrkkrp/followers","following_url":"https://api.github.com/users/mrkkrp/following{/other_user}","gists_url":"https://api.github.com/users/mrkkrp/gists{/gist_id}","starred_url":"https://api.github.com/users/mrkkrp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrkkrp/subscriptions","organizations_url":"https://api.github.com/users/mrkkrp/orgs","repos_url":"https://api.github.com/users/mrkkrp/repos","events_url":"https://api.github.com/users/mrkkrp/events{/privacy}","received_events_url":"https://api.github.com/users/mrkkrp/received_events","type":"User","site_admin":false},"created_at":"2015-09-08T11:57:29Z","updated_at":"2015-09-08T11:57:29Z","body":"@minad, the feature you're requesting can be implemented with new lexer (see `Text.Megaparsec.Lexer` in `new-lexer` branch) as following:\r\n\r\n```haskell\r\nstringLiteral = char '\"' >> manyTill charLiteral (char '\"')\r\n```\r\n\r\nNew lexer is minimalistic and doesn't impose any assumptions on you, as you can see you can even have string literals that quoted differently. `charLiteral` just helps to parse escape codes and other hairy stuff (by the way it uses built-in Haskell support without trying to re-implement the whole thing because it may get very buggy, I'm not sure this part of Parsec is bug-free), the rest is up to you. It's philosophy of the new lexer to give you more freedom in every aspect, although this means that you'll possibly need to write a bit more glue to make it work.\r\n\r\nNote that `charLiteral` doesn't parse quotes too, because some languages have different syntax for character literals, again to use it to parse character literals you need to handle these details manually.\r\n\r\nYou can criticize current decisions here: mrkkrp/megaparsec#28. I'll close this issue once `new-lexer` branch is merged.\r\n"}}