(Very minor) code clean-up.
This commit is contained in:
parent
7b5e92490d
commit
634aad96b7
@ -13,12 +13,12 @@ import Data.String as S
|
||||
import Data.String.CodeUnits as CU
|
||||
|
||||
-- Import all common functions between RFC1035 and modern domain parsing.
|
||||
import GenericParser.DomainParser.Common (DomainError(..), eof, ldh_str, let_dig, let_dig_hyp, max_domain_length, max_label_length, Size)
|
||||
import GenericParser.DomainParser.Common (DomainError(..), eof, ldh_str, let_dig, max_domain_length, max_label_length)
|
||||
|
||||
import GenericParser.Parser (Parser(..)
|
||||
, success, failureError
|
||||
, failureError
|
||||
, current_position
|
||||
, alphanum, char, letter, many1, parse, string
|
||||
, char, letter, parse, string
|
||||
, try, tryMaybe)
|
||||
|
||||
-- | From RFC 1035: <label> ::= <letter> [ [ <ldh-str> ] <let-dig> ]
|
||||
|
@ -121,8 +121,7 @@ try p = Parser p'
|
||||
_ -> failureError position error
|
||||
|
||||
sat :: forall e. (Char -> Boolean) -> Parser e Char
|
||||
sat p = do
|
||||
pos <- current_position
|
||||
sat p = do pos <- current_position
|
||||
x <- item
|
||||
if p x then pure x else Parser \input -> failure pos
|
||||
|
||||
|
@ -5,7 +5,7 @@ import GenericParser.DomainParser.Common (ldh_str, DomainError(..))
|
||||
import GenericParser.DomainParserRFC1035 as RFC1035
|
||||
import GenericParser.DomainParser as ModernDomains
|
||||
|
||||
import Prelude (Unit, discard, show, ($), (<>), map)
|
||||
import Prelude (Unit, discard, show, ($), (<>))
|
||||
import Data.Either (Either(..))
|
||||
import Data.Maybe (Maybe(..))
|
||||
import Data.String.CodeUnits (fromCharArray)
|
||||
|
Loading…
Reference in New Issue
Block a user