}
-// The local table.
-//MacroTable & MacroTable::localMacros()
-//{
-// static MacroTable theLocalMacros;
-// return theLocalMacros;
-//}
-
-
bool MacroTable::has(docstring const & name) const
{
return find(name) != end();
void MacroTable::insert(docstring const & name, MacroData const & data)
{
- //lyxerr << "MacroTable::insert: " << name << endl;
+ //lyxerr << "MacroTable::insert: " << to_utf8(name) << endl;
operator[](name) = data;
}
void MacroTable::insert(docstring const & def)
{
- //lyxerr << "MacroTable::insert, def: " << def << endl;
+ //lyxerr << "MacroTable::insert, def: " << to_utf8(def) << endl;
std::istringstream is(to_utf8(def));
MathMacroTemplate mac(is);
insert(mac.name(), mac.asMacroData());
void MathMacroTemplate::edit(LCursor & cur, bool)
{
- lyxerr << "MathMacroTemplate: edit left/right" << endl;
+ //lyxerr << "MathMacroTemplate: edit left/right" << endl;
cur.push(*this);
}
///
void tokenize(docstring const & s);
///
- void skipSpaceTokens(istream & is, char c);
+ void skipSpaceTokens(idocstream & is, char_type c);
///
void push_back(Token const & t);
///
}
-void Parser::skipSpaceTokens(istream & is, char c)
+void Parser::skipSpaceTokens(idocstream & is, char_type c)
{
// skip trailing spaces
while (catcode(c) == catSpace || catcode(c) == catNewline)
{
// eat everything up to the next \end_inset or end of stream
// and store it in s for further tokenization
- docstring s;
+ std::string s;
char c;
while (is.get(c)) {
s += c;
is.unget();
// tokenize buffer
- tokenize(s);
+ tokenize(from_utf8(s));
}
void Parser::tokenize(docstring const & buffer)
{
- istringstream is(to_utf8(buffer), ios::in | ios::binary);
+ idocstringstream is(buffer, ios::in | ios::binary);
- char c;
+ char_type c;
while (is.get(c)) {
//lyxerr << "reading c: " << c << endl;