Skip to content

Commit

Permalink
Simplify built-in highlighting queries
Browse files Browse the repository at this point in the history
  • Loading branch information
nwhetsell committed Aug 22, 2024
1 parent 80338f8 commit ec7e615
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions queries/highlights-builtins.scm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

(
(escaped_word) @identifier.core.function
(#match? @identifier.core.function "^\\\\(=|a(?:bsolute|cci(?:accatura|dentalStyle)|dd(?:ChordShape|InstrumentDefinition|Quote)|fter(?:(?:Grace)?)|l(?:low(?:PageTurn|VoltaHook)|terBroken)|mbitusAfter|pp(?:endToTag|ly(?:Context|Music|Output)|oggiatura)|ssertBeam(?:Quant|Slope)|utoChange)|b(?:a(?:lloon(?:(?:(?:Grob)?)Text)|r(?:(?:NumberCheck)?))|e(?:amExceptions|nd(?:After|Hold|StartLevel))|ookOutput(?:Name|Suffix)|reathe)|c(?:aesura|hordRepeats|lef|o(?:daMark|mp(?:oundMeter|ressMMRests))|rossStaff|ue(?:Clef(?:(?:Unset)?)|During(?:(?:WithClef)?)))|d(?:e(?:(?:adNot|fineBarLin)e)|isplay(?:LilyMusic|Music|Scheme)|ropNote)|e(?:n(?:ablePolymeter|dSpanners)|ventChords)|f(?:eatherDurations|i(?:nger|xed)|ootnote)|gr(?:ace|obdescriptions)|h(?:armonic(?:By(?:Fret|Ratio)|Note|sOn)|ide)|in(?:StaffSegno|cipit|herit\-acceptability|strumentSwitch|ver(?:sion|tChords))|jump|k(?:e(?:epWithTag|y)|illCues)|la(?:bel|nguage(?:(?:(?:Restor|SaveAndChang)e)?))|m(?:a(?:gnify(?:Music|Staff)|ke(?:Clusters|DefaultStringTuning)|rk(?:(?:upMap)?))|odal(?:Inversion|Transpose)|usicMap)|noPage(?:Break|Turn)|o(?:ctaveCheck|ffset|mit|nce|ttava|verride(?:Property|TimeSignatureSettings))|p(?:a(?:ge(?:Break|Turn)|lmMute(?:(?:On)?)|r(?:allelMusic|enthesize|t(?:Combine(?:(?:Down|Force|Up)?)|ial)))|hrasingSlurDashPattern|itchedTrill|ointAndClick(?:O(?:ff|n)|Types)|r(?:eBend(?:(?:Hold)?)|operty(?:Override|Revert|Set|Tweak|Unset))|ushToTag)|quoteDuring|r(?:aiseNote|e(?:duceChords|lative|moveWithTag|setRelativeOctave|trograde|vertTimeSignatureSettings)|ightHandFinger)|s(?:caleDurations|e(?:ctionLabel|gnoMark|ttingsFrom)|h(?:ape|iftDurations)|ingle|kip|l(?:ashedGrace|urDashPattern)|t(?:affHighlight|orePredefinedDiagram|ringTuning|yledNoteHeads))|t(?:a(?:bChordRepe(?:ats|tition)|g(?:(?:Group)?))|e(?:mporary|xt(?:(?:(?:End)?)Mark))|i(?:eDashPattern|me(?:(?:s)?))|ocItem|ranspos(?:e(?:(?:dCueDuring)?)|ition)|uplet(?:(?:Span)?)|weak)|un(?:do|fold(?:Repeats|ed))|v(?:o(?:i(?:ces|d)|lta)|shape)|withMusicProperty|xNote)$")
(#match? @identifier.core.function "^\\\\(=|a(?:bsolute|cci(?:accatura|dentalStyle)|dd(?:ChordShape|InstrumentDefinition|Quote)|fter(?:(?:Grace)?)|l(?:low(?:PageTurn|VoltaHook)|terBroken)|mbitusAfter|pp(?:endToTag|ly(?:Context|Music|Output)|oggiatura)|ssertBeam(?:Quant|Slope)|utoChange)|b(?:a(?:lloon(?:(?:(?:Grob)?)Text)|r(?:(?:NumberCheck)?))|e(?:amExceptions|nd(?:After|Hold|StartLevel))|ookOutput(?:Name|Suffix)|reathe)|c(?:aesura|hordRepeats|lef|o(?:daMark|mp(?:oundMeter|ressMMRests))|rossStaff|ue(?:Clef(?:(?:Unset)?)|During(?:(?:WithClef)?)))|d(?:e(?:(?:adNot|fineBarLin)e)|isplay(?:LilyMusic|Music|Scheme)|ropNote)|e(?:n(?:ablePolymeter|dSpanners)|ventChords)|f(?:eatherDurations|i(?:nger|xed)|ootnote)|gr(?:ace|obdescriptions)|h(?:armonic(?:By(?:Fret|Ratio)|Note|sOn)|ide)|in(?:StaffSegno|cipit|herit-acceptability|strumentSwitch|ver(?:sion|tChords))|jump|k(?:e(?:epWithTag|y)|illCues)|la(?:bel|nguage(?:(?:(?:Restor|SaveAndChang)e)?))|m(?:a(?:gnify(?:Music|Staff)|ke(?:Clusters|DefaultStringTuning)|rk(?:(?:upMap)?))|odal(?:Inversion|Transpose)|usicMap)|noPage(?:Break|Turn)|o(?:ctaveCheck|ffset|mit|nce|ttava|verride(?:Property|TimeSignatureSettings))|p(?:a(?:ge(?:Break|Turn)|lmMute(?:(?:On)?)|r(?:allelMusic|enthesize|t(?:Combine(?:(?:Down|Force|Up)?)|ial)))|hrasingSlurDashPattern|itchedTrill|ointAndClick(?:O(?:ff|n)|Types)|r(?:eBend(?:(?:Hold)?)|operty(?:Override|Revert|Set|Tweak|Unset))|ushToTag)|quoteDuring|r(?:aiseNote|e(?:duceChords|lative|moveWithTag|setRelativeOctave|trograde|vertTimeSignatureSettings)|ightHandFinger)|s(?:caleDurations|e(?:ctionLabel|gnoMark|ttingsFrom)|h(?:ape|iftDurations)|ingle|kip|l(?:ashedGrace|urDashPattern)|t(?:affHighlight|orePredefinedDiagram|ringTuning|yledNoteHeads))|t(?:a(?:bChordRepe(?:ats|tition)|g(?:(?:Group)?))|e(?:mporary|xt(?:(?:(?:End)?)Mark))|i(?:eDashPattern|me(?:(?:s)?))|ocItem|ranspos(?:e(?:(?:dCueDuring)?)|ition)|uplet(?:(?:Span)?)|weak)|un(?:do|fold(?:Repeats|ed))|v(?:o(?:i(?:ces|d)|lta)|shape)|withMusicProperty|xNote)$")
)

(
Expand All @@ -15,7 +15,7 @@

(
(escaped_word) @identifier.core.function.markup
(#match? @identifier.core.function.markup "^\\\\(a(?:bs\-fontsize|ccidental|lign\-on\-other|rrow\-head|uto\-footnote)|b(?:ackslashed\-digit|eam|o(?:ld|x)|racket)|c(?:aps|enter\-(?:(?:alig|colum)n)|har|ircle|o(?:da|lumn(?:(?:\-lines)?)|m(?:bine|pound\-meter)|n(?:cat|ditional\-trill\-markup))|ustomTabClef)|d(?:i(?:r\-column|scant)|ouble(?:flat|sharp)|raw\-(?:(?:circl|(?:(?:d(?:(?:ash|ott)ed\-)|h|squiggle\-)?)lin)e)|ynamic)|e(?:llipse|psfile|yeglasses)|f(?:ermata|i(?:gured\-bass|ll(?:\-(?:line|with\-pattern)|ed\-box)|nger|rst\-visible)|lat|o(?:nt(?:Caps|size)|otnote)|r(?:action|e(?:eBass|t\-diagram(?:(?:\-(?:(?:ter|verbo)se))?))|omproperty))|general\-align|h(?:a(?:lign|rp\-pedal)|bracket|center\-in|(?:spac|ug)e)|i(?:f|talic)|justif(?:ied\-lines|y(?:(?:\-(?:field|line|string))?))|l(?:arge(?:(?:r)?)|eft\-(?:align|brace|column)|ine|o(?:okup|wer))|m(?:a(?:gnify|p\-markup\-commands|rk(?:alphabet|letter))|edium|u(?:lti\-measure\-rest\-by\-number|sicglyph))|n(?:atural|o(?:rmal(?:\-(?:size\-su(?:b|per)|text)|size)|te(?:(?:\-by\-number)?))|u(?:ll|mber))|o(?:n\-the\-fly|v(?:al|er(?:lay|ride\-lines|tie)))|p(?:a(?:d\-(?:around|markup|(?:(?:to\-bo)?)x)|ge\-(?:link|ref)|renthesize|t(?:h|tern))|o(?:lygon|stscript)|roperty\-recursive|ut\-adjacent)|r(?:aise|e(?:place|st(?:(?:\-by\-number)?))|hythm|ight\-(?:align|brace|column)|o(?:man|tate|unded\-box))|s(?:ans|c(?:ale|ore\-lines)|e(?:gno|mi(?:flat|sharp)|squi(?:flat|sharp))|harp|imple|lashed\-digit|mall(?:(?:Caps|er)?)|t(?:dBass(?:(?:IV|V(?:(?:I)?))?)|encil|r(?:ing\-lines|ut))|u(?:b|per))|t(?:able(?:(?:\-of\-contents)?)|e(?:eny|xt)|i(?:e(?:(?:d\-lyric)?)|ny)|r(?:ans(?:late(?:(?:\-scaled)?)|parent)|iangle)|ypewriter)|u(?:n(?:der(?:(?:lin|ti)e)|less)|pright)|v(?:arcoda|center|(?:erbatim\-fil|spac)e)|w(?:hiteout|ith\-(?:color|dimension(?:(?:\-from|s(?:(?:\-from)?))?)|link|outline|string\-transformer|true\-dimension(?:(?:s)?)|url)|o(?:odwind\-diagram|rdwrap(?:(?:\-(?:field|internal|lines|string(?:(?:\-internal)?)))?))))$")
(#match? @identifier.core.function.markup "^\\\\(a(?:bs-fontsize|ccidental|lign-on-other|rrow-head|uto-footnote)|b(?:ackslashed-digit|eam|o(?:ld|x)|racket)|c(?:aps|enter-(?:(?:alig|colum)n)|har|ircle|o(?:da|lumn(?:(?:-lines)?)|m(?:bine|pound-meter)|n(?:cat|ditional-trill-markup))|ustomTabClef)|d(?:i(?:r-column|scant)|ouble(?:flat|sharp)|raw-(?:(?:circl|(?:(?:d(?:(?:ash|ott)ed-)|h|squiggle-)?)lin)e)|ynamic)|e(?:llipse|psfile|yeglasses)|f(?:ermata|i(?:gured-bass|ll(?:-(?:line|with-pattern)|ed-box)|nger|rst-visible)|lat|o(?:nt(?:Caps|size)|otnote)|r(?:action|e(?:eBass|t-diagram(?:(?:-(?:(?:ter|verbo)se))?))|omproperty))|general-align|h(?:a(?:lign|rp-pedal)|bracket|center-in|(?:spac|ug)e)|i(?:f|talic)|justif(?:ied-lines|y(?:(?:-(?:field|line|string))?))|l(?:arge(?:(?:r)?)|eft-(?:align|brace|column)|ine|o(?:okup|wer))|m(?:a(?:gnify|p-markup-commands|rk(?:alphabet|letter))|edium|u(?:lti-measure-rest-by-number|sicglyph))|n(?:atural|o(?:rmal(?:-(?:size-su(?:b|per)|text)|size)|te(?:(?:-by-number)?))|u(?:ll|mber))|o(?:n-the-fly|v(?:al|er(?:lay|ride-lines|tie)))|p(?:a(?:d-(?:around|markup|(?:(?:to-bo)?)x)|ge-(?:link|ref)|renthesize|t(?:h|tern))|o(?:lygon|stscript)|roperty-recursive|ut-adjacent)|r(?:aise|e(?:place|st(?:(?:-by-number)?))|hythm|ight-(?:align|brace|column)|o(?:man|tate|unded-box))|s(?:ans|c(?:ale|ore-lines)|e(?:gno|mi(?:flat|sharp)|squi(?:flat|sharp))|harp|imple|lashed-digit|mall(?:(?:Caps|er)?)|t(?:dBass(?:(?:IV|V(?:(?:I)?))?)|encil|r(?:ing-lines|ut))|u(?:b|per))|t(?:able(?:(?:-of-contents)?)|e(?:eny|xt)|i(?:e(?:(?:d-lyric)?)|ny)|r(?:ans(?:late(?:(?:-scaled)?)|parent)|iangle)|ypewriter)|u(?:n(?:der(?:(?:lin|ti)e)|less)|pright)|v(?:arcoda|center|(?:erbatim-fil|spac)e)|w(?:hiteout|ith-(?:color|dimension(?:(?:-from|s(?:(?:-from)?))?)|link|outline|string-transformer|true-dimension(?:(?:s)?)|url)|o(?:odwind-diagram|rdwrap(?:(?:-(?:field|internal|lines|string(?:(?:-internal)?)))?))))$")
)

(
Expand Down
2 changes: 1 addition & 1 deletion queries/update_builtins.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
file.write(dedent(f'''\
(
(escaped_word) @{list_and_selector[1]}
(#match? @{list_and_selector[1]} "{regex_opt(list_and_selector[0], backslash_prefix, '$')}")
(#match? @{list_and_selector[1]} "{regex_opt(list_and_selector[0], backslash_prefix, '$').replace('\\-', '-')}")
)
'''))
Expand Down

0 comments on commit ec7e615

Please sign in to comment.