]> git.lyx.org Git - features.git/commitdiff
prepare syntax change for 'math-insert' (root -> \root etc)
authorAndré Pönitz <poenitz@gmx.net>
Fri, 10 Aug 2001 15:49:15 +0000 (15:49 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Fri, 10 Aug 2001 15:49:15 +0000 (15:49 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2490 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/math_cursor.C
src/mathed/math_parser.C

index aae83c91645c1d58cf2cd11aff1b05134eb0bdfe..0fa40b8ee779beea5c0d95792b594a149e6a23dc 100644 (file)
@@ -609,14 +609,19 @@ void MathCursor::setSize(MathStyles size)
 }
 
 
-void MathCursor::interpret(string const & s)
+void MathCursor::interpret(string const & t)
 {
        //lyxerr << "interpret: '" << s << "'\n";
        //lyxerr << "in: " << in_word_set(s) << " \n";
 
-       if (s.empty())
+       if (t.empty())
                return;
 
+       // temporary glue code
+       string s = t;
+       if (s[0] == '\\')
+               s = s.substr(1);
+
        if (s[0] == '^' || s[0] == '_') {
                bool const up = (s[0] == '^');
                selCut();       
index d0d480743b0befe95c551f9f6f58b6fbf92b3650..5697ad31441c120205fe950221f4cc6ce8d5b51e 100644 (file)
@@ -561,7 +561,6 @@ void Parser::parse_into(MathArray & array, unsigned flags)
 
        int  t      = yylex();
        bool panic  = false;
-       int  brace  = 0;
        int  limits = 0;
 
        while (t) {
@@ -573,20 +572,18 @@ void Parser::parse_into(MathArray & array, unsigned flags)
                if (flags & FLAG_ITEM) {
                        flags &= ~FLAG_ITEM;
                        if (t == LM_TK_OPEN) { 
-                               // skip the brace and regard everything to the next matching
+                               // skip the brace and collect everything to the next matching
                                // closing brace
                                t = yylex();
-                               ++brace;
                                flags |= FLAG_BRACE_LAST;
                        } else {
-                               // regard only this single token
+                               // take only this single token
                                flags |= FLAG_LEAVE;
                        }
                }
 
                if ((flags & FLAG_BRACE) && t != LM_TK_OPEN) {
-                       error(
-                               "Expected {. Maybe you forgot to enclose an argument in {}");
+                       error("Expected {. Maybe you forgot to enclose an argument in {}");
                        panic = true;
                        break;
                }