Merge branch 'underline' into master

This commit is contained in:
Steve Krulewitz 2020-11-06 16:09:43 -08:00
commit 136f720035

View File

@ -40,16 +40,36 @@
\char_set_catcode_other:N \# \char_set_catcode_other:N \#
\char_set_catcode_parameter:N \! \char_set_catcode_parameter:N \!
\NewDocumentCommand \xchordname {m} {%
\str_case:nnTF {!1} \prop_const_from_keyval:Nn \__skrul_enharmonic_map_prop
{ {
{B#} {\chordname{C}} B#=C,
{F##} {\chordname{G}} E#=F,
{F##/B} {\chordname{G/B}} F##=G,
{Am/F##} {\chordname{Am/G}} F##/B=G/B,
Am/F##=Am/G
}
\cs_new:Npn \__skrul_get:V !1
{
\prop_item:NV \__skrul_prop { !1 }
}
\cs_generate_variant:Nn \str_set:Nn {Nx}
\NewDocumentCommand \xchordname {m} {%
\tl_if_head_eq_catcode:nNTF { !1 } .
{
\str_set:Nx \l_tmpa_str { \str_tail:n !1 }
\prop_get:NVNTF \__skrul_enharmonic_map_prop \l_tmpa_str \__skrul_enharmonic_tl
{ \underline{\chordname{\__skrul_enharmonic_tl}}}
{ \underline{\chordname{\l_tmpa_str}}}
}
{
\prop_get:NnNTF \__skrul_enharmonic_map_prop { !1 } \__skrul_enharmonic_tl
{ \chordname{\__skrul_enharmonic_tl}}
{ \chordname{!1}}
} }
{}
{\chordname{!1}}
} }
\char_set_catcode_parameter:N \# \char_set_catcode_parameter:N \#
\char_set_catcode_other:N \! \char_set_catcode_other:N \!