*** empty log message ***

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6127 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2003-02-12 14:57:27 +00:00
parent 789041753c
commit bfa935070c

View File

@ -442,17 +442,19 @@ void parse(Parser & p, ostream & os, unsigned flags, mode_type mode)
} }
else if (t.cat() == catBegin) { else if (t.cat() == catBegin) {
os << '{'; if (mode == MATH_MODE)
parse(p, os, FLAG_BRACE_LAST, mode); os << '{';
os << '}'; else
handle_ert(os, "{");
} }
else if (t.cat() == catEnd) { else if (t.cat() == catEnd) {
if (flags & FLAG_BRACE_LAST) if (flags & FLAG_BRACE_LAST)
return; return;
p.error("found '}' unexpectedly"); if (mode == MATH_MODE)
//lyx::Assert(0); os << '}';
//add(cell, '}', LM_TC_TEX); else
handle_ert(os, "}");
} }
else if (t.cat() == catAlign) else if (t.cat() == catAlign)
@ -493,9 +495,8 @@ void parse(Parser & p, ostream & os, unsigned flags, mode_type mode)
// control sequences // control sequences
// //
else if (t.cs() == "lyxlock") { else if (t.cs() == "lyxlock")
// ignored; ; // ignored
}
else if (t.cs() == "newcommand" || t.cs() == "providecommand") { else if (t.cs() == "newcommand" || t.cs() == "providecommand") {
string const name = p.verbatimItem(); string const name = p.verbatimItem();
@ -572,12 +573,12 @@ void parse(Parser & p, ostream & os, unsigned flags, mode_type mode)
+ curr_env() + "}"); + curr_env() + "}");
active_environments.pop(); active_environments.pop();
if (is_math_env(name)) { if (is_math_env(name)) {
end_inset(os);
os << "\\end{" << name << "}"; os << "\\end{" << name << "}";
end_inset(os);
} else if (mode == MATH_MODE) { } else if (mode == MATH_MODE) {
os << "\\end{" << name << "}"; os << "\\end{" << name << "}";
} else } else
; os << "\n\\layout Standard\n\n";
return; return;
} }
p.error("found 'end' unexpectedly"); p.error("found 'end' unexpectedly");
@ -721,6 +722,7 @@ void parse(Parser & p, ostream & os, unsigned flags, mode_type mode)
h_preamble << t.asInput(); h_preamble << t.asInput();
else { else {
// heuristic: read up to next non-nested space // heuristic: read up to next non-nested space
/*
string s = t.asInput(); string s = t.asInput();
string z = p.verbatimItem(); string z = p.verbatimItem();
while (p.good() && z != " " && z.size()) { while (p.good() && z != " " && z.size()) {
@ -730,6 +732,8 @@ void parse(Parser & p, ostream & os, unsigned flags, mode_type mode)
} }
cerr << "found ERT: " << s << endl; cerr << "found ERT: " << s << endl;
handle_ert(os, s + ' '); handle_ert(os, s + ' ');
*/
handle_ert(os, t.asInput() + ' ');
} }
} }