LyXLex::Pimpl::Pimpl(keyword_item * tab, int num)
: is(&fb__), table(tab), no_items(num),
- status(0), lineno(0)
+ status(0), lineno(0), commentChar('#')
{
verifyTable();
}
void LyXLex::Pimpl::printTable(ostream & os)
{
os << "\nNumber of tags: " << no_items << '\n';
- for(int i= 0; i < no_items; ++i)
+ for (int i= 0; i < no_items; ++i)
os << "table[" << i
<< "]: tag: `" << table[i].tag
<< "' code:" << table[i].code << '\n';
lineno = 0;
}
+void LyXLex::Pimpl::setCommentChar(char c)
+{
+ commentChar = c;
+}
+
bool LyXLex::Pimpl::next(bool esc /* = false */)
{
while (is && !status) {
is.get(cc);
c = cc;
- if (c == '#') {
+ if (c == commentChar) {
// Read rest of line (fast :-)
+ // That is not fast... (Lgb)
+#if 1
is.getline(buff, sizeof(buff));
lyxerr[Debug::LYXLEX] << "Comment read: `" << c
<< buff << "'" << endl;
+#else
+ // unfortunately is ignore buggy (Lgb)
+ is.ignore(100, '\n');
+#endif
++lineno;
continue;
}
continue;
}
- if (c == '#') {
+ if (c == commentChar) {
// Read rest of line (fast :-)
+ // That is still not fast... (Lgb)
+#if 1
is.getline(buff, sizeof(buff));
lyxerr[Debug::LYXLEX] << "Comment read: `" << c
<< buff << "'" << endl;
+#else
+ // but ignore is also still buggy (Lgb)
+ // This is fast (Lgb)
+ is.ignore(100, '\n');
+#endif
++lineno;
continue;
}