mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 19:25:39 +00:00
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
This commit is contained in:
parent
74124b4bf8
commit
2923623e9c
@ -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();
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user