Docs
This commit is contained in:
@@ -135,7 +135,8 @@ proc ignore*(parserFn: parserFnT): parserFnT {.inline.} =
|
|||||||
))
|
))
|
||||||
|
|
||||||
proc manyUntil*(acceptFn: parserFnT, stopFn: parserFnT): parserFnT {.inline.} =
|
proc manyUntil*(acceptFn: parserFnT, stopFn: parserFnT): parserFnT {.inline.} =
|
||||||
## Parse characters but throw success tokens away
|
## Creates parser function with a nested `acceptFn` parser function until the `stopFn` parserFunction is met:
|
||||||
|
## Parses until the `stopFn` is reached or on an errror.
|
||||||
return proc(parser: Parser): ParserResult =
|
return proc(parser: Parser): ParserResult =
|
||||||
var res: ParserResult = parser.ok()
|
var res: ParserResult = parser.ok()
|
||||||
while res.isOk() and res.flatMap(stopFn).isErr():
|
while res.isOk() and res.flatMap(stopFn).isErr():
|
||||||
|
|||||||
Reference in New Issue
Block a user