| 716 | } |
| 717 | |
| 718 | void TeXParser::inflateNewCmd(wstring& cmd, vector<wstring>& args, int& pos) throw(ex_parse) { |
| 719 | MacroInfo* const mac = MacroInfo::_commands[cmd]; |
| 720 | getOptsArgs(mac->_nbArgs, mac->_posOpts, args); |
| 721 | args[0] = cmd; |
| 722 | try { |
| 723 | mac->invoke(*this, args); |
| 724 | // The last element is the returned value (after inflated macro) |
| 725 | _parseString.replace(pos, _pos - pos, args.back()); |
| 726 | } catch (ex_parse& e) { |
| 727 | if (!_isPartial) throw; |
| 728 | pos += cmd.length() + 1; |
| 729 | } |
| 730 | _len = _parseString.length(); |
| 731 | _pos = pos; |
| 732 | } |
| 733 | |
| 734 | void TeXParser::inflateEnv(wstring& cmd, vector<wstring>& args, int& pos) throw(ex_parse) { |
| 735 | getOptsArgs(1, 0, args); |