X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FMathParser.cpp;h=ebeebd36527ef844efbf18aea9ef986382feaa1b;hb=36dbec45069bf3d9db923200835e44f44d904eb8;hp=d2c4d762edfd0bed9e35f47e86a55b22abe2b3d3;hpb=95146d3cf911230ee6c810e22d0243f83ce977a3;p=features.git diff --git a/src/mathed/MathParser.cpp b/src/mathed/MathParser.cpp index d2c4d762ed..ebeebd3652 100644 --- a/src/mathed/MathParser.cpp +++ b/src/mathed/MathParser.cpp @@ -896,12 +896,14 @@ void Parser::parse1(InsetMathGrid & grid, unsigned flags, t.cs() == "newcommand" || t.cs() == "renewcommand") { - docstring const type = t.cs(); + MacroType type = MacroTypeNewcommand; + if (t.cs() == "def") + type = MacroTypeDef; docstring name; int nargs = 0; int optionals = 0; vector optionalValues; - if (t.cs() == "def") { + if (type == MacroTypeDef) { // get name name = getToken().cs(); @@ -914,7 +916,7 @@ void Parser::parse1(InsetMathGrid & grid, unsigned flags, 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;