Fix a few (documentation) comments for RFC5322.

master
Philippe Pittoli 2024-02-21 01:35:48 +01:00
parent d30d9d74ce
commit fe3996829b
1 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,6 @@
-- | `EmailAddress` is a parser for email addresses, implementing the grammar found in RFC5322. -- | This module implements the email address grammar found in RFC5322.
-- | -- |
-- | STATUS: the parser mostly works, except for comments. -- | STATUS: the parser works except for comments.
-- | Comments provoke a stack overflow, this must be investigated. -- | Comments provoke a stack overflow, this must be investigated.
-- | -- |
-- | Also, the parser needs a thorough review. -- | Also, the parser needs a thorough review.
@ -171,7 +171,7 @@ group_list = mailbox_list <|> cfws <|> obs_group_list
-- | Printable US-ASCII characters not including specials. -- | Printable US-ASCII characters not including specials.
-- | -- |
-- | atext = `ALPHA / DIGIT / "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" /` -- | atext = `ALPHA / DIGIT / "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" /`
-- | `"-" / "/" / "=" / "?" / "^" / "_" / "`" / "{" / "|" / "}" / "~"` -- | `"-" / "/" / "=" / "?" / "^" / "_" / backquote / "{" / "|" / "}" / "~"`
atext :: forall e. Parser e Char atext :: forall e. Parser e Char
atext = alphanum atext = alphanum
<|> char '!' <|> char '#' <|> char '!' <|> char '#'
@ -537,9 +537,11 @@ qcontent = CU.singleton <$> qtext <|> quoted_pair
-- | -- |
-- | -- |
-- | Original RFC5322 rule: -- | Original RFC5322 rule:
-- |
-- | quoted-string = `[CFWS] DQUOTE *([FWS] qcontent) [FWS] DQUOTE [CFWS]` -- | quoted-string = `[CFWS] DQUOTE *([FWS] qcontent) [FWS] DQUOTE [CFWS]`
-- | -- |
-- | Implemented rule: -- | Implemented rule:
-- |
-- | quoted-string = `[CFWS] DQUOTE *([CRLF] qcontent) [FWS] DQUOTE [CFWS]` -- | quoted-string = `[CFWS] DQUOTE *([CRLF] qcontent) [FWS] DQUOTE [CFWS]`
quoted_string :: forall e. Parser e String quoted_string :: forall e. Parser e String
quoted_string = do s <- tryMaybe cfws quoted_string = do s <- tryMaybe cfws