Get rid of Token::asString(), which is equivalent to cs().

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32439 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2009-12-09 11:53:16 +00:00
parent 52061b8313
commit ccfcd71b36
4 changed files with 7 additions and 15 deletions

View File

@ -110,12 +110,6 @@ ostream & operator<<(ostream & os, Token const & t)
} }
string Token::asString() const
{
return cs_;
}
string Token::asInput() const string Token::asInput() const
{ {
if (cat_ == catComment) if (cat_ == catComment)
@ -492,7 +486,7 @@ string Parser::verbatimOption()
putback(); putback();
res += '{' + verbatim_item() + '}'; res += '{' + verbatim_item() + '}';
} else } else
res += t.asString(); res += t.cs();
} }
} }
return res; return res;

View File

@ -77,14 +77,12 @@ public:
/// ///
Token(docstring const & cs, CatCode cat) : cs_(to_utf8(cs)), cat_(cat) {} Token(docstring const & cs, CatCode cat) : cs_(to_utf8(cs)), cat_(cat) {}
/// /// Returns the token as string
std::string const & cs() const { return cs_; } std::string const & cs() const { return cs_; }
/// Returns the catcode of the token /// Returns the catcode of the token
CatCode cat() const { return cat_; } CatCode cat() const { return cat_; }
/// ///
char character() const { return cs_.empty() ? 0 : cs_[0]; } char character() const { return cs_.empty() ? 0 : cs_[0]; }
/// Returns the token as string
std::string asString() const;
/// Returns the token verbatim /// Returns the token verbatim
std::string asInput() const; std::string asInput() const;

View File

@ -347,7 +347,7 @@ void handle_package(Parser &p, string const & name, string const & opts,
if (opts.find(",") == string::npos && one_language == true) { if (opts.find(",") == string::npos && one_language == true) {
if (opts == "ascii") if (opts == "ascii")
//change ascii to auto to be in the unicode range, see //change ascii to auto to be in the unicode range, see
//http://bugzilla.lyx.org/show_bug.cgi?id=4719 //http://www.lyx.org/trac/ticket/4719
h_inputencoding = "auto"; h_inputencoding = "auto";
else if (!opts.empty()) else if (!opts.empty())
h_inputencoding = opts; h_inputencoding = opts;
@ -741,7 +741,7 @@ void parse_preamble(Parser & p, ostream & os,
else if (t.cs() == "def") { else if (t.cs() == "def") {
string name = p.get_token().cs(); string name = p.get_token().cs();
while (p.next_token().cat() != catBegin) while (p.next_token().cat() != catBegin)
name += p.get_token().asString(); name += p.get_token().cs();
if (!in_lyx_preamble) if (!in_lyx_preamble)
h_preamble << "\\def\\" << name << '{' h_preamble << "\\def\\" << name << '{'
<< p.verbatim_item() << "}"; << p.verbatim_item() << "}";

View File

@ -1484,9 +1484,9 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
else else
simple = false; simple = false;
} else } else
paramtext += p.get_token().asString(); paramtext += p.get_token().cs();
} else { } else {
paramtext += p.get_token().asString(); paramtext += p.get_token().cs();
simple = false; simple = false;
} }
} }
@ -1816,7 +1816,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
else if (t.cs() == "listof") { else if (t.cs() == "listof") {
p.skip_spaces(true); p.skip_spaces(true);
string const name = p.get_token().asString(); string const name = p.get_token().cs();
if (context.textclass.floats().typeExist(name)) { if (context.textclass.floats().typeExist(name)) {
context.check_layout(os); context.check_layout(os);
begin_inset(os, "FloatList "); begin_inset(os, "FloatList ");