diff --git a/src/DomainParser.purs b/src/DomainParser.purs index bb996e6..3bcc59b 100644 --- a/src/DomainParser.purs +++ b/src/DomainParser.purs @@ -16,16 +16,16 @@ import Control.Plus (empty) import Parser --- From RFC 1035: ::= | +-- | From RFC 1035: ::= | let_dig :: Parser Char let_dig = alphanum --- From RFC 1035: ::= | "-" --- Either a Letter, Digital or an Hyphenation character. +-- | From RFC 1035: ::= | "-" +-- | Either a Letter, Digital or an Hyphenation character. let_dig_hyp :: Parser Char let_dig_hyp = let_dig <|> char '-' --- From RFC 1035: ::= | +-- | From RFC 1035: ::= | ldh_str :: Parser (Array Char) ldh_str = many1 let_dig_hyp @@ -33,6 +33,10 @@ ldh_str = many1 let_dig_hyp label_maxsize :: Int label_maxsize = 7 +-- TODO: 255? +max_domain_length :: Int +max_domain_length = 15 + last_char :: String -> Maybe Char last_char = A.last <<< CU.toCharArray @@ -54,7 +58,7 @@ try p = Parser p' Nothing -> Just (Tuple mempty str) -- FIXME! Need a better base structure. Just x -> pure x --- From RFC 1035: