Last active
January 26, 2021 01:42
-
-
Save jasdev/009695f6865774884e60b3a63f3ed86e to your computer and use it in GitHub Desktop.
Initial sketch of a timecode line parser to be used in an SRT file parser.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let timecodeParser = timecodeHours | |
.skip(StartsWith(":")) | |
.take(timecodeMinutes) | |
.skip(StartsWith(":")) | |
.take(timecodeSeconds) | |
.skip(StartsWith(",")) | |
.take(timecodeMilliseconds) // ⇒ Parser<Substring, (Int, Int, Int, Int)>. | |
let timecodeLineParser = timecodeParser | |
.skip(StartsWith(" --> ")) | |
.take(timecodeParser) // ⇒ Parser<Substring, (Int, Int, Int, Int, (Int, Int, Int, Int))> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment