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

Method getCommand

src/core/parser.cpp:308–330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

306}
307
308wstring TeXParser::getCommand() {
309 int spos = ++_pos;
310 wchar_t ch = L'\0';
311
312 while (_pos < _len) {
313 ch = _parseString[_pos];
314 if ((ch < 'a' || ch > 'z') &&
315 (ch < 'A' || ch > 'Z') &&
316 (_atIsLetter == 0 || ch != '@'))
317 break;
318
319 _pos++;
320 }
321
322 if (ch == L'\0') return L"";
323
324 if (_pos == spos) _pos++;
325
326 wstring com = _parseString.substr(spos, _pos - spos);
327 if (com == L"cr" && _pos < _len && _parseString[_pos] == ' ') _pos++;
328
329 return com;
330}
331
332void TeXParser::insert(int s, int e, const wstring& formula) {
333 _parseString.replace(s, e - s, formula);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected