X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftex2lyx%2FParser.cpp;h=a538c760efe2ac8f83002cd2a581544bf5c8cfe4;hb=a2b21e3cd4bbfd42e59161143eba6e7681aaa93f;hp=5b12dddb9e4854a0683c67f4cfddee1e47f9ba93;hpb=506ae2d2ea1e646461841c57edd3f79c97d671c2;p=lyx.git diff --git a/src/tex2lyx/Parser.cpp b/src/tex2lyx/Parser.cpp index 5b12dddb9e..a538c760ef 100644 --- a/src/tex2lyx/Parser.cpp +++ b/src/tex2lyx/Parser.cpp @@ -577,6 +577,26 @@ string Parser::getFullParentheseArg() } +bool Parser::hasListPreamble(string const itemcmd) +{ + // remember current position + unsigned int oldpos = pos_; + // jump over arguments + if (hasOpt()) + getOpt(); + if (hasOpt("{")) + getArg('{', '}'); + // and swallow spaces and comments + skip_spaces(true); + // we have a list preamble if the next thing + // that follows is not the \item command + bool res = next_token().cs() != itemcmd; + // back to orig position + pos_ = oldpos; + return res; +} + + string const Parser::ertEnvironment(string const & name) { if (!good())