#include "lyxlex_pimpl.h"
#include "support/lyxalgo.h"
#include "support/filetools.h"
+#include "support/lstrings.h"
#include "debug.h"
using std::sort;
// used by lower_bound, sort and sorted
inline
int operator()(keyword_item const & a, keyword_item const & b) const {
- return compare_no_case(a.tag, b.tag) < 0;
+ // we use the ascii version, because in turkish, 'i'
+ // is not the lowercase version of 'I', and thus
+ // turkish locale breaks parsing of tags.
+ return compare_ascii_no_case(a.tag, b.tag) < 0;
}
};
// } // end of anon namespace
}
-string const LyXLex::Pimpl::GetString() const
+string const LyXLex::Pimpl::getString() const
{
return string(buff);
}
void LyXLex::Pimpl::printError(string const & message) const
{
- string tmpmsg = subst(message, "$$Token", GetString());
+ string const tmpmsg = subst(message, "$$Token", getString());
lyxerr << "LyX: " << tmpmsg << " [around line " << lineno
<< " of file " << MakeDisplayPath(name) << ']' << endl;
}
lyxerr[Debug::LYXLEX] << "Comment read: `" << c
<< buff << "'" << endl;
#else
- // unfortunately is ignore buggy (Lgb)
+ // unfortunately ignore is buggy (Lgb)
is.ignore(100, '\n');
#endif
++lineno;
// escape the next char
is.get(cc);
c = cc;
- escaped = true;
+ if (c == '\"' || c == '\\')
+ escaped = true;
+ else
+ buff[++i] = '\\';
}
buff[++i] = c;
}
-bool LyXLex::Pimpl::EatLine()
+bool LyXLex::Pimpl::eatLine()
{
int i = 0;
unsigned char c = '\0';