From 8e68099e52d28eaccd5bf5b84381f1e5d86a273d Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Sat, 27 Jan 2024 08:03:16 +0100 Subject: [PATCH] Split most parsers from the GenericParser.Parser module. --- src/GenericParser.purs | 5 +- src/GenericParser/DomainParser.purs | 3 +- src/GenericParser/DomainParser/Common.purs | 3 +- src/GenericParser/DomainParserRFC1035.purs | 3 +- src/GenericParser/EmailAddress.purs | 12 ++-- src/GenericParser/IPAddress.purs | 6 +- src/GenericParser/Parser.purs | 79 +++------------------- src/GenericParser/RFC5234.purs | 37 ++++++---- src/GenericParser/SomeParsers.purs | 70 +++++++++++++++++++ 9 files changed, 123 insertions(+), 95 deletions(-) create mode 100644 src/GenericParser/SomeParsers.purs diff --git a/src/GenericParser.purs b/src/GenericParser.purs index 9df9884..7e65e70 100644 --- a/src/GenericParser.purs +++ b/src/GenericParser.purs @@ -2,8 +2,11 @@ module GenericParser ( module GenericParser.Parser , module GenericParser.DomainParser.Common , module GenericParser.DomainParser + --, module GenericParser.RFC5234 ) where import GenericParser.DomainParser.Common (DomainError(..), ldh_str, let_dig, let_dig_hyp, max_domain_length, max_label_length, Size) import GenericParser.DomainParser (domain, label, subdomain, sub_eof) -import GenericParser.Parser (alphanum, char, current_input, current_position, digit, eof, Error, failure, failureError, hex, ident, identifier, Input, int, integer, item, letter, lookahead, lower, many1, nat, natural, parse, parse_last_char, Parser(..), Position, PositionString, Result, rollback, sat, space, string, success, symbol, token, try, tryMaybe, until, upper, Value) +import GenericParser.Parser (char, current_input, current_position, Error, failure, failureError, Input, item, lookahead, many1, parse, parse_last_char, Parser(..), Position, PositionString, Result, rollback, sat, string, success, try, tryMaybe, until, Value) +import GenericParser.SomeParsers (alphanum, eof, ident, identifier, int, integer, letter, lower, nat, natural, space, symbol, token, upper) +-- import GenericParser.RFC5234 () diff --git a/src/GenericParser/DomainParser.purs b/src/GenericParser/DomainParser.purs index 80d655a..9333bae 100644 --- a/src/GenericParser/DomainParser.purs +++ b/src/GenericParser/DomainParser.purs @@ -16,9 +16,10 @@ import GenericParser.DomainParser.Common (DomainError(..), eof, ldh_str, let_dig import GenericParser.Parser (Parser(..) , failureError , current_position - , char, letter, string + , char, string , parse_last_char , tryMaybe) +import GenericParser.SomeParsers (letter) -- | From RFC 1035: