<?xml version="1.0"?>
<!--

 Lilypond basic language definition file
 Release date: 2017.08.08
 jphcombe.jpc@gmail.com

-->
<language id="lilypond" _name="Lilypond" version="2.0" _section="Markup">
  <metadata>
    <property name="mimetypes">text/x-lilypond</property>
    <property name="globs">*.ly;.ily</property>
    <property name="line-comment-start">%</property>
  </metadata>

  <styles>
    <style id="comment"           _name="Comment"           map-to="def:comment"/>
    <style id="include"           _name="Include"           map-to="def:keyword"/>
    <style id="header"            _name="Header"            map-to="def:type"/>
    <style id="string"            _name="String"            map-to="def:string"/>
    <style id="keyword"           _name="Keyword"           map-to="def:keyword"/>
    <style id="escaped-character" _name="Escaped Character" map-to="def:special-char"/>
  </styles>

  <default-regex-options case-sensitive="true"/>

  <definitions>

    <!-- Comment -->
    <context id="comment" style-ref="comment">
      <start>%</start>
      <end>$</end>
      <include>
        <context ref="def:in-comment"/>
      </include>
    </context>

    <!-- Keywords -->
    <context id="keyword" style-ref="keyword" class="no-spell-check">
 
      <prefix>\\</prefix>
 
      <keyword>abs-fontsize</keyword>
      <keyword>absolute</keyword>
      <keyword>accent</keyword>
      <keyword>accepts</keyword>
      <keyword>acciaccatura</keyword>
      <keyword>accidentalStyle</keyword>
      <keyword>addChordShape</keyword>
      <keyword>addInstrumentDefinition</keyword>
      <keyword>addlyrics</keyword>
      <keyword>addQuote</keyword>
      <keyword>aeolian</keyword>
      <keyword>afterGrace</keyword>
      <keyword>aikenHeads</keyword>
      <keyword>aikenHeadsMinor</keyword>
      <keyword>alias</keyword>
      <keyword>allowPageTurn</keyword>
      <keyword>alterBroken</keyword>
      <keyword>alternative</keyword>
      <keyword>appendToTag</keyword>
      <keyword>appoggiatura</keyword>
      <keyword>arpeggio</keyword>
      <keyword>arpeggioArrowDown</keyword>
      <keyword>arpeggioArrowUp</keyword>
      <keyword>arpeggioBracket</keyword>
      <keyword>arpeggioNormal</keyword>
      <keyword>arpeggioParenthesis</keyword>
      <keyword>arpeggioParenthesisDashed</keyword>
      <keyword>arrow-head</keyword>
      <keyword>ascendens</keyword>
      <keyword>auctum</keyword>
      <keyword>augmentum</keyword>
      <keyword>auto-footnote</keyword>
      <keyword>autoBeamOff</keyword>
      <keyword>autoBeamOn</keyword>
      <keyword>autochange</keyword>
      <keyword>backslashed-digit</keyword>
      <keyword>balloonGrobText</keyword>
      <keyword>balloonLengthOff</keyword>
      <keyword>balloonLengthOn</keyword>
      <keyword>balloonText</keyword>
      <keyword>bar</keyword>
      <keyword>barNumberCheck</keyword>
      <keyword>beam</keyword>
      <keyword>bendAfter</keyword>
      <keyword>bold</keyword>
      <keyword>book</keyword>
      <keyword>bookOutputName</keyword>
      <keyword>bookOutputSuffix</keyword>
      <keyword>bookpart</keyword>
      <keyword>box</keyword>
      <keyword>bracket</keyword>
      <keyword>break</keyword>
      <keyword>breathe</keyword>
      <keyword>breve</keyword>
      <keyword>cadenzaOff</keyword>
      <keyword>cadenzaOn</keyword>
      <keyword>caesura</keyword>
      <keyword>caps</keyword>
      <keyword>cavum</keyword>
      <keyword>center-align</keyword>
      <keyword>center-column</keyword>
      <keyword>change</keyword>
      <keyword>char</keyword>
      <keyword>chordmode</keyword>
      <keyword>chordRepeats</keyword>
      <keyword>chords</keyword>
      <keyword>circle</keyword>
      <keyword>clef</keyword>
      <keyword>cm</keyword>
      <keyword>coda</keyword>
      <keyword>column</keyword>
      <keyword>column-lines</keyword>
      <keyword>combine</keyword>
      <keyword>compoundMeter</keyword>
      <keyword>compressFullBarRests</keyword>
      <keyword>concat</keyword>
      <keyword>consists</keyword>
      <keyword>context</keyword>
      <keyword>cr</keyword>
      <keyword>cresc</keyword>
      <keyword>crescHairpin</keyword>
      <keyword>crescTextCresc</keyword>
      <keyword>crossStaff</keyword>
      <keyword>cueClef</keyword>
      <keyword>cueDuring</keyword>
      <keyword>cueDuringWithClef</keyword>
      <keyword>customTabClef</keyword>
      <keyword>decr</keyword>
      <keyword>decresc</keyword>
      <keyword>defaultchild</keyword>
      <keyword>defaultTimeSignature</keyword>
      <keyword>defineBarLine</keyword>
      <keyword>deminutum</keyword>
      <keyword>denies</keyword>
      <keyword>descendens</keyword>
      <keyword>dim</keyword>
      <keyword>dimHairpin</keyword>
      <keyword>dimTextDecr</keyword>
      <keyword>dimTextDecresc</keyword>
      <keyword>dimTextDim</keyword>
      <keyword>dir-column</keyword>
      <keyword>discant</keyword>
      <keyword>displayLilyMusic</keyword>
      <keyword>divisioMaior</keyword>
      <keyword>divisioMaxima</keyword>
      <keyword>divisioMinima</keyword>
      <keyword>dorian</keyword>
      <keyword>dotsDown</keyword>
      <keyword>dotsNeutral</keyword>
      <keyword>dotsUp</keyword>
      <keyword>doubleflat</keyword>
      <keyword>doublesharp</keyword>
      <keyword>downbow</keyword>
      <keyword>downmordent</keyword>
      <keyword>downprall</keyword>
      <keyword>draw-circle</keyword>
      <keyword>draw-dashed-line</keyword>
      <keyword>draw-dotted-line</keyword>
      <keyword>draw-hline</keyword>
      <keyword>draw-line</keyword>
      <keyword>drummode</keyword>
      <keyword>dynamic</keyword>
      <keyword>dynamicDown</keyword>
      <keyword>dynamicNeutral</keyword>
      <keyword>dynamicUp</keyword>
      <keyword>easyHeadsOff</keyword>
      <keyword>easyHeadsOn</keyword>
      <keyword>ellipse</keyword>
      <keyword>epsfile</keyword>
      <keyword>espressivo</keyword>
      <keyword>expandFullBarRests</keyword>
      <keyword>eyeglasses</keyword>
      <keyword>f</keyword>
      <keyword>featherDurations</keyword>
      <keyword>fermata</keyword>
      <keyword>fermataMarkup</keyword>
      <keyword>ff</keyword>
      <keyword>fff</keyword>
      <keyword>ffff</keyword>
      <keyword>fffff</keyword>
      <keyword>fill-line</keyword>
      <keyword>fill-with-pattern</keyword>
      <keyword>filled-box</keyword>
      <keyword>finalis</keyword>
      <keyword>finger</keyword>
      <keyword>flageolet</keyword>
      <keyword>flat</keyword>
      <keyword>flexa</keyword>
      <keyword>fontCaps</keyword>
      <keyword>fontsize</keyword>
      <keyword>footnote</keyword>
      <keyword>fp</keyword>
      <keyword>fraction</keyword>
      <keyword>freeBass</keyword>
      <keyword>frenchChords</keyword>
      <keyword>fret-diagram</keyword>
      <keyword>fret-diagram-terse</keyword>
      <keyword>fret-diagram-verbose</keyword>
      <keyword>fromproperty</keyword>
      <keyword>funkHeads</keyword>
      <keyword>funkHeadsMinor</keyword>
      <keyword>general-align</keyword>
      <keyword>germanChords</keyword>
      <keyword>glissando</keyword>
      <keyword>grace</keyword>
      <keyword>halfopen</keyword>
      <keyword>halign</keyword>
      <keyword>harmonic</keyword>
      <keyword>harmonicByFret</keyword>
      <keyword>harmonicByRatio</keyword>
      <keyword>harmonicsOff</keyword>
      <keyword>harmonicsOn</keyword>
      <keyword>harp-pedal</keyword>
      <keyword>hbracket</keyword>
      <keyword>hcenter-in</keyword>
      <keyword>header</keyword>
      <keyword>hide</keyword>
      <keyword>hideKeySignature</keyword>
      <keyword>hideNotes</keyword>
      <keyword>hideSplitTiedTabNotes</keyword>
      <keyword>hideStaffSwitch</keyword>
      <keyword>hspace</keyword>
      <keyword>huge</keyword>
      <keyword>improvisationOff</keyword>
      <keyword>improvisationOn</keyword>
      <keyword>in</keyword>
      <keyword>inclinatum</keyword>
      <keyword>inStaffSegno</keyword>
      <keyword>instrumentSwitch</keyword>
      <keyword>inversion</keyword>
      <keyword>ionian</keyword>
      <keyword>italianChords</keyword>
      <keyword>italic</keyword>
      <keyword>justified-lines</keyword>
      <keyword>justify</keyword>
      <keyword>justify-field</keyword>
      <keyword>justify-string</keyword>
      <keyword>keepWithTag</keyword>
      <keyword>key</keyword>
      <keyword>killCues</keyword>
      <keyword>label</keyword>
      <keyword>laissezVibrer</keyword>
      <keyword>large</keyword>
      <keyword>larger</keyword>
      <keyword>layout</keyword>
      <keyword>left-align</keyword>
      <keyword>left-brace</keyword>
      <keyword>left-column</keyword>
      <keyword>lheel</keyword>
      <keyword>line</keyword>
      <keyword>linea</keyword>
      <keyword>lineprall</keyword>
      <keyword>locrian</keyword>
      <keyword>longa</keyword>
      <keyword>longfermata</keyword>
      <keyword>lookup</keyword>
      <keyword>lower</keyword>
      <keyword>ltoe</keyword>
      <keyword>lydian</keyword>
      <keyword>lyricmode</keyword>
      <keyword>lyricsto</keyword>
      <keyword>magnify</keyword>
      <keyword>major</keyword>
      <keyword>makeClusters</keyword>
      <keyword>map-markup-commands</keyword>
      <keyword>marcato</keyword>
      <keyword>mark</keyword>
      <keyword>markalphabet</keyword>
      <keyword>markLengthOff</keyword>
      <keyword>markLengthOn</keyword>
      <keyword>markletter</keyword>
      <keyword>markup</keyword>
      <keyword>markuplist</keyword>
      <keyword>maxima</keyword>
      <keyword>medium</keyword>
      <keyword>melisma</keyword>
      <keyword>melismaEnd</keyword>
      <keyword>mergeDifferentlyDottedOff</keyword>
      <keyword>mergeDifferentlyDottedOn</keyword>
      <keyword>mergeDifferentlyHeadedOff</keyword>
      <keyword>mergeDifferentlyHeadedOn</keyword>
      <keyword>mf</keyword>
      <keyword>midi</keyword>
      <keyword>minor</keyword>
      <keyword>mixolydian</keyword>
      <keyword>mm</keyword>
      <keyword>modalInversion</keyword>
      <keyword>modalTranspose</keyword>
      <keyword>mordent</keyword>
      <keyword>mp</keyword>
      <keyword>musicglyph</keyword>
      <keyword>name</keyword>
      <keyword>natural</keyword>
      <keyword>new</keyword>
      <keyword>newSpacingSection</keyword>
      <keyword>noBeam</keyword>
      <keyword>noBreak</keyword>
      <keyword>noPageBreak</keyword>
      <keyword>noPageTurn</keyword>
      <keyword>normal-size-sub</keyword>
      <keyword>normal-size-super</keyword>
      <keyword>normal-text</keyword>
      <keyword>normalsize</keyword>
      <keyword>note</keyword>
      <keyword>note-by-number</keyword>
      <keyword>null</keyword>
      <keyword>number</keyword>
      <keyword>numericTimeSignature</keyword>
      <keyword>octaveCheck</keyword>
      <keyword>omit</keyword>
      <keyword>on-the-fly</keyword>
      <keyword>once</keyword>
      <keyword>oneVoice</keyword>
      <keyword>open</keyword>
      <keyword>oriscus</keyword>
      <keyword>ottava</keyword>
      <keyword>oval</keyword>
      <keyword>override</keyword>
      <keyword>override-lines</keyword>
      <keyword>overrideProperty</keyword>
      <keyword>overrideTimeSignatureSettings</keyword>
      <keyword>p</keyword>
      <keyword>pad-around</keyword>
      <keyword>pad-markup</keyword>
      <keyword>pad-to-box</keyword>
      <keyword>pad-x</keyword>
      <keyword>page-link</keyword>
      <keyword>page-ref</keyword>
      <keyword>pageBreak</keyword>
      <keyword>pageTurn</keyword>
      <keyword>paper</keyword>
      <keyword>parallelMusic</keyword>
      <keyword>parenthesize</keyword>
      <keyword>partcombine</keyword>
      <keyword>partcombine et paroles</keyword>
      <keyword>partcombineApart</keyword>
      <keyword>partcombineAutomatic</keyword>
      <keyword>partcombineChords</keyword>
      <keyword>partcombineSoloI</keyword>
      <keyword>partcombineSoloII</keyword>
      <keyword>partcombineUnisono</keyword>
      <keyword>partial</keyword>
      <keyword>path</keyword>
      <keyword>pattern</keyword>
      <keyword>pes</keyword>
      <keyword>phrasingSlurDashed</keyword>
      <keyword>phrasingSlurDashPattern</keyword>
      <keyword>phrasingSlurDotted</keyword>
      <keyword>phrasingSlurDown</keyword>
      <keyword>phrasingSlurHalfDashed</keyword>
      <keyword>phrasingSlurHalfSolid</keyword>
      <keyword>phrasingSlurNeutral</keyword>
      <keyword>phrasingSlurSolid</keyword>
      <keyword>phrasingSlurUp</keyword>
      <keyword>phrygian</keyword>
      <keyword>pitchedTrill</keyword>
      <keyword>portato</keyword>
      <keyword>postscript</keyword>
      <keyword>powerChords</keyword>
      <keyword>pp</keyword>
      <keyword>ppp</keyword>
      <keyword>pppp</keyword>
      <keyword>ppppp</keyword>
      <keyword>prall</keyword>
      <keyword>pralldown</keyword>
      <keyword>prallmordent</keyword>
      <keyword>prallprall</keyword>
      <keyword>prallup</keyword>
      <keyword>predefinedFretboardsOff</keyword>
      <keyword>predefinedFretboardsOn</keyword>
      <keyword>property-recursive</keyword>
      <keyword>pt</keyword>
      <keyword>pushToTag</keyword>
      <keyword>put-adjacent</keyword>
      <keyword>quilisma</keyword>
      <keyword>quoteDuring</keyword>
      <keyword>raise</keyword>
      <keyword>relative</keyword>
      <keyword>RemoveEmptyStaves</keyword>
      <keyword>removeWithTag</keyword>
      <keyword>repeat</keyword>
      <keyword>repeat percent</keyword>
      <keyword>repeat tremolo</keyword>
      <keyword>repeat unfold</keyword>
      <keyword>repeatTie</keyword>
      <keyword>replace</keyword>
      <keyword>rest</keyword>
      <keyword>rest-by-number</keyword>
      <keyword>retrograde</keyword>
      <keyword>reverseturn</keyword>
      <keyword>revert</keyword>
      <keyword>revertTimeSignatureSettings</keyword>
      <keyword>rfz</keyword>
      <keyword>rheel</keyword>
      <keyword>right-align</keyword>
      <keyword>right-brace</keyword>
      <keyword>right-column</keyword>
      <keyword>rightHandFinger</keyword>
      <keyword>roman</keyword>
      <keyword>rotate</keyword>
      <keyword>rounded-box</keyword>
      <keyword>rtoe</keyword>
      <keyword>sacredHarpHeads</keyword>
      <keyword>sacredHarpHeadsMinor</keyword>
      <keyword>sans</keyword>
      <keyword>scale</keyword>
      <keyword>scaleDurations</keyword>
      <keyword>score</keyword>
      <keyword>segno</keyword>
      <keyword>semiflat</keyword>
      <keyword>semiGermanChords</keyword>
      <keyword>semisharp</keyword>
      <keyword>sesquiflat</keyword>
      <keyword>sesquisharp</keyword>
      <keyword>set</keyword>
      <keyword>sf</keyword>
      <keyword>sff</keyword>
      <keyword>sfz</keyword>
      <keyword>shape</keyword>
      <keyword>sharp</keyword>
      <keyword>shiftOff</keyword>
      <keyword>shiftOn</keyword>
      <keyword>shiftOnn</keyword>
      <keyword>shiftOnnn</keyword>
      <keyword>shortfermata</keyword>
      <keyword>showKeySignature</keyword>
      <keyword>showStaffSwitch</keyword>
      <keyword>signumcongruentiae</keyword>
      <keyword>simple</keyword>
      <keyword>skip</keyword>
      <keyword>slashed-digit</keyword>
      <keyword>slashedGrace</keyword>
      <keyword>slurDashed</keyword>
      <keyword>slurDashPattern</keyword>
      <keyword>slurDotted</keyword>
      <keyword>slurDown</keyword>
      <keyword>slurHalfDashed</keyword>
      <keyword>slurHalfSolid</keyword>
      <keyword>slurNeutral</keyword>
      <keyword>slurSolid</keyword>
      <keyword>slurUp</keyword>
      <keyword>small</keyword>
      <keyword>smallCaps</keyword>
      <keyword>smaller</keyword>
      <keyword>snappizzicato</keyword>
      <keyword>sostenutoOff</keyword>
      <keyword>sostenutoOn</keyword>
      <keyword>southernHarmonyHeads</keyword>
      <keyword>southernHarmonyHeadsMinor</keyword>
      <keyword>sp</keyword>
      <keyword>spp</keyword>
      <keyword>staccatissimo</keyword>
      <keyword>staccato</keyword>
      <keyword>startGroup</keyword>
      <keyword>startStaff</keyword>
      <keyword>startTrillSpan</keyword>
      <keyword>stdBass</keyword>
      <keyword>stdBassIV</keyword>
      <keyword>stdBassV</keyword>
      <keyword>stdBassVI</keyword>
      <keyword>stemDown</keyword>
      <keyword>stemNeutral</keyword>
      <keyword>stemUp</keyword>
      <keyword>stencil</keyword>
      <keyword>stopGroup</keyword>
      <keyword>stopped</keyword>
      <keyword>stopStaff</keyword>
      <keyword>stopTrillSpan</keyword>
      <keyword>storePredefinedDiagram</keyword>
      <keyword>stringTuning</keyword>
      <keyword>stropha</keyword>
      <keyword>strut</keyword>
      <keyword>sub</keyword>
      <keyword>super</keyword>
      <keyword>sustainOff</keyword>
      <keyword>sustainOn</keyword>
      <keyword>tabChordRepeats</keyword>
      <keyword>tabFullNotation</keyword>
      <keyword>table-of-contents</keyword>
      <keyword>tag</keyword>
      <keyword>taor</keyword>
      <keyword>teeny</keyword>
      <keyword>tempo</keyword>
      <keyword>tenuto</keyword>
      <keyword>text</keyword>
      <keyword>textLengthOff</keyword>
      <keyword>textLengthOn</keyword>
      <keyword>textSpannerDown</keyword>
      <keyword>textSpannerNeutral</keyword>
      <keyword>textSpannerUp</keyword>
      <keyword>thumb</keyword>
      <keyword>tied-lyric</keyword>
      <keyword>tieDashed</keyword>
      <keyword>tieDotted</keyword>
      <keyword>tieDown</keyword>
      <keyword>tieNeutral</keyword>
      <keyword>tieSolid</keyword>
      <keyword>tieUp</keyword>
      <keyword>time</keyword>
      <keyword>times</keyword>
      <keyword>tiny</keyword>
      <keyword>tocItem</keyword>
      <keyword>translate</keyword>
      <keyword>translate-scaled</keyword>
      <keyword>transparent</keyword>
      <keyword>transpose</keyword>
      <keyword>transposedCueDuring</keyword>
      <keyword>transposition</keyword>
      <keyword>treCorde</keyword>
      <keyword>triangle</keyword>
      <keyword>trill</keyword>
      <keyword>tuplet</keyword>
      <keyword>tupletDown</keyword>
      <keyword>tupletNeutral</keyword>
      <keyword>tupletUp</keyword>
      <keyword>turn</keyword>
      <keyword>tweak</keyword>
      <keyword>type</keyword>
      <keyword>typewriter</keyword>
      <keyword>unaCorda</keyword>
      <keyword>underline</keyword>
      <keyword>unfoldRepeats</keyword>
      <keyword>unHideNotes</keyword>
      <keyword>unset</keyword>
      <keyword>upbow</keyword>
      <keyword>upmordent</keyword>
      <keyword>upprall</keyword>
      <keyword>upright</keyword>
      <keyword>varcoda</keyword>
      <keyword>vcenter</keyword>
      <keyword>verbatim-file</keyword>
      <keyword>verylongfermata</keyword>
      <keyword>virga</keyword>
      <keyword>virgula</keyword>
      <keyword>voiceFourStyle</keyword>
      <keyword>voiceNeutralStyle</keyword>
      <keyword>voiceOne</keyword>
      <keyword>voiceTwo</keyword>
      <keyword>voiceThree</keyword>
      <keyword>voiceFour</keyword>
      <keyword>voiceOneStyle</keyword>
      <keyword>voiceThreeStyle</keyword>
      <keyword>voiceTwoStyle</keyword>
      <keyword>void</keyword>
      <keyword>vspace</keyword>
      <keyword>walkerHeads</keyword>
      <keyword>walkerHeadsMinor</keyword>
      <keyword>whiteout</keyword>
      <keyword>with</keyword>
      <keyword>with-color</keyword>
      <keyword>with-dimensions</keyword>
      <keyword>with-link</keyword>
      <keyword>with-url</keyword>
      <keyword>woodwind-diagram</keyword>
      <keyword>wordwrap</keyword>
      <keyword>wordwrap-field</keyword>
      <keyword>wordwrap-internal</keyword>
      <keyword>wordwrap-lines</keyword>
      <keyword>wordwrap-string</keyword>
      <keyword>wordwrap-string-internal</keyword>

    </context>

    <!-- Header -->
    <context id="header" style-ref="header">
      <keyword>arranger</keyword>
      <keyword>composer</keyword>
      <keyword>copyright</keyword>
      <keyword>dedication</keyword>
      <keyword>instrument</keyword>
      <keyword>meter</keyword>
      <keyword>opus</keyword>
      <keyword>piece</keyword>
      <keyword>poet</keyword>
      <keyword>subtitle</keyword>
      <keyword>subsubtitle</keyword>
      <keyword>tagline</keyword>
      <keyword>title</keyword>
    </context>

    <!-- String -->
    <context id="string" end-at-line-end="true" style-ref="string">
      <start>"</start>
      <end>"</end>
      <include>
        <context id="escape" style-ref="escaped-character">
          <match>\\.</match>
        </context>
      </include>
    </context>

    <!-- Include -->
    <context id="include" class="no-spell-check">
      <match>(\\(include))\b(\[.*\])?(\{.*\})?</match>
      <include>
        <context sub-pattern="1" style-ref="include"/>
      </include>
    </context>

    <context id="lilypond">
      <include>
        <context ref="comment"/>
        <context ref="include"/>
        <context ref="header"/>
        <context ref="string"/>
        <context ref="keyword"/>
      </include>
    </context>

  </definitions>
</language>
