mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-10 20:04:46 +00:00
cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22533 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
e69b723bf9
commit
f7e4d591dc
@ -111,13 +111,13 @@ private:
|
|||||||
///
|
///
|
||||||
void verifyTable();
|
void verifyTable();
|
||||||
///
|
///
|
||||||
class pushed_table {
|
class PushedTable {
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
pushed_table()
|
PushedTable()
|
||||||
: table_elem(0), table_siz(0) {}
|
: table_elem(0), table_siz(0) {}
|
||||||
///
|
///
|
||||||
pushed_table(keyword_item * ki, int siz)
|
PushedTable(keyword_item * ki, int siz)
|
||||||
: table_elem(ki), table_siz(siz) {}
|
: table_elem(ki), table_siz(siz) {}
|
||||||
///
|
///
|
||||||
keyword_item * table_elem;
|
keyword_item * table_elem;
|
||||||
@ -125,14 +125,14 @@ private:
|
|||||||
int table_siz;
|
int table_siz;
|
||||||
};
|
};
|
||||||
///
|
///
|
||||||
stack<pushed_table> pushed;
|
stack<PushedTable> pushed;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
class compare_tags
|
class CompareTags
|
||||||
: public binary_function<keyword_item, keyword_item, bool> {
|
: public binary_function<keyword_item, keyword_item, bool> {
|
||||||
public:
|
public:
|
||||||
// used by lower_bound, sort and sorted
|
// used by lower_bound, sort and sorted
|
||||||
@ -191,14 +191,14 @@ void Lexer::Pimpl::verifyTable()
|
|||||||
{
|
{
|
||||||
// Check if the table is sorted and if not, sort it.
|
// Check if the table is sorted and if not, sort it.
|
||||||
if (table
|
if (table
|
||||||
&& !lyx::sorted(table, table + no_items, compare_tags())) {
|
&& !lyx::sorted(table, table + no_items, CompareTags())) {
|
||||||
lyxerr << "The table passed to Lexer is not sorted!\n"
|
lyxerr << "The table passed to Lexer is not sorted!\n"
|
||||||
<< "Tell the developers to fix it!" << endl;
|
<< "Tell the developers to fix it!" << endl;
|
||||||
// We sort it anyway to avoid problems.
|
// We sort it anyway to avoid problems.
|
||||||
lyxerr << "\nUnsorted:" << endl;
|
lyxerr << "\nUnsorted:" << endl;
|
||||||
printTable(lyxerr);
|
printTable(lyxerr);
|
||||||
|
|
||||||
sort(table, table + no_items, compare_tags());
|
sort(table, table + no_items, CompareTags());
|
||||||
lyxerr << "\nSorted:" << endl;
|
lyxerr << "\nSorted:" << endl;
|
||||||
printTable(lyxerr);
|
printTable(lyxerr);
|
||||||
}
|
}
|
||||||
@ -207,7 +207,7 @@ void Lexer::Pimpl::verifyTable()
|
|||||||
|
|
||||||
void Lexer::Pimpl::pushTable(keyword_item * tab, int num)
|
void Lexer::Pimpl::pushTable(keyword_item * tab, int num)
|
||||||
{
|
{
|
||||||
pushed_table tmppu(table, no_items);
|
PushedTable tmppu(table, no_items);
|
||||||
pushed.push(tmppu);
|
pushed.push(tmppu);
|
||||||
|
|
||||||
table = tab;
|
table = tab;
|
||||||
@ -224,7 +224,7 @@ void Lexer::Pimpl::popTable()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
pushed_table tmp = pushed.top();
|
PushedTable tmp = pushed.top();
|
||||||
pushed.pop();
|
pushed.pop();
|
||||||
table = tmp.table_elem;
|
table = tmp.table_elem;
|
||||||
no_items = tmp.table_siz;
|
no_items = tmp.table_siz;
|
||||||
@ -486,7 +486,7 @@ int Lexer::Pimpl::search_kw(char const * const tag) const
|
|||||||
keyword_item search_tag = { tag, 0 };
|
keyword_item search_tag = { tag, 0 };
|
||||||
keyword_item * res =
|
keyword_item * res =
|
||||||
lower_bound(table, table + no_items,
|
lower_bound(table, table + no_items,
|
||||||
search_tag, compare_tags());
|
search_tag, CompareTags());
|
||||||
// use the compare_ascii_no_case instead of compare_no_case,
|
// use the compare_ascii_no_case instead of compare_no_case,
|
||||||
// because in turkish, 'i' is not the lowercase version of 'I',
|
// because in turkish, 'i' is not the lowercase version of 'I',
|
||||||
// and thus turkish locale breaks parsing of tags.
|
// and thus turkish locale breaks parsing of tags.
|
||||||
@ -574,7 +574,8 @@ bool Lexer::Pimpl::nextToken()
|
|||||||
} while (c >= ' ' && c != '\\' && is);
|
} while (c >= ' ' && c != '\\' && is);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c == '\\') is.putback(c); // put it back
|
if (c == '\\')
|
||||||
|
is.putback(c); // put it back
|
||||||
status = LEX_TOKEN;
|
status = LEX_TOKEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user