]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_parser.C
split inset -> inset + updatableinset
[lyx.git] / src / mathed / math_parser.C
index ddadf94e19d2699c343bd9853abc278e740afcb9..fdecd97f8d8cb5917b0b97730343c7f4f504c996 100644 (file)
@@ -22,9 +22,9 @@ following hack as starting point to write some macros:
   ...
 
   \[\begin{array}{ccc}
-   1 & 2\b & 3^2\\
-   4 & 5\e & 6\\
-   7 & 8 & 9
+1
+&
+
   \end{array}\]
 
 */
@@ -32,9 +32,6 @@ following hack as starting point to write some macros:
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
 
 #include "math_parser.h"
 #include "math_inset.h"
@@ -403,6 +400,9 @@ void Parser::tokenize(istream & is)
                        break;
                }
        }
+       // Remove the space after \end_inset
+       if (is.get(c) && c != ' ')
+               is.unget();
 
        // tokenize buffer
        tokenize(s);
@@ -746,9 +746,10 @@ void Parser::parse1(MathGridInset & grid, unsigned flags,
                        MathScriptInset * p = cell->back().nucleus()->asScriptInset();
                        // special handling of {}-bases
                        // is this always correct?
-                       if (p->nuc().size() == 1 && p->nuc().back()->asNestInset() &&
-                                       p->nuc().back()->extraBraces())
-                               p->nuc() = p->nuc().back()->asNestInset()->cell(0);
+                       // It appears that this is wrong (Dekel)
+                       //if (p->nuc().size() == 1 && p->nuc().back()->asNestInset() &&
+                       //    p->nuc().back()->extraBraces())
+                       //      p->nuc() = p->nuc().back()->asNestInset()->cell(0);
                        parse(p->cell(up), FLAG_ITEM, mode);
                        if (limits) {
                                p->limits(limits);
@@ -956,6 +957,12 @@ void Parser::parse1(MathGridInset & grid, unsigned flags,
                        }
                }
 
+               else if (t.cs() == "xrightarrow" || t.cs() == "xleftarrow") {
+                       cell->push_back(createMathInset(t.cs()));
+                       parse(cell->back().nucleus()->cell(1), FLAG_OPTION, mode);
+                       parse(cell->back().nucleus()->cell(0), FLAG_ITEM, mode);
+               }
+
                else if (t.cs() == "ref") {
                        cell->push_back(MathAtom(new RefInset));
                        parse(cell->back().nucleus()->cell(1), FLAG_OPTION, mode);