}
-InsetFormulaMacro::InsetFormulaMacro(string name, int nargs)
+InsetFormulaMacro::InsetFormulaMacro(string const & name, int nargs)
{
setInsetName(name);
- MathMacroTable::create(name, nargs, string());
+ MathMacroTable::create(name, nargs);
}
///
InsetFormulaMacro();
/// construct a macro hull from its name and the number of arguments
- explicit InsetFormulaMacro(string name, int na);
+ explicit InsetFormulaMacro(string const & name, int nargs);
/// constructs a mocro from its LaTeX definition
explicit InsetFormulaMacro(string const & s);
///
}
+void MathMacroTable::create(string const & name, int na)
+{
+ macro_table[name] = MathAtom(new MathMacroTemplate(name, na));
+}
+
+
void MathMacroTable::create(string const & name, int na, string const & text)
{
MathAtom t(new MathMacroTemplate(name, na));
- mathed_parse_cell(t->cell(0), text);
+ mathed_parse_cell(t->cell(0), name);
+ mathed_parse_cell(t->cell(1), text);
macro_table[name] = t;
}
struct MathMacroTable {
public:
///
- static void create(string const &, int, string const &);
+ static void create(string const &, int);
///
static void create(string const &, int, MathArray const &, MathArray const &);
///
static bool has(string const &);
///
static void builtinMacros();
+ ///
+ static void dump();
private:
+ /// create internal macros (like \longrightarrow...)
+ static void create(string const &, int, string const &);
+
///
typedef std::map<string, MathAtom> table_type;
//
static table_type macro_table;
-public:
- ///
- static void dump();
};
#endif