Skip to content

Instantly share code, notes, and snippets.

@jasdev
Last active January 25, 2021 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasdev/79f23abd4f2d15893d00aafd268fae41 to your computer and use it in GitHub Desktop.
Save jasdev/79f23abd4f2d15893d00aafd268fae41 to your computer and use it in GitHub Desktop.
Start of an SRT subtitle group parser.
let srtGroupParser = Int.parser(isSigned: false) // The sequence number.
.skip(Newline()) // ❌ “Generic struct ‘Newline’ requires the types ‘Substring.Element’
// (aka ‘Character’) and ‘UTF8.CodeUnit’ (aka ‘UInt8’) be equivalent.”
.take(timecodeLineParser)
.skip(Newline())
// …
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment