-/** The math parser
- \author André Pönitz (2001)
+/**
+ * \file math_parser.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author André Pönitz
+ *
+ * Full author contact details are available in file CREDITS.
*/
/*
#include <config.h>
#include "math_parser.h"
-#include "math_inset.h"
#include "math_arrayinset.h"
#include "math_braceinset.h"
-#include "math_boxinset.h"
#include "math_charinset.h"
#include "math_commentinset.h"
#include "math_deliminset.h"
#include "math_envinset.h"
-#include "math_extern.h"
#include "math_factory.h"
#include "math_kerninset.h"
#include "math_macro.h"
+#include "math_macroarg.h"
#include "math_macrotemplate.h"
-#include "math_hullinset.h"
#include "math_parboxinset.h"
#include "math_parinset.h"
#include "math_rootinset.h"
#include "math_scriptinset.h"
-#include "math_sizeinset.h"
#include "math_sqrtinset.h"
-#include "math_stringinset.h"
#include "math_support.h"
#include "math_tabularinset.h"
#include "ref_inset.h"
#include "lyxlex.h"
-#include "Lsstream.h"
+#include "support/std_sstream.h"
#include "debug.h"
-#include "support/LAssert.h"
-#include <cctype>
-#include <algorithm>
+#ifndef CXX_GLOBAL_CSTD
+using std::atoi;
+#endif
+using std::endl;
+using std::fill;
+using std::string;
+using std::ios;
using std::istream;
+using std::istringstream;
using std::ostream;
-using std::ios;
-using std::endl;
-using std::fill;
using std::vector;
-using std::atoi;
//#define FILEDEBUG
if (flags & FLAG_BRACE_LAST)
return;
error("found '}' unexpectedly");
- //lyx::Assert(0);
+ //BOOST_ASSERT(false);
//add(cell, '}', LM_TC_TEX);
}
return;
}
+ else if (t.cs() == "color") {
+ MathAtom at = createMathInset(t.cs());
+ parse(at.nucleus()->cell(0), FLAG_ITEM, MathInset::TEXT_MODE);
+ parse(at.nucleus()->cell(1), flags, mode);
+ cell->push_back(at);
+ return;
+ }
+
else if (t.cs() == "substack") {
cell->push_back(createMathInset(t.cs()));
parse2(cell->back(), FLAG_ITEM, mode, false);
// Disabled
else if (1 && t.cs() == "ar") {
- MathXYArrowInset * p = new MathXYArrowInset;
+ auto_ptr<MathXYArrowInset> p(new MathXYArrowInset);
// try to read target
parse(p->cell(0), FLAG_OTPTION, mode);
// try to read label
//lyxerr << "read label: " << p->cell(1) << endl;
}
- cell->push_back(MathAtom(p));
+ cell->push_back(MathAtom(p.release()));
//lyxerr << "read cell: " << cell << endl;
}
#endif