Skip to content

Instantly share code, notes, and snippets.

@jasdev
Created January 25, 2021 16:02
Show Gist options
  • Select an option

  • Save jasdev/049780b80c79cbf58a5361a477b0e2ec to your computer and use it in GitHub Desktop.

Select an option

Save jasdev/049780b80c79cbf58a5361a477b0e2ec to your computer and use it in GitHub Desktop.
SRT parser sans validation.
let srtParser = Many(srtGroupParser, separator: Newline().skip(Newline())) // `separator` mirrors
// the blank line handling in `srtGroupParser`, while tucking away the explicit `\n` and `\r\n`
// logic — https://github.com/pointfreeco/swift-parsing/blob/dd2e6f2e8e7ca0211e81bf790044a314602fd7dd/Sources/Parsing/Parsers/Newline.swift#L14-L20
.skip(End())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment