When reading rule files, MathCAT supports ranges. For example
- "𝗮-𝘇": # 0x1d5ee - 0x1d607
- test:
if: "not($IgnoreBold)"
then: [t: "bold"]
- spell: "translate('.', '𝗮𝗯𝗰𝗱𝗲𝗳𝗴𝗵𝗶𝗷𝗸𝗹𝗺𝗻𝗼𝗽𝗾𝗿𝘀𝘁𝘂𝘃𝘄𝘅𝘆𝘇', 'abcdefghijklmnopqrstuvwxyz')"
This gets rewritten to 26 rules for each letter, with "." replaced by the letter. When there is a translate, an optimization is to avoid the translate so that you end up with something like
- "𝗮": # 0x1d5ee - 0x1d607
- test:
if: "not($IgnoreBold)"
then: [t: "bold"]
- spell: "a"
However, in some cases such as in braille, we need to invoke the rule for "a". There is a hack in tts.rs that deals with the recursion and uses spell. Any change would need to make sure that still triggers after this change.
This is a minor optimization that probably doesn't result in a noticeable speedup. Still, it is kind of silly to call translate on a constant.
When reading rule files, MathCAT supports ranges. For example
This gets rewritten to 26 rules for each letter, with "." replaced by the letter. When there is a translate, an optimization is to avoid the translate so that you end up with something like
However, in some cases such as in braille, we need to invoke the rule for "a". There is a hack in tts.rs that deals with the recursion and uses spell. Any change would need to make sure that still triggers after this change.
This is a minor optimization that probably doesn't result in a noticeable speedup. Still, it is kind of silly to call translate on a constant.