ChordPro

actor ChordPro

The ChordPro file parser

Parse a ‘ChordPro’ file

Process a directive

Process a section

Process a chord definition

Process a tab environment

Process a grid environment

Process a strum environment

Process a line

Process a chord

‘ChordPro’ directives

‘ChordPro’ section environments

Regex definitions

  • All the directives we know about

    Declaration

    Swift

    static let directives: [String]
  • The regex for a directive with an optional label

    /// ## Examples
    
    {title: The title of the song}
    {chorus}
    {start_of_verse}
    {start_of_verse: Last Verse}
    

    Note

    This needs an extension for ChoiceOf

    Declaration

    Swift

    static let directiveRegex: Regex<Regex<(Substring, ChordPro.Directive, String?)>.RegexOutput>
  • The regex for a normal line with optionalchords and/or lyrics

    /// ## Example
    
    [A]I sing you a [G]song!!
    

    Declaration

    Swift

    static let lineRegex: Regex<Regex<(Substring, Regex<OneOrMore<Substring>.RegexOutput>.RegexOutput?, Regex<OneOrMore<Substring>.RegexOutput>.RegexOutput?)>.RegexOutput>
  • Regex for brackets for chords and directives

    Declaration

    Swift

    static let bracketRegex: Regex<Regex<Capture<(Substring, Regex<OneOrMore<Substring>.RegexOutput>.RegexOutput)>.RegexOutput>.RegexOutput>
  • Regex for a chord

    Declaration

    Swift

    static let chordRegex: Regex<Regex<Regex<Regex<(Substring, Regex<OneOrMore<Substring>.RegexOutput>.RegexOutput)>.RegexOutput>.RegexOutput>.RegexOutput>