ChordPro
enum ChordPro
The ChordPro
file parser
-
Process a section
Declaration
Swift
private static func processSection(label: String, type: Environment, song: inout Song, currentSection: inout Song.Section)
Parameters
label
The label of the
section
type
The type of
section
song
The
song
currentSection
The current
section
of thesong
-
Process a chord definition
Declaration
Swift
private static func processDefine(text: String, song: inout Song)
Parameters
text
The chord definition
song
The
song
-
The directives Chord Provider supports
See moreDeclaration
Swift
enum Directive : String, CaseIterable
-
The environment of a section of the song
See moreDeclaration
Swift
enum Environment : String
-
The regex for a
directive
with an optionallabel
/// ## Examples {title: The title of the song} {chorus} {start_of_verse} {start_of_verse: Last Verse}
Declaration
Swift
static let directiveRegex: Regex<Regex<(Substring, ChordPro.Directive, String?)>.RegexOutput>
-
The regex for a normal line with optional
chords
and/orlyrics
/// ## 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>