mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 12:32:26 +00:00
break parser::tokenize in parts
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27454 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
0aaed41dd7
commit
fa3ea10057
@ -351,17 +351,11 @@ string const Parser::verbatimEnvironment(string const & name)
|
||||
}
|
||||
|
||||
|
||||
void Parser::tokenize(istream & is)
|
||||
void Parser::tokenize_one(istream & is)
|
||||
{
|
||||
static bool init_done = false;
|
||||
|
||||
if (!init_done) {
|
||||
catInit();
|
||||
init_done = true;
|
||||
}
|
||||
|
||||
char c;
|
||||
while (is.get(c)) {
|
||||
if (!is.get(c))
|
||||
return;
|
||||
//cerr << "reading c: " << c << "\n";
|
||||
|
||||
switch (catcode(c)) {
|
||||
@ -431,6 +425,19 @@ void Parser::tokenize(istream & is)
|
||||
push_back(Token(c, catcode(c)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Parser::tokenize(istream & is)
|
||||
{
|
||||
static bool init_done = false;
|
||||
|
||||
if (!init_done) {
|
||||
catInit();
|
||||
init_done = true;
|
||||
}
|
||||
|
||||
while (is)
|
||||
tokenize_one(is);
|
||||
}
|
||||
|
||||
|
||||
|
@ -174,6 +174,8 @@ public:
|
||||
char getChar();
|
||||
///
|
||||
void error(std::string const & msg);
|
||||
/// Parses one token from \p is
|
||||
void tokenize_one(std::istream & is);
|
||||
/// Parses \p is into tokens
|
||||
void tokenize(std::istream & is);
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user