#include "MathSupport.h"
#include "Lexer.h"
-#include "support/debug.h"
+#include "support/debug.h"
#include "support/convert.h"
#include "support/docstream.h"
///
Parser(Lexer & lex);
/// Only use this for reading from .lyx file format, for the reason
- /// see Parser::tokenize(std::istream &).
+ /// see Parser::tokenize(istream &).
Parser(istream & is);
///
Parser(docstring const & str);
else if (t.cs() == "def" ||
t.cs() == "newcommand" ||
- t.cs() == "renewcommand")
+ t.cs() == "renewcommand" ||
+ t.cs() == "newlyxcommand")
{
- docstring const type = t.cs();
+ MacroType type = MacroTypeNewcommand;
+ if (t.cs() == "def")
+ type = MacroTypeDef;
docstring name;
int nargs = 0;
int optionals = 0;
- std::vector<MathData> optionalValues;
- if (t.cs() == "def") {
+ vector<MathData> optionalValues;
+ if (type == MacroTypeDef) {
// get name
name = getToken().cs();
nargs /= 2;
//lyxerr << "read \\def parameter list '" << pars << "'" << endl;
- } else { // t.cs() == "newcommand" || t.cs() == "renewcommand"
+ } else {
if (getToken().cat() != catBegin) {
error("'{' in \\newcommand expected (1) ");
return;
<< to_utf8(l->inset) << "'." << endl;
// create generic environment inset
cell->push_back(MathAtom(new InsetMathEnv(name)));
- parse(cell->back().nucleus()->cell(0), FLAG_ITEM, mode);
+ parse(cell->back().nucleus()->cell(0), FLAG_END, mode);
}
}
<< "'" << endl;
// create generic environment inset
cell->push_back(MathAtom(new InsetMathEnv(name)));
- parse(cell->back().nucleus()->cell(0), FLAG_ITEM, mode);
+ parse(cell->back().nucleus()->cell(0), FLAG_END, mode);
}
}