void Parser::tokenize(docstring const & buffer)
{
- idocstringstream is(mode_ & Parse::VERBATIM
+ idocstringstream is((mode_ & Parse::VERBATIM)
? escapeSpecialChars(buffer, mode_ & Parse::TEXTMODE)
: buffer, ios::in | ios::binary);
skipSpaces();
docstring res;
if (nextToken().character() == '[') {
- Token t = getToken();
- for (t = getToken(); t.character() != ']' && good(); t = getToken()) {
+ // eat [
+ getToken();
+ for (Token t = getToken(); t.character() != ']' && good(); t = getToken()) {
if (t.cat() == catBegin) {
putback();
res += '{' + parse_verbatim_item() + '}';
skipSpaces();
docstring res;
if (nextToken().cat() == catBegin) {
- Token t = getToken();
- for (t = getToken(); t.cat() != catEnd && good(); t = getToken()) {
+ // eat catBegin
+ getToken();
+ for (Token t = getToken(); t.cat() != catEnd && good(); t = getToken()) {
if (t.cat() == catBegin) {
putback();
res += '{' + parse_verbatim_item() + '}';
BufferParams::package_off;
bool const is_user_macro = no_mhchem ||
- (buf && (mode_ & Parse::TRACKMACRO
+ (buf && ((mode_ & Parse::TRACKMACRO)
? buf->usermacros.count(t.cs()) != 0
: buf->getMacro(t.cs(), false) != 0));
bool mathed_parse_cell(MathData & ar, docstring const & str, Parse::flags f)
{
- return Parser(str, f, ar.buffer()).parse(ar, 0, f & Parse::TEXTMODE ?
+ return Parser(str, f, ar.buffer()).parse(ar, 0, (f & Parse::TEXTMODE) ?
InsetMath::TEXT_MODE : InsetMath::MATH_MODE);
}
bool mathed_parse_normal(InsetMathGrid & grid, docstring const & str,
Parse::flags f)
{
- return Parser(str, f, &grid.buffer()).parse1(grid, 0, f & Parse::TEXTMODE ?
+ return Parser(str, f, &grid.buffer()).parse1(grid, 0, (f & Parse::TEXTMODE) ?
InsetMath::TEXT_MODE : InsetMath::MATH_MODE, false);
}