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

Method getArgument

src/core/parser.cpp:616–652  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

614}
615
616sptr<Atom> TeXParser::getArgument() throw(ex_parse) {
617 skipWhiteSpace();
618 wchar_t ch;
619 if (_pos < _len)
620 ch = _parseString[_pos];
621 else
622 return sptr<Atom>(new EmptyAtom());
623
624 if (ch == L_GROUP) {
625 TeXFormula tf;
626 TeXFormula* tmp = _formula;
627 _formula = &tf;
628 _pos++;
629 _group++;
630 parse();
631 _formula = tmp;
632 if (_formula->_root == nullptr) {
633 RowAtom* rm = new RowAtom();
634 rm->add(tf._root);
635 return sptr<Atom>(rm);
636 }
637 return tf._root;
638 }
639
640 if (ch == ESCAPE) {
641 auto atom = processEscape();
642 if (_insertion) {
643 _insertion = false;
644 return getArgument();
645 }
646 return atom;
647 }
648
649 auto atom = convertCharacter(ch, true);
650 _pos++;
651 return atom;
652}
653
654pair<int, float> TeXParser::getLength() throw(ex_parse) {
655 if (_pos == _len) return make_pair(-1.f, -1.f);

Callers 2

macroFunction · 0.80
parsePositionsMethod · 0.80

Calls 1

addMethod · 0.45

Tested by

no test coverage detected