From: André Pönitz Date: Fri, 10 Aug 2001 15:49:15 +0000 (+0000) Subject: prepare syntax change for 'math-insert' (root -> \root etc) X-Git-Tag: 1.6.10~20855 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=2923623e9c0716bc022b4378a4689ffd8ef5f9a2;p=features.git prepare syntax change for 'math-insert' (root -> \root etc) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2490 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index aae83c9164..0fa40b8ee7 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -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(); diff --git a/src/mathed/math_parser.C b/src/mathed/math_parser.C index d0d480743b..5697ad3144 100644 --- a/src/mathed/math_parser.C +++ b/src/mathed/math_parser.C @@ -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; }