lyxlex-2-a.diff

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6795 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2003-04-14 13:12:40 +00:00
parent 7b41119463
commit e25012ddfa
7 changed files with 34 additions and 37 deletions

View File

@ -1,3 +1,9 @@
2003-04-14 Lars Gullik Bjønnes <larsbj@gullik.net>
* lyxlex.[Ch] (text): delete function
* trans.C (Load): adjust
* paragraph_funcs.C (readParToken): adjust
2003-04-14 Lars Gullik Bjønnes <larsbj@gullik.net>
* lyxlex_pimpl.h: get rid of LEX_MAX_BUFF, change buff to be a

View File

@ -223,7 +223,7 @@ void FormPreferences::build()
folder = lang_opts_tab_->tabfolder_inner;
fl_set_tabfolder_autofit(folder, FL_FIT);
}
// Stack tabs
// Now add them to the tabfolder
fl_addto_tabfolder(dialog_->tabfolder_prefs,

View File

@ -52,12 +52,6 @@ int LyXLex::getLineNo() const
}
string const LyXLex::text() const
{
return pimpl_->getString();
}
istream & LyXLex::getStream()
{
return pimpl_->is;

View File

@ -99,9 +99,6 @@ public:
///
int findToken(char const * str[]);
///
string const text() const;
/** Pushes a token list on a stack and replaces it with a new one.
*/
void pushTable(keyword_item *, int);

View File

@ -171,7 +171,7 @@ bool LyXLex::Pimpl::next(bool esc /* = false */)
// That is not fast... (Lgb)
string dummy;
getline(is, dummy);
lyxerr[Debug::LYXLEX] << "Comment read: `" << c
<< dummy << '\'' << endl;
#else
@ -184,7 +184,7 @@ bool LyXLex::Pimpl::next(bool esc /* = false */)
if (c == '\"') {
buff.clear();
do {
is.get(cc);
c = cc;
@ -212,7 +212,7 @@ bool LyXLex::Pimpl::next(bool esc /* = false */)
// lot better to use the functions from cctype
if (c > ' ' && is) {
buff.clear();
do {
buff.push_back(c);
is.get(cc);
@ -255,7 +255,7 @@ bool LyXLex::Pimpl::next(bool esc /* = false */)
if (c == '\\') {
// escape
buff.clear();
do {
if (c == '\\') {
// escape the next char
@ -277,7 +277,7 @@ bool LyXLex::Pimpl::next(bool esc /* = false */)
// That is still not fast... (Lgb)
string dummy;
getline(is, dummy);
lyxerr[Debug::LYXLEX] << "Comment read: `" << c
<< dummy << '\'' << endl;
#else
@ -292,7 +292,7 @@ bool LyXLex::Pimpl::next(bool esc /* = false */)
// string
if (c == '\"') {
buff.clear();
bool escaped = false;
do {
escaped = false;
@ -326,7 +326,7 @@ bool LyXLex::Pimpl::next(bool esc /* = false */)
if (c > ' ' && is) {
buff.clear();
do {
if (c == '\\') {
// escape the next char
@ -384,7 +384,7 @@ int LyXLex::Pimpl::lex()
bool LyXLex::Pimpl::eatLine()
{
buff.clear();
unsigned char c = '\0';
char cc = 0;
while (is && c != '\n') {
@ -433,7 +433,7 @@ bool LyXLex::Pimpl::nextToken()
c = cc;
if (c >= ' ' && is) {
buff.clear();
if (c == '\\') { // first char == '\\'
do {
buff.push_back(c);

View File

@ -973,11 +973,11 @@ int readParToken(Buffer & buf, Paragraph & par, LyXLex & lex, string const & tok
lex.eatLine();
#if USE_BOOST_FORMAT
boost::format fmt(_("Unknown token: %1$s %2$s\n"));
fmt % token % lex.text();
fmt % token % lex.getString();
string const s = fmt.str();
#else
string const s = _("Unknown token: ") + token
+ ' ' + lex.text() + '\n';
+ ' ' + lex.getString() + '\n';
#endif
// we can do this here this way because we're actually reading
// the buffer and don't care about LyXText right now.

View File

@ -115,10 +115,10 @@ int Trans::Load(LyXLex & lex)
case KMOD:
{
if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "KMOD:\t" << lex.text() << endl;
lyxerr << "KMOD:\t" << lex.getString() << endl;
if (lex.next(true)) {
if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "key\t`" << lex.text()
lyxerr << "key\t`" << lex.getString()
<< '\'' << endl;
} else
return -1;
@ -127,7 +127,7 @@ int Trans::Load(LyXLex & lex)
if (lex.next(true)) {
if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "accent\t`" << lex.text()
lyxerr << "accent\t`" << lex.getString()
<< '\'' << endl;
} else
return -1;
@ -143,7 +143,7 @@ int Trans::Load(LyXLex & lex)
// so that this field is not present anymore.
if (lex.next(true)) {
if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "allowed\t`" << lex.text()
lyxerr << "allowed\t`" << lex.getString()
<< '\'' << endl;
} else
return -1;
@ -160,7 +160,7 @@ int Trans::Load(LyXLex & lex)
lyxerr[Debug::KBMAP] << "KCOMB:" << endl;
if (lex.next(true)) {
str= lex.text();
str = lex.getString();
lyxerr[Debug::KBMAP] << str << endl;
} else
return -1;
@ -169,7 +169,7 @@ int Trans::Load(LyXLex & lex)
if (accent_1 == TEX_NOACCENT) return -1;
if (lex.next(true)) {
str = lex.text();
str = lex.getString();
lyxerr[Debug::KBMAP] << str << endl;
} else
return -1;
@ -214,17 +214,17 @@ int Trans::Load(LyXLex & lex)
unsigned char key_from;
if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "KMAP:\t" << lex.text() << endl;
lyxerr << "KMAP:\t" << lex.getString() << endl;
if (lex.next(true)) {
key_from = lex.text()[0];
key_from = lex.getString()[0];
if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "\t`" << lex.text() << '\''
lyxerr << "\t`" << lex.getString() << '\''
<< endl;
} else
return -1;
if (lex.next(true)) {
string string_to = lex.text();
string const string_to = lex.getString();
keymap_[key_from] = string_to;
if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "\t`" << string_to << '\''
@ -240,10 +240,10 @@ int Trans::Load(LyXLex & lex)
string str;
if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "KXMOD:\t" << lex.text() << endl;
lyxerr << "KXMOD:\t" << lex.getString() << endl;
if (lex.next(true)) {
if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "\t`" << lex.text() << '\''
lyxerr << "\t`" << lex.getString() << '\''
<< endl;
accent = getkeymod(lex.getString());
} else
@ -251,17 +251,17 @@ int Trans::Load(LyXLex & lex)
if (lex.next(true)) {
if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "\t`" << lex.text() << '\''
lyxerr << "\t`" << lex.getString() << '\''
<< endl;
key = lex.text()[0];
key = lex.getString()[0];
} else
return -1;
if (lex.next(true)) {
if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "\t`" << lex.text() << '\''
lyxerr << "\t`" << lex.getString() << '\''
<< endl;
str = lex.text();
str = lex.getString();
} else
return -1;