string rs;
istringstream is(arg.c_str());
is >> ls >> rs;
- latexkeys const * l = in_word_set(ls);
- latexkeys const * r = in_word_set(rs);
- if (!is || !l || !r) {
+ if (!is) {
lyxerr << "can't parse delimeters from '" << arg << "'\n";
break;
}
bv->lockedInsetStoreUndo(Undo::EDIT);
- mathcursor->handleDelim(l, r);
+ mathcursor->handleDelim(ls, rs);
updateLocal(bv, true);
break;
}
}
-void MathCursor::handleDelim(latexkeys const * l, latexkeys const * r)
+void MathCursor::handleDelim(string const & l, string const & r)
{
handleNest(new MathDelimInset(l, r));
}
///
void handleFont(MathTextCodes t);
///
- void handleDelim(latexkeys const * l, latexkeys const * r);
+ void handleDelim(string const & l, string const & r);
///
void handleNest(MathInset * p);
/// Splits cells and shifts right part to the next cell
using std::max;
-MathDelimInset::MathDelimInset(latexkeys const * l, latexkeys const * r)
+MathDelimInset::MathDelimInset(string const & l, string const & r)
: MathNestInset(1), left_(l), right_(r)
{}
}
-string MathDelimInset::latexName(latexkeys const * l)
+string MathDelimInset::latexName(string const & name)
{
- //static const string vdelim("(){}[]./|");
- string name = l->name;
if (name == "(")
return name;
if (name == "[")
void MathDelimInset::write(std::ostream & os, bool fragile) const
{
- os << "\\left" << latexName(left_);
+ os << "\\left" << latexName(left_);
cell(0).write(os, fragile);
os << "\\right" << latexName(right_);
}
int const w = dw();
int const b = y - ascent_ - 2;
xcell(0).draw(pain, x + w + 2, y);
- mathed_draw_deco(pain, x + 1, b, w, height() + 4, left_->name);
- mathed_draw_deco(pain, x + width() - w - 1, b, w, height() + 4, right_->name);
+ mathed_draw_deco(pain, x + 1, b, w, height() + 4, left_);
+ mathed_draw_deco(pain, x + width() - w - 1, b, w, height() + 4, right_);
}
\author Alejandro Aguilar Sierra
*/
-class latexkeys;
-
class MathDelimInset : public MathNestInset {
public:
///
- MathDelimInset(latexkeys const *, latexkeys const *);
+ MathDelimInset(string const &, string const &);
///
MathInset * clone() const;
///
///
void metrics(MathStyles st) const;
private:
- ///
- static string latexName(latexkeys const *);
///
int dw() const;
///
- latexkeys const * left_;
+ string left_;
+ ///
+ string right_;
///
- latexkeys const * right_;
+ static string latexName(string const & name);
};
#endif
void error(string const & msg);
///
void parse_lines(MathGridInset * p, bool numbered, bool outmost);
- ///
- latexkeys const * read_delim();
private:
///
}
-latexkeys const * Parser::read_delim()
-{
- Token const & t = getToken();
- latexkeys const * l = in_word_set(t.asString());
- return l ? l : in_word_set(".");
-}
-
-
void Parser::parse_into(MathArray & array, unsigned flags, MathTextCodes code)
{
MathTextCodes yyvarcode = LM_TC_MIN;
}
else if (t.cs() == "left") {
- latexkeys const * l = read_delim();
+ string l = getToken().asString();
MathArray ar;
parse_into(ar, FLAG_RIGHT);
- latexkeys const * r = read_delim();
+ string r = getToken().asString();
MathDelimInset * dl = new MathDelimInset(l, r);
dl->cell(0) = ar;
array.push_back(dl);
{"/", slash, 0 },
{"Vert", Vert, 0 },
{"'", slash, 1 },
+ {"backslash", slash, 1 },
{"langle", angle, 0 },
{"lceil", corner, 0 },
{"lfloor", corner, 1 },
deco_struct const * mds = search_deco(name);
if (!mds) {
lyxerr << "Deco was not found. Programming error?\n";
- lyxerr << "name: '" << name << "\n";
+ lyxerr << "name: '" << name << "'\n";
return;
}