]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_parser.C
enable direct input of #1...#9; some whitespace changes
[lyx.git] / src / mathed / math_parser.C
index b67ea0112ed56907e2a5741667a7b692e70b01da..98940b4537ccd53da89cda5bb27680a899370b0e 100644 (file)
@@ -93,7 +93,7 @@ namespace {
 
 bool stared(string const & s)
 {
-       unsigned const n = s.size();
+       string::size_type const n = s.size();
        return n && s[n - 1] == '*';
 }
 
@@ -219,10 +219,11 @@ bool operator==(Token const & s, Token const & t)
                && s.cat() == t.cat() && s.cs() == t.cs(); 
 }
 
-bool operator!=(Token const & s, Token const & t)
-{
-       return !(s == t);
-}
+// Angus' compiler says this is not needed
+//bool operator!=(Token const & s, Token const & t)
+//{
+//     return !(s == t);
+//}
 
 ostream & operator<<(ostream & os, Token const & t)
 {
@@ -503,7 +504,7 @@ bool Parser::parse_lines(MathAtom & t, bool numbered, bool outmost)
                return false;
        }
 
-       int const cols = p->ncols();
+       MathInset::col_type const cols = p->ncols();
 
        // save global variables
        bool   const saved_num   = curr_num_;
@@ -518,7 +519,7 @@ bool Parser::parse_lines(MathAtom & t, bool numbered, bool outmost)
                curr_label_.erase();
 
                // reading a row
-               for (int col = 0; col < cols; ++col) {
+               for (MathInset::col_type col = 0; col < cols; ++col) {
                        //lyxerr << "reading cell " << row << " " << col << "\n";
                        parse_into(p->cell(col + row * cols), FLAG_BLOCK);
 
@@ -672,6 +673,12 @@ bool Parser::parse_normal(MathAtom & matrix)
 
        string const name = getArg('{', '}');
 
+       if (name == "math") {
+               matrix = MathAtom(new MathHullInset(LM_OT_SIMPLE));
+               parse_into(matrix->cell(0), 0);
+               return true;
+       }
+
        if (name == "equation" || name == "equation*" || name == "displaymath") {
                curr_num_ = (name == "equation");
                curr_label_.erase();
@@ -781,7 +788,7 @@ void Parser::parse_into(MathArray & array, unsigned flags, MathTextCodes code)
 
                else if (t.cat() == catParameter) {
                        Token const & n = getToken();
-                       array.push_back(MathAtom(new MathMacroArgument(n.character() - '0')));
+                       array.push_back(MathAtom(new MathMacroArgument(n.character()-'0', code)));
                }
 
                else if (t.cat() == catBegin) {
@@ -947,8 +954,8 @@ void Parser::parse_into(MathArray & array, unsigned flags, MathTextCodes code)
                        return;
                }
 
-/*
                // Disabled
+#if 0
                else if (t.cs() == "mbox") {
                        array.push_back(createMathInset(t.cs()));
                        // slurp in the argument of mbox
@@ -956,7 +963,8 @@ void Parser::parse_into(MathArray & array, unsigned flags, MathTextCodes code)
                        MathBoxInset * p = array.back()->asBoxInset();
                        //lyx::assert(p);
                }
-*/
+#endif
+
        
                else if (t.cs().size()) {
                        latexkeys const * l = in_word_set(t.cs());