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

Method forwardFromCurrentPos

src/core/parser.cpp:388–412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

386}
387
388wstring TeXParser::forwardFromCurrentPos() {
389 if (_group == 0) {
390 const wstring& sub = _parseString.substr(_pos);
391 finish();
392 return sub;
393 }
394 int closing = _group;
395 auto i = _parseString.length() - 1;
396 for (; i >= _pos; i--) {
397 auto ch = _parseString[i];
398 if (ch == R_GROUP) {
399 closing--;
400 if (closing == 0) break;
401 }
402 }
403 if (closing != 0) {
404 throw ex_parse(
405 "Found a closing '" +
406 tostring((char)R_GROUP) +
407 "' without an opening '" + tostring((char)L_GROUP) + "'!");
408 }
409 const wstring& sub = _parseString.substr(_pos, i - _pos);
410 _pos = i;
411 return sub;
412}
413
414void TeXParser::getOptsArgs(int nbArgs, int opts, _out_ vector<wstring>& args) {
415 /*

Callers 1

macroFunction · 0.80

Calls 2

ex_parseClass · 0.85
tostringFunction · 0.85

Tested by

no test coverage detected