Skip to content

Commit bdca060

Browse files
committed
Clarify the “consume” language a bit.
1 parent 5672106 commit bdca060

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/Parsing/Combinators.purs

+6-6
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ infixr 3 asErrorMessage as <??>
136136
between :: forall m s a open close. ParserT s m open -> ParserT s m close -> ParserT s m a -> ParserT s m a
137137
between open close p = open *> p <* close
138138

139-
-- | Provide a default result in the case where a parser fails without consuming input.
139+
-- | Provide a default result in the case where a parser fails without consuming.
140140
option :: forall m s a. a -> ParserT s m a -> ParserT s m a
141141
option a p = p <|> pure a
142142

@@ -146,11 +146,11 @@ option a p = p <|> pure a
146146
optional :: forall m s a. ParserT s m a -> ParserT s m Unit
147147
optional p = void p <|> pure unit
148148

149-
-- | pure `Nothing` in the case where a parser fails without consuming input.
149+
-- | pure `Nothing` in the case where a parser fails without consuming.
150150
optionMaybe :: forall m s a. ParserT s m a -> ParserT s m (Maybe a)
151151
optionMaybe p = option Nothing (Just <$> p)
152152

153-
-- | If the parser fails then backtrack the input stream to the unconsumed state.
153+
-- | If the parser fails then backtrack the input stream and reset to the unconsumed state.
154154
-- |
155155
-- | One use for this combinator is to ensure that the right parser of an
156156
-- | alternative will always be tried when the left parser fails.
@@ -173,7 +173,7 @@ try (ParserT k1) = ParserT
173173
done
174174
)
175175

176-
-- | If the parser fails then backtrack the input stream to the unconsumed state.
176+
-- | If the parser fails then backtrack the input stream and reset to the unconsumed state.
177177
-- |
178178
-- | Like `try`, but will reposition the error to the `try` point.
179179
-- |
@@ -209,7 +209,7 @@ lookAhead (ParserT k1) = ParserT
209209
-- |
210210
-- | Will match until the phrase `p` fails *without consuming*.
211211
-- |
212-
-- | If the phrase `p` fails after consuming input then the `many` will fail.
212+
-- | If the phrase `p` fails after consuming then the `many` will fail.
213213
-- |
214214
-- | If the phrase `p` is wrapped in `try` then it will never consume.
215215
-- | If phrase `p` never consumes then `many p` will always succeed,
@@ -375,7 +375,7 @@ skipMany1 p = p *> tailRecM go unit
375375

376376
-- | Fail if the parser succeeds.
377377
-- |
378-
-- | Will never consume input.
378+
-- | Will never consume.
379379
notFollowedBy :: forall s a m. ParserT s m a -> ParserT s m Unit
380380
notFollowedBy p = try $ (try p *> fail "Negated parser succeeded") <|> pure unit
381381

src/Parsing/Combinators/Array.purs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import Parsing (ParseError(..), ParserT, fail, parseErrorMessage, parseErrorPosi
3333
-- |
3434
-- | Will match until the phrase `p` fails *without consuming*.
3535
-- |
36-
-- | If the phrase `p` fails after consuming input then the `many` will fail.
36+
-- | If the phrase `p` fails after consuming then the `many` will fail.
3737
-- |
3838
-- | If the phrase `p` is wrapped in `try` then it will never consume.
3939
-- | If phrase `p` never consumes then `many p` will always succeed,

0 commit comments

Comments
 (0)