- \char_set_catcode_math_superscript:N \^
- \cs_set:Npn \_um_sym:nnn ##1##2##3 {
- \bool_if:nTF { \cs_if_eq_p:NN ##3 \mathaccent ||
- \cs_if_eq_p:NN ##3 \mathopen ||
- \cs_if_eq_p:NN ##3 \mathclose ||
- \cs_if_eq_p:NN ##3 \mathover ||
- \cs_if_eq_p:NN ##3 \mathunder ||
- \cs_if_eq_p:NN ##3 \mathbotaccent } {
+ \cs_set:Npn \__um_sym:nnn ##1##2##3
+ {
+ \tl_if_in:nnT
+ { \mathord \mathalpha \mathbin \mathrel \mathpunct \mathop \mathfence }
+ {##3}
+ {
+ \exp_last_unbraced:NNx \cs_gset_eq:NN ##2 { \Ucharcat ##1 ~ 12 ~ }