diff --git a/src/GenericParser/EmailAddress.purs b/src/GenericParser/EmailAddress.purs index 66ce10c..21689f8 100644 --- a/src/GenericParser/EmailAddress.purs +++ b/src/GenericParser/EmailAddress.purs @@ -65,9 +65,9 @@ quoted_pair = do _ <- char '\\' pure $ "\\" <> CU.singleton v <|> obs_qp --- | ccontent = ctext / quoted-pair / comment --- | -- | Comment content. +-- | +-- | ccontent = ctext / quoted-pair / comment ccontent :: forall e. Parser e Unit ccontent = a_ctext <|> a_quoted_pair <|> comment where a_ctext :: Parser e Unit @@ -92,19 +92,48 @@ cfws = do void $ many1 $ do _ <- tryMaybe fws comment <|> fws --- address = mailbox / group +-- | TODO: `address`: email address. +-- | +-- | address = mailbox / group --address :: forall e. Parser e String ---address = do +--address = mailbox <|> group + +-- | TODO: `mailbox`: mail address. +-- | +-- | mailbox = name-addr / addr-spec +--mailbox :: forall e. Parser e String +--mailbox = name_addr <|> addr_spec + +-- | TODO: `name_addr`: address name. +-- | +-- | name-addr = [display-name] angle-addr +--name_addr :: forall e. Parser e String +--name_addr = do _ <- tryMaybe display_name +-- angle_addr + +-- | TODO: `angle_addr` address specification between '<' and '>' characters. +-- | +-- | angle-addr = [CFWS] "<" addr-spec ">" [CFWS] / obs-angle-addr +--angle_addr :: forall e. Parser e String +--angle_addr = do _ <- tryMaybe cfws +-- _ <- char '<' +-- a <- addr_spec +-- _ <- char '>' +-- _ <- tryMaybe cfws +-- pure a +-- <|> obs_angle_addr + +-- | TODO: `group`: a list of email addresses. +-- | +-- | group = display-name ":" [group-list] ";" [CFWS] +--group :: forall e. Parser e (Array String) +--group = do _ <- display_name +-- _ <- char ':' +-- mg <- tryMaybe group_list +-- _ <- char ';' +-- _ <- tryMaybe cfws +-- pure $ maybe [] xs ---mailbox = name-addr / addr-spec --- ---name-addr = [display-name] angle-addr --- ---angle-addr = [CFWS] "<" addr-spec ">" [CFWS] / --- obs-angle-addr --- ---group = display-name ":" [group-list] ";" [CFWS] --- --display-name = phrase -- --mailbox-list = (mailbox *("," mailbox)) / obs-mbox-list @@ -133,8 +162,18 @@ dtext = CU.singleton <$> sat cond <|> obs_dtext in between 33 90 charcode || between 94 126 charcode ---obs-angle-addr = [CFWS] "<" obs-route addr-spec ">" [CFWS] --- +-- | TODO: `obs_angle_addr`: obsolete address specification between '<' and '>' characters. +-- | +-- | obs-angle-addr = [CFWS] "<" obs-route addr-spec ">" [CFWS] +--obs_angle_addr :: forall e. Parser e String +--obs_angle_addr = do _ <- tryMaybe cfws +-- _ <- char '<' +-- r <- obs_route +-- a <- addr_spec +-- _ <- char '>' +-- _ <- tryMaybe cfws +-- pure $ r <> a + --obs-route = obs-domain-list ":" -- --obs-domain-list = *(CFWS / ",") "@" domain @@ -150,7 +189,8 @@ dtext = CU.singleton <$> sat cond <|> obs_dtext -- --obs-domain = atom *("." atom) --- | TODO: Obsolete domain text. +-- | `obs_dtext`: obsolete domain text. +-- | -- | obs-dtext = obs-NO-WS-CTL / quoted-pair obs_dtext :: forall e. Parser e String obs_dtext = CU.singleton <$> obs_no_ws_ctl <|> quoted_pair @@ -181,8 +221,9 @@ obs_ctext = obs_no_ws_ctl obs_qtext :: forall e. Parser e Char obs_qtext = obs_no_ws_ctl ---obs-utext = %d0 / obs-NO-WS-CTL / VCHAR - +-- | TODO: `obs_utext`: obsolete text. +-- | +-- | obs-utext = %d0 / obs-NO-WS-CTL / VCHAR -- | `obs_qp`: obsolete quoted-pair rule. -- |