{"action":"created","comment":{"url":"https://api.github.com/repos/purebred-mua/purebred-email/pulls/comments/175283334","pull_request_review_id":104791660,"id":175283334,"diff_hunk":"@@ -124,8 +133,93 @@ special = satisfy isSpecial\n atext :: Parser Word8\n atext = satisfy isAtext\n \n+\n+-- §3.4 Address Specification\n+data Mailbox =\n+    Mailbox (Maybe T.Text {- display name -})\n+             AddrSpec\n+    deriving (Show,Eq)\n+\n+mailbox :: Parser Mailbox\n+mailbox = Mailbox <$> optionalDisplayName <*> angleAddr\n+\n+optionalDisplayName :: Parser (Maybe T.Text)\n+optionalDisplayName = optional (optionalCFWS *> displayName <* optionalCFWS)\n+\n+displayName :: Parser T.Text\n+displayName = decodeLenient <$> phrase\n+\n+word :: Parser B.ByteString\n+word = atom <|> quotedString\n+\n+phrase :: Parser B.ByteString\n+phrase = foldMany1 word\n+\n+angleAddr :: Parser AddrSpec\n+angleAddr = optionalCFWS *>\n+  char8 '<' *> addressSpec <* char8 '>'\n+  <* optionalCFWS\n+\n+atom :: Parser B.ByteString\n+atom = optionalCFWS *> foldMany1 (B.singleton <$> atext) <* optionalCFWS\n+\n+dotAtomText :: Parser B.ByteString\n+dotAtomText = foldMany1 (B.singleton <$> atext) <<>> foldMany ((B.singleton <$> char8 '.') <<>> takeWhile1 isAtext)\n+\n+dotAtom :: Parser B.ByteString\n+dotAtom = optionalCFWS *> dotAtomText <* optionalCFWS\n+\n+data AddrSpec =\n+    AddrSpec B.ByteString {- local part -}\n+             Domain\n+    deriving (Show,Eq)\n+\n+data Domain\n+    = DomainDotAtom (NonEmpty B.ByteString {- printable ascii -})\n+    | DomainLiteral B.ByteString\n+    deriving (Show,Eq)\n+\n+addressSpec :: Parser AddrSpec\n+addressSpec = AddrSpec <$> localPart <*> (char8 '@' *> domain)\n+\n+localPart :: Parser B.ByteString\n+localPart = dotAtom <|> quotedString\n+\n+-- | Printable US-ASCII excl \"[\", \"]\", or \"\\\"\n+isDtext :: Word8 -> Bool\n+isDtext c = (c >= 33 && c <= 90) || (c >= 94 && c <= 126)\n+\n+dText :: Parser Word8\n+dText = satisfy isDtext\n+\n+domainLiteral :: Parser B.ByteString\n+domainLiteral =\n+  optionalCFWS *> char8 '['\n+  *> foldMany (optionalFWS <<>> (B.singleton <$> dText) <<>> optionalFWS)\n+  <* char8 ']' <* optionalFWS\n+\n+domain :: Parser Domain\n+domain = (DomainDotAtom <$> (pure <$> dotAtom))\n+         <|> (DomainLiteral <$> domainLiteral)\n+\n+data Address\n+    = Single Mailbox\n+    | Group T.Text {- display name -}\n+            [Mailbox]\n+    deriving (Show,Eq)\n+\n+mailboxList :: Parser [Mailbox]\n+mailboxList = many (optional (char8 ',') *> mailbox)","path":"src/Data/RFC5322.hs","position":111,"original_position":111,"commit_id":"856aed154ae03a68570c7fa63cec1416eb318718","original_commit_id":"856aed154ae03a68570c7fa63cec1416eb318718","user":{"login":"romanofski","id":121047,"avatar_url":"https://avatars3.githubusercontent.com/u/121047?v=4","gravatar_id":"","url":"https://api.github.com/users/romanofski","html_url":"https://github.com/romanofski","followers_url":"https://api.github.com/users/romanofski/followers","following_url":"https://api.github.com/users/romanofski/following{/other_user}","gists_url":"https://api.github.com/users/romanofski/gists{/gist_id}","starred_url":"https://api.github.com/users/romanofski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romanofski/subscriptions","organizations_url":"https://api.github.com/users/romanofski/orgs","repos_url":"https://api.github.com/users/romanofski/repos","events_url":"https://api.github.com/users/romanofski/events{/privacy}","received_events_url":"https://api.github.com/users/romanofski/received_events","type":"User","site_admin":false},"body":"True. Done.","created_at":"2018-03-18T09:59:47Z","updated_at":"2018-03-18T09:59:47Z","html_url":"https://github.com/purebred-mua/purebred-email/pull/12#discussion_r175283334","pull_request_url":"https://api.github.com/repos/purebred-mua/purebred-email/pulls/12","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/purebred-mua/purebred-email/pulls/comments/175283334"},"html":{"href":"https://github.com/purebred-mua/purebred-email/pull/12#discussion_r175283334"},"pull_request":{"href":"https://api.github.com/repos/purebred-mua/purebred-email/pulls/12"}},"in_reply_to_id":175276598},"pull_request":{"url":"https://api.github.com/repos/purebred-mua/purebred-email/pulls/12","id":174113719,"html_url":"https://github.com/purebred-mua/purebred-email/pull/12","diff_url":"https://github.com/purebred-mua/purebred-email/pull/12.diff","patch_url":"https://github.com/purebred-mua/purebred-email/pull/12.patch","issue_url":"https://api.github.com/repos/purebred-mua/purebred-email/issues/12","number":12,"state":"open","locked":false,"title":"Address and Mailbox parsing","user":{"login":"romanofski","id":121047,"avatar_url":"https://avatars3.githubusercontent.com/u/121047?v=4","gravatar_id":"","url":"https://api.github.com/users/romanofski","html_url":"https://github.com/romanofski","followers_url":"https://api.github.com/users/romanofski/followers","following_url":"https://api.github.com/users/romanofski/following{/other_user}","gists_url":"https://api.github.com/users/romanofski/gists{/gist_id}","starred_url":"https://api.github.com/users/romanofski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romanofski/subscriptions","organizations_url":"https://api.github.com/users/romanofski/orgs","repos_url":"https://api.github.com/users/romanofski/repos","events_url":"https://api.github.com/users/romanofski/events{/privacy}","received_events_url":"https://api.github.com/users/romanofski/received_events","type":"User","site_admin":false},"body":"Fixes https://github.com/purebred-mua/purebred/issues/164","created_at":"2018-03-09T21:32:22Z","updated_at":"2018-03-18T09:59:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ebd8be2f94754205f7fe8a49cea25709c10c6daf","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/purebred-mua/purebred-email/pulls/12/commits","review_comments_url":"https://api.github.com/repos/purebred-mua/purebred-email/pulls/12/comments","review_comment_url":"https://api.github.com/repos/purebred-mua/purebred-email/pulls/comments{/number}","comments_url":"https://api.github.com/repos/purebred-mua/purebred-email/issues/12/comments","statuses_url":"https://api.github.com/repos/purebred-mua/purebred-email/statuses/856aed154ae03a68570c7fa63cec1416eb318718","head":{"label":"purebred-mua:address_parsing","ref":"address_parsing","sha":"856aed154ae03a68570c7fa63cec1416eb318718","user":{"login":"purebred-mua","id":30308388,"avatar_url":"https://avatars3.githubusercontent.com/u/30308388?v=4","gravatar_id":"","url":"https://api.github.com/users/purebred-mua","html_url":"https://github.com/purebred-mua","followers_url":"https://api.github.com/users/purebred-mua/followers","following_url":"https://api.github.com/users/purebred-mua/following{/other_user}","gists_url":"https://api.github.com/users/purebred-mua/gists{/gist_id}","starred_url":"https://api.github.com/users/purebred-mua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/purebred-mua/subscriptions","organizations_url":"https://api.github.com/users/purebred-mua/orgs","repos_url":"https://api.github.com/users/purebred-mua/repos","events_url":"https://api.github.com/users/purebred-mua/events{/privacy}","received_events_url":"https://api.github.com/users/purebred-mua/received_events","type":"Organization","site_admin":false},"repo":{"id":98775044,"name":"purebred-email","full_name":"purebred-mua/purebred-email","owner":{"login":"purebred-mua","id":30308388,"avatar_url":"https://avatars3.githubusercontent.com/u/30308388?v=4","gravatar_id":"","url":"https://api.github.com/users/purebred-mua","html_url":"https://github.com/purebred-mua","followers_url":"https://api.github.com/users/purebred-mua/followers","following_url":"https://api.github.com/users/purebred-mua/following{/other_user}","gists_url":"https://api.github.com/users/purebred-mua/gists{/gist_id}","starred_url":"https://api.github.com/users/purebred-mua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/purebred-mua/subscriptions","organizations_url":"https://api.github.com/users/purebred-mua/orgs","repos_url":"https://api.github.com/users/purebred-mua/repos","events_url":"https://api.github.com/users/purebred-mua/events{/privacy}","received_events_url":"https://api.github.com/users/purebred-mua/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/purebred-mua/purebred-email","description":"email parsing","fork":false,"url":"https://api.github.com/repos/purebred-mua/purebred-email","forks_url":"https://api.github.com/repos/purebred-mua/purebred-email/forks","keys_url":"https://api.github.com/repos/purebred-mua/purebred-email/keys{/key_id}","collaborators_url":"https://api.github.com/repos/purebred-mua/purebred-email/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/purebred-mua/purebred-email/teams","hooks_url":"https://api.github.com/repos/purebred-mua/purebred-email/hooks","issue_events_url":"https://api.github.com/repos/purebred-mua/purebred-email/issues/events{/number}","events_url":"https://api.github.com/repos/purebred-mua/purebred-email/events","assignees_url":"https://api.github.com/repos/purebred-mua/purebred-email/assignees{/user}","branches_url":"https://api.github.com/repos/purebred-mua/purebred-email/branches{/branch}","tags_url":"https://api.github.com/repos/purebred-mua/purebred-email/tags","blobs_url":"https://api.github.com/repos/purebred-mua/purebred-email/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/purebred-mua/purebred-email/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/purebred-mua/purebred-email/git/refs{/sha}","trees_url":"https://api.github.com/repos/purebred-mua/purebred-email/git/trees{/sha}","statuses_url":"https://api.github.com/repos/purebred-mua/purebred-email/statuses/{sha}","languages_url":"https://api.github.com/repos/purebred-mua/purebred-email/languages","stargazers_url":"https://api.github.com/repos/purebred-mua/purebred-email/stargazers","contributors_url":"https://api.github.com/repos/purebred-mua/purebred-email/contributors","subscribers_url":"https://api.github.com/repos/purebred-mua/purebred-email/subscribers","subscription_url":"https://api.github.com/repos/purebred-mua/purebred-email/subscription","commits_url":"https://api.github.com/repos/purebred-mua/purebred-email/commits{/sha}","git_commits_url":"https://api.github.com/repos/purebred-mua/purebred-email/git/commits{/sha}","comments_url":"https://api.github.com/repos/purebred-mua/purebred-email/comments{/number}","issue_comment_url":"https://api.github.com/repos/purebred-mua/purebred-email/issues/comments{/number}","contents_url":"https://api.github.com/repos/purebred-mua/purebred-email/contents/{+path}","compare_url":"https://api.github.com/repos/purebred-mua/purebred-email/compare/{base}...{head}","merges_url":"https://api.github.com/repos/purebred-mua/purebred-email/merges","archive_url":"https://api.github.com/repos/purebred-mua/purebred-email/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/purebred-mua/purebred-email/downloads","issues_url":"https://api.github.com/repos/purebred-mua/purebred-email/issues{/number}","pulls_url":"https://api.github.com/repos/purebred-mua/purebred-email/pulls{/number}","milestones_url":"https://api.github.com/repos/purebred-mua/purebred-email/milestones{/number}","notifications_url":"https://api.github.com/repos/purebred-mua/purebred-email/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/purebred-mua/purebred-email/labels{/name}","releases_url":"https://api.github.com/repos/purebred-mua/purebred-email/releases{/id}","deployments_url":"https://api.github.com/repos/purebred-mua/purebred-email/deployments","created_at":"2017-07-30T04:30:28Z","updated_at":"2017-09-22T22:15:06Z","pushed_at":"2018-03-18T01:40:32Z","git_url":"git://github.com/purebred-mua/purebred-email.git","ssh_url":"git@github.com:purebred-mua/purebred-email.git","clone_url":"https://github.com/purebred-mua/purebred-email.git","svn_url":"https://github.com/purebred-mua/purebred-email","homepage":null,"size":88,"stargazers_count":1,"watchers_count":1,"language":"Haskell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0"},"forks":0,"open_issues":7,"watchers":1,"default_branch":"master"}},"base":{"label":"purebred-mua:master","ref":"master","sha":"a016b57faf9e6707690ba2482b6cd83312e162f4","user":{"login":"purebred-mua","id":30308388,"avatar_url":"https://avatars3.githubusercontent.com/u/30308388?v=4","gravatar_id":"","url":"https://api.github.com/users/purebred-mua","html_url":"https://github.com/purebred-mua","followers_url":"https://api.github.com/users/purebred-mua/followers","following_url":"https://api.github.com/users/purebred-mua/following{/other_user}","gists_url":"https://api.github.com/users/purebred-mua/gists{/gist_id}","starred_url":"https://api.github.com/users/purebred-mua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/purebred-mua/subscriptions","organizations_url":"https://api.github.com/users/purebred-mua/orgs","repos_url":"https://api.github.com/users/purebred-mua/repos","events_url":"https://api.github.com/users/purebred-mua/events{/privacy}","received_events_url":"https://api.github.com/users/purebred-mua/received_events","type":"Organization","site_admin":false},"repo":{"id":98775044,"name":"purebred-email","full_name":"purebred-mua/purebred-email","owner":{"login":"purebred-mua","id":30308388,"avatar_url":"https://avatars3.githubusercontent.com/u/30308388?v=4","gravatar_id":"","url":"https://api.github.com/users/purebred-mua","html_url":"https://github.com/purebred-mua","followers_url":"https://api.github.com/users/purebred-mua/followers","following_url":"https://api.github.com/users/purebred-mua/following{/other_user}","gists_url":"https://api.github.com/users/purebred-mua/gists{/gist_id}","starred_url":"https://api.github.com/users/purebred-mua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/purebred-mua/subscriptions","organizations_url":"https://api.github.com/users/purebred-mua/orgs","repos_url":"https://api.github.com/users/purebred-mua/repos","events_url":"https://api.github.com/users/purebred-mua/events{/privacy}","received_events_url":"https://api.github.com/users/purebred-mua/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/purebred-mua/purebred-email","description":"email parsing","fork":false,"url":"https://api.github.com/repos/purebred-mua/purebred-email","forks_url":"https://api.github.com/repos/purebred-mua/purebred-email/forks","keys_url":"https://api.github.com/repos/purebred-mua/purebred-email/keys{/key_id}","collaborators_url":"https://api.github.com/repos/purebred-mua/purebred-email/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/purebred-mua/purebred-email/teams","hooks_url":"https://api.github.com/repos/purebred-mua/purebred-email/hooks","issue_events_url":"https://api.github.com/repos/purebred-mua/purebred-email/issues/events{/number}","events_url":"https://api.github.com/repos/purebred-mua/purebred-email/events","assignees_url":"https://api.github.com/repos/purebred-mua/purebred-email/assignees{/user}","branches_url":"https://api.github.com/repos/purebred-mua/purebred-email/branches{/branch}","tags_url":"https://api.github.com/repos/purebred-mua/purebred-email/tags","blobs_url":"https://api.github.com/repos/purebred-mua/purebred-email/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/purebred-mua/purebred-email/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/purebred-mua/purebred-email/git/refs{/sha}","trees_url":"https://api.github.com/repos/purebred-mua/purebred-email/git/trees{/sha}","statuses_url":"https://api.github.com/repos/purebred-mua/purebred-email/statuses/{sha}","languages_url":"https://api.github.com/repos/purebred-mua/purebred-email/languages","stargazers_url":"https://api.github.com/repos/purebred-mua/purebred-email/stargazers","contributors_url":"https://api.github.com/repos/purebred-mua/purebred-email/contributors","subscribers_url":"https://api.github.com/repos/purebred-mua/purebred-email/subscribers","subscription_url":"https://api.github.com/repos/purebred-mua/purebred-email/subscription","commits_url":"https://api.github.com/repos/purebred-mua/purebred-email/commits{/sha}","git_commits_url":"https://api.github.com/repos/purebred-mua/purebred-email/git/commits{/sha}","comments_url":"https://api.github.com/repos/purebred-mua/purebred-email/comments{/number}","issue_comment_url":"https://api.github.com/repos/purebred-mua/purebred-email/issues/comments{/number}","contents_url":"https://api.github.com/repos/purebred-mua/purebred-email/contents/{+path}","compare_url":"https://api.github.com/repos/purebred-mua/purebred-email/compare/{base}...{head}","merges_url":"https://api.github.com/repos/purebred-mua/purebred-email/merges","archive_url":"https://api.github.com/repos/purebred-mua/purebred-email/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/purebred-mua/purebred-email/downloads","issues_url":"https://api.github.com/repos/purebred-mua/purebred-email/issues{/number}","pulls_url":"https://api.github.com/repos/purebred-mua/purebred-email/pulls{/number}","milestones_url":"https://api.github.com/repos/purebred-mua/purebred-email/milestones{/number}","notifications_url":"https://api.github.com/repos/purebred-mua/purebred-email/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/purebred-mua/purebred-email/labels{/name}","releases_url":"https://api.github.com/repos/purebred-mua/purebred-email/releases{/id}","deployments_url":"https://api.github.com/repos/purebred-mua/purebred-email/deployments","created_at":"2017-07-30T04:30:28Z","updated_at":"2017-09-22T22:15:06Z","pushed_at":"2018-03-18T01:40:32Z","git_url":"git://github.com/purebred-mua/purebred-email.git","ssh_url":"git@github.com:purebred-mua/purebred-email.git","clone_url":"https://github.com/purebred-mua/purebred-email.git","svn_url":"https://github.com/purebred-mua/purebred-email","homepage":null,"size":88,"stargazers_count":1,"watchers_count":1,"language":"Haskell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0"},"forks":0,"open_issues":7,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/purebred-mua/purebred-email/pulls/12"},"html":{"href":"https://github.com/purebred-mua/purebred-email/pull/12"},"issue":{"href":"https://api.github.com/repos/purebred-mua/purebred-email/issues/12"},"comments":{"href":"https://api.github.com/repos/purebred-mua/purebred-email/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/purebred-mua/purebred-email/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/purebred-mua/purebred-email/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/purebred-mua/purebred-email/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/purebred-mua/purebred-email/statuses/856aed154ae03a68570c7fa63cec1416eb318718"}},"author_association":"OWNER"}}
{"actor":{"display_login":"romanofski"}}