Code structure.
This commit is contained in:
parent
40bae65ab7
commit
27817ff3aa
7
src/GenericParser.purs
Normal file
7
src/GenericParser.purs
Normal file
@ -0,0 +1,7 @@
|
||||
module GenericParser
|
||||
( module GenericParser.Parser
|
||||
, module GenericParser.DomainParser
|
||||
) where
|
||||
|
||||
import GenericParser.Parser (Position, PositionString, Input, Error, Value, Result, Parser(..), parse, current_position, failError, fail, success, item, sat, digit, lower, upper, letter, alphanum, char, string, ident, nat, int, space, token, identifier, natural, integer, symbol, many1)
|
||||
import GenericParser.DomainParser (Size, DomainError(..), let_dig, let_dig_hyp, ldh_str, label_maxsize, max_domain_length, last_char, parse_last_char, tryMaybe, try, label, subdomain, eof, sub_eof, domain)
|
@ -1,4 +1,4 @@
|
||||
module BaseFunctions where
|
||||
module GenericParser.BaseFunctions where
|
||||
|
||||
import Prelude (between, (<>), (==))
|
||||
|
@ -1,5 +1,5 @@
|
||||
-- | `DomainParser` is a simple parser for domain names as described in RFC 1035.
|
||||
module DomainParser where
|
||||
module GenericParser.DomainParser where
|
||||
|
||||
import Prelude (bind, not, pure, ($), (&&), (*>), (<<<), (<>), (>), (-))
|
||||
|
||||
@ -12,10 +12,10 @@ import Data.String.CodeUnits as CU
|
||||
import Control.Alt ((<|>))
|
||||
-- import Control.Plus (empty)
|
||||
|
||||
import Parser (Parser(..)
|
||||
, success, failError
|
||||
, current_position
|
||||
, alphanum, char, letter, many1, parse, string)
|
||||
import GenericParser.Parser (Parser(..)
|
||||
, success, failError
|
||||
, current_position
|
||||
, alphanum, char, letter, many1, parse, string)
|
||||
|
||||
type Size = Int
|
||||
data DomainError
|
@ -1,4 +1,4 @@
|
||||
module Parser where
|
||||
module GenericParser.Parser where
|
||||
import Prelude
|
||||
|
||||
import Control.Alt (class Alt, (<|>))
|
||||
@ -12,7 +12,7 @@ import Data.Either (Either(..))
|
||||
import Data.Maybe (Maybe(..))
|
||||
import Data.String.CodeUnits (toCharArray, fromCharArray)
|
||||
|
||||
import BaseFunctions (concat, isAlpha, isAlphaNum, isDigit, isLower, isSpace, isUpper)
|
||||
import GenericParser.BaseFunctions (concat, isAlpha, isAlphaNum, isDigit, isLower, isSpace, isUpper)
|
||||
|
||||
type Position = Int
|
||||
type PositionString = { string :: String, position :: Position }
|
@ -1,7 +1,7 @@
|
||||
module Main where
|
||||
|
||||
import Parser (Parser(..))
|
||||
import DomainParser (domain, label, ldh_str, sub_eof, subdomain, DomainError(..))
|
||||
import GenericParser.Parser (Parser(..))
|
||||
import GenericParser.DomainParser (domain, label, ldh_str, sub_eof, subdomain, DomainError(..))
|
||||
|
||||
import Prelude (Unit, discard, show, ($), (<>))
|
||||
import Data.Either (Either(..))
|
||||
|
Loading…
Reference in New Issue
Block a user