Skip to content

Add lower parser to Text.Parsing.Parser.String.Basic #152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ New features:

Bugfixes:

Other improvements:
Other improvements: Add `lower` parser to Text.Parsing.Parser.String.Basic.

## [v8.2.0](https://github.com/purescript-contrib/purescript-parsing/releases/tag/v8.2.0) - 2022-01-26

Expand Down
1 change: 1 addition & 0 deletions spago.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
, "tailrec"
, "transformers"
, "tuples"
, "unfoldable"
, "unicode"
, "unsafe-coerce"
]
Expand Down
7 changes: 6 additions & 1 deletion src/Text/Parsing/Parser/String/Basic.purs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module Text.Parsing.Parser.String.Basic
, octDigit
, letter
, space
, lower
, upper
, alphaNum
, intDecimal
Expand All @@ -19,7 +20,7 @@ module Text.Parsing.Parser.String.Basic

import Prelude

import Data.CodePoint.Unicode (isAlpha, isAlphaNum, isDecDigit, isHexDigit, isOctDigit, isSpace, isUpper)
import Data.CodePoint.Unicode (isAlpha, isAlphaNum, isDecDigit, isHexDigit, isLower, isOctDigit, isSpace, isUpper)
import Data.Int as Data.Int
import Data.Maybe (Maybe(..))
import Data.Number (infinity, nan)
Expand All @@ -44,6 +45,10 @@ hexDigit = satisfyCP isHexDigit <?> "hex digit"
octDigit :: forall m. Monad m => ParserT String m Char
octDigit = satisfyCP isOctDigit <?> "oct digit"

-- | Parse a lowercase letter. Matches any char that satisfies `Data.CodePoint.Unicode.isLower`.
lower :: forall m. Monad m => ParserT String m Char
lower = satisfyCP isLower <?> "lowercase letter"

-- | Parse an uppercase letter. Matches any char that satisfies `Data.CodePoint.Unicode.isUpper`.
upper :: forall m. Monad m => ParserT String m Char
upper = satisfyCP isUpper <?> "uppercase letter"
Expand Down