#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 {
///
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;