]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_parser.C
updates to latexfeatures stuff; allow empty \document_path
[lyx.git] / src / mathed / math_parser.C
index 7538fce72c38fbf3d9d7edfad4b9bada56b79d24..3c3630318d93f8ceb8962e4acae0424f829acb8f 100644 (file)
@@ -64,6 +64,7 @@ point to write some macros:
 #include "math_macrotemplate.h"
 #include "math_hullinset.h"
 #include "math_rootinset.h"
+#include "math_sizeinset.h"
 #include "math_sqrtinset.h"
 #include "math_scriptinset.h"
 #include "math_specialcharinset.h"
@@ -92,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] == '*';
 }
 
@@ -218,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)
 {
@@ -502,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_;
@@ -517,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);
 
@@ -899,19 +901,6 @@ void Parser::parse_into(MathArray & array, unsigned flags, MathTextCodes code)
                        return;
                }
 
-/*             
-               case LM_TK_STY:
-               {
-                       lyxerr[Debug::MATHED] << "LM_TK_STY not implemented\n";
-                       //MathArray tmp = array;
-                       //MathSizeInset * p = new MathSizeInset(MathStyles(lval_->id));
-                       //array.push_back(p);
-                       //parse_into(p->cell(0), FLAG_BRACE_FONT);
-                       break; 
-               }
-
-*/
-               
                else if (t.cs() == "begin") {
                        string const name = getArg('{', '}');   
                        if (name == "array") {
@@ -959,8 +948,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
@@ -968,7 +957,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());
@@ -1000,6 +990,13 @@ void Parser::parse_into(MathArray & array, unsigned flags, MathTextCodes code)
                                        array.push_back(p);
                                }
 
+                               else if (l->token == LM_TK_STY) {
+                                       MathAtom p = createMathInset(t.cs());
+                                       parse_into(p->cell(0), flags, code);
+                                       array.push_back(p);
+                                       return;
+                               }
+
                                else {
                                        MathAtom p = createMathInset(t.cs());
                                        for (MathInset::idx_type i = 0; i < p->nargs(); ++i)