#include "MathSupport.h"
#include "Lexer.h"
-#include "debug.h"
+#include "support/debug.h"
#include "support/convert.h"
#include "support/docstream.h"
#include <sstream>
-
-namespace lyx {
-
-using std::endl;
-using std::fill;
-
-using std::string;
-using std::ios;
-using std::istream;
-using std::ostream;
-using std::vector;
-
-
//#define FILEDEBUG
+using namespace std;
+
+namespace lyx {
namespace {
* environments like "equation" that have a fixed number of rows.
*/
bool addRow(InsetMathGrid & grid, InsetMathGrid::row_type & cellrow,
- docstring const & vskip, bool allow_pagebreak = true)
+ docstring const & vskip, bool allow_newpage_ = true)
{
++cellrow;
if (cellrow == grid.nrows()) {
lyxerr << "ignoring extra row";
if (!vskip.empty())
lyxerr << " with extra space " << to_utf8(vskip);
- if (!allow_pagebreak)
+ if (!allow_newpage_)
lyxerr << " with no page break allowed";
lyxerr << '.' << endl;
return false;
}
}
grid.vcrskip(Length(to_utf8(vskip)), cellrow - 1);
- grid.rowinfo(cellrow - 1).allow_pagebreak_ = allow_pagebreak;
+ grid.rowinfo(cellrow - 1).allow_newpage_ = allow_newpage_;
return true;
}
///
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;