Email address: WIP.
This commit is contained in:
parent
29eddd715b
commit
ec5109379a
@ -43,7 +43,7 @@ fws = do _ <- tryMaybe do _ <- A.many wsp
|
|||||||
void $ many1 wsp
|
void $ many1 wsp
|
||||||
<|> obs_fws
|
<|> obs_fws
|
||||||
|
|
||||||
-- | ctext: printable US-ASCII characters.
|
-- | ctext: comment text, meaning printable US-ASCII characters excluding '(', ')' and '\'.
|
||||||
-- |
|
-- |
|
||||||
-- | ctext = %d33-39 / ; Printable US-ASCII
|
-- | ctext = %d33-39 / ; Printable US-ASCII
|
||||||
-- | %d42-91 / ; characters not including
|
-- | %d42-91 / ; characters not including
|
||||||
@ -79,9 +79,13 @@ comment = do _ <- char '('
|
|||||||
void ccontent)
|
void ccontent)
|
||||||
void $ char ')'
|
void $ char ')'
|
||||||
|
|
||||||
-- CFWS = (1*([FWS] comment) [FWS]) / FWS
|
-- | CFWS: comment folding white space.
|
||||||
--cfws :: forall e. Parser e String
|
-- |
|
||||||
--cfws = do
|
-- | CFWS = (1*([FWS] comment) [FWS]) / FWS
|
||||||
|
cfws :: forall e. Parser e Unit
|
||||||
|
cfws = do void $ many1 $ do _ <- tryMaybe fws
|
||||||
|
comment
|
||||||
|
<|> fws
|
||||||
|
|
||||||
-- address = mailbox / group
|
-- address = mailbox / group
|
||||||
--address :: forall e. Parser e String
|
--address :: forall e. Parser e String
|
||||||
@ -112,10 +116,12 @@ comment = do _ <- char '('
|
|||||||
-- domain = dot-atom / domain-literal / obs-domain
|
-- domain = dot-atom / domain-literal / obs-domain
|
||||||
--
|
--
|
||||||
-- domain-literal = [CFWS] "[" *([FWS] dtext) [FWS] "]" [CFWS]
|
-- domain-literal = [CFWS] "[" *([FWS] dtext) [FWS] "]" [CFWS]
|
||||||
--
|
|
||||||
-- dtext = %d33-90 / ; Printable US-ASCII
|
-- | dtext: characters in domains.
|
||||||
-- %d94-126 / ; characters not including
|
-- |
|
||||||
-- obs-dtext ; "[", "]", or "\"
|
-- | dtext = %d33-90 / ; Printable US-ASCII
|
||||||
|
-- | %d94-126 / ; characters not including
|
||||||
|
-- | obs-dtext ; "[", "]", or "\"
|
||||||
dtext :: forall e. Parser e Char
|
dtext :: forall e. Parser e Char
|
||||||
dtext = sat cond <|> obs_dtext
|
dtext = sat cond <|> obs_dtext
|
||||||
where cond x = let charcode = C.toCharCode x
|
where cond x = let charcode = C.toCharCode x
|
||||||
@ -144,11 +150,14 @@ dtext = sat cond <|> obs_dtext
|
|||||||
obs_dtext :: forall e. Parser e Char
|
obs_dtext :: forall e. Parser e Char
|
||||||
obs_dtext = obs_no_ws_ctl <|> quoted_pair
|
obs_dtext = obs_no_ws_ctl <|> quoted_pair
|
||||||
|
|
||||||
--obs-NO-WS-CTL = %d1-8 / ; US-ASCII control
|
-- | obs-NO-WS-CTL: US-ASCII control characters without carriage return,
|
||||||
-- %d11 / ; characters that do not
|
-- | line feed and white space characters.
|
||||||
-- %d12 / ; include the carriage
|
-- |
|
||||||
-- %d14-31 / ; return, line feed, and
|
-- | obs-NO-WS-CTL = %d1-8 / ; US-ASCII control
|
||||||
-- %d127 ; white space characters
|
-- | %d11 / ; characters that do not
|
||||||
|
-- | %d12 / ; include the carriage
|
||||||
|
-- | %d14-31 / ; return, line feed, and
|
||||||
|
-- | %d127 ; white space characters
|
||||||
obs_no_ws_ctl :: forall e. Parser e Char
|
obs_no_ws_ctl :: forall e. Parser e Char
|
||||||
obs_no_ws_ctl = sat cond
|
obs_no_ws_ctl = sat cond
|
||||||
where cond x = let charcode = C.toCharCode x
|
where cond x = let charcode = C.toCharCode x
|
||||||
@ -157,6 +166,8 @@ obs_no_ws_ctl = sat cond
|
|||||||
|| between 14 31 charcode
|
|| between 14 31 charcode
|
||||||
|| charcode == 127
|
|| charcode == 127
|
||||||
|
|
||||||
|
-- | obs-ctext: obsolete comment text.
|
||||||
|
-- |
|
||||||
-- | obs-ctext = obs-NO-WS-CTL
|
-- | obs-ctext = obs-NO-WS-CTL
|
||||||
obs_ctext :: forall e. Parser e Char
|
obs_ctext :: forall e. Parser e Char
|
||||||
obs_ctext = obs_no_ws_ctl
|
obs_ctext = obs_no_ws_ctl
|
||||||
|
Loading…
Reference in New Issue
Block a user