Skip to content

Commit

Permalink
Zip*Take*. (#18)
Browse files Browse the repository at this point in the history
* `Zip*` ⇒ `Take*`.

* Fixes example in `Parser.take(_:)`’s docs.
  • Loading branch information
jasdev authored Jan 25, 2021
1 parent dd2e6f2 commit 009dc6c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ extension Parser {
/// var input = "-1.5,1"[...].utf8
/// let output = Double.parser()
/// .skip(StartsWith(","))
/// .take(CGPoint.parser())
/// .take(Double.parser())
/// .map(Point.init)
/// .parse(&input) // => Point(x: -1.5, y: 1)
/// precondition(Substring(input) == "")
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Parsing
import XCTest

final class ZipTests: XCTestCase {
final class TakeTests: XCTestCase {
func testTake2Success() {
var input = "12345"[...]
XCTAssert(try ("1", "2") == XCTUnwrap(First().take(First()).parse(&input)))
Expand Down

0 comments on commit 009dc6c

Please sign in to comment.