MCPcopy Create free account
hub / github.com/NanoMichael/MicroTeX / replaceScript

Method replaceScript

src/core/parser.cpp:670–689  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

668}
669
670bool TeXParser::replaceScript() {
671 wchar_t ch = _parseString[_pos];
672 auto it = SUP_SCRIPT_MAP.find(ch);
673 if (it != SUP_SCRIPT_MAP.end()) {
674 wstring sup = wstring(L"\\mathcumsup{").append(1, (wchar_t)(it->second)).append(L"}");
675 _parseString.replace(_pos, 1, sup);
676 _len = _parseString.length();
677 _pos += sup.size();
678 return true;
679 }
680 it = SUB_SCRIPT_MAP.find(ch);
681 if (it != SUB_SCRIPT_MAP.end()) {
682 wstring sub = wstring(L"\\mathcumsub{").append(1, (wchar_t)(it->second)).append(L"}");
683 _parseString.replace(_pos, 1, sub);
684 _len = _parseString.length();
685 _pos += sub.size();
686 return true;
687 }
688 return false;
689}
690
691void TeXParser::preprocess(wstring& cmd, vector<wstring>& args, int& pos) throw(ex_parse) {
692 if (cmd == L"newcommand" || cmd == L"renewcommand") {

Callers

nothing calls this directly

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected