{"atop", LM_TK_ATOP, 0},
{"bar", LM_TK_DECORATION, 0},
{"begin", LM_TK_BEGIN, 0},
+ {"bf", LM_TK_OLDFONT, LM_TC_BF},
{"binom", LM_TK_BINOM, 0},
{"bmod", LM_TK_FUNC, 0},
{"breve", LM_TK_DECORATION, 0},
{"hat", LM_TK_DECORATION, 0},
{"hom", LM_TK_FUNC, 0},
{"inf", LM_TK_FUNCLIM, 0},
+ {"it", LM_TK_OLDFONT, LM_TC_IT},
{"ker", LM_TK_FUNC, 0},
{"kern", LM_TK_KERN, 0},
{"label", LM_TK_LABEL, 0},
{"qquad", LM_TK_SPACE, 5},
{"quad", LM_TK_SPACE, 4},
{"right", LM_TK_RIGHT, 0},
+ {"rm", LM_TK_OLDFONT, LM_TC_RM},
{"root", LM_TK_ROOT, 0},
//{"scriptscriptstyle", LM_TK_STY, LM_ST_SCRIPTSCRIPT},
//{"scriptstyle", LM_TK_STY, LM_ST_SCRIPT},
{"textrm", LM_TK_FONT, LM_TC_TEXTRM},
//{"textstyle", LM_TK_STY, LM_ST_TEXT},
{"tilde", LM_TK_DECORATION, 0},
+ {"tt", LM_TK_OLDFONT, LM_TC_TT},
{"underbrace", LM_TK_DECORATION, 0},
{"underline", LM_TK_DECORATION, 0},
{"vdots", LM_TK_DOTS, 0},
#include <config.h>
#include <cctype>
+#include <stack>
#ifdef __GNUG__
#pragma implementation
using std::ostream;
using std::ios;
using std::endl;
+using std::stack;
namespace {
void Parser::parse_into(MathArray & array, unsigned flags, MathTextCodes code)
{
- MathTextCodes yyvarcode = LM_TC_MIN;
+ stack<MathTextCodes> fontcodes;
+ fontcodes.push(LM_TC_MIN);
bool panic = false;
int limits = 0;
break;
else if (t.cat() == catLetter)
- add(array, t.character(), yyvarcode);
+ add(array, t.character(), fontcodes.top());
else if (t.cat() == catSpace &&
- (yyvarcode == LM_TC_TEXTRM || code == LM_TC_TEXTRM))
- add(array, ' ', yyvarcode);
+ (fontcodes.top() == LM_TC_TEXTRM || code == LM_TC_TEXTRM))
+ add(array, ' ', fontcodes.top());
else if (t.cat() == catParameter) {
Token const & n = getToken();
else if (t.cat() == catBegin) {
add(array, '{', LM_TC_TEX);
+ fontcodes.push(LM_TC_MIN);
}
else if (t.cat() == catEnd) {
if (flags & FLAG_BRACE_LAST)
return;
add(array, '}', LM_TC_TEX);
+ fontcodes.pop();
}
else if (t.cat() == catAlign) {
return;
else if (t.cat() == catOther)
- add(array, t.character(), yyvarcode);
+ add(array, t.character(), fontcodes.top());
//
// codesequences
//lyxerr << "ending font\n";
}
- else if (l->token == LM_TK_OLDFONT)
- yyvarcode = static_cast<MathTextCodes>(l->id);
+ else if (l->token == LM_TK_OLDFONT) {
+ fontcodes.pop();
+ fontcodes.push(static_cast<MathTextCodes>(l->id));
+ }
else {
MathAtom p = createMathInset(t.cs());