]> git.lyx.org Git - features.git/commitdiff
cleanup parser code at least
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 18 Apr 2008 12:26:21 +0000 (12:26 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 18 Apr 2008 12:26:21 +0000 (12:26 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24323 a592a061-630c-0410-9148-cb99ea01b6c8

src/tex2lyx/Parser.cpp
src/tex2lyx/Parser.h

index f1b3514316573c6d8304c579c933820e3ab3f948..3ceda050f5eca577349a8b85c1c9242a7e97a78b 100644 (file)
@@ -307,7 +307,7 @@ string Parser::getFullOpt()
        Arg arg = getFullArg('[', ']');
        if (arg.first)
                return '[' + arg.second + ']';
-       return arg.second;
+       return string();
 }
 
 
@@ -317,14 +317,16 @@ string Parser::getOpt()
        return res.empty() ? string() : '[' + res + ']';
 }
 
+
 string Parser::getFullParentheseArg()
 {
        Arg arg = getFullArg('(', ')');
        if (arg.first)
                return '(' + arg.second + ')';
-       return arg.second;
+       return string();
 }
 
+
 string const Parser::verbatimEnvironment(string const & name)
 {
        if (!good())
index 5dcbc56aaa3485836dd6909bd8a923c703231251..713cbfcfa1eea1182f01d93f0028ecb9f31c7af2 100644 (file)
@@ -148,20 +148,29 @@ public:
        std::string getArg(char left, char right);
        /*!
         * \returns getFullArg('[', ']') including the brackets or the
-        * empty string if no argument was found.
+        * empty string if there is no such argument.
         */
        std::string getFullOpt();
-       /// \returns getArg('[', ']') including the brackets
+       /*!
+        * \returns getArg('[', ']') including the brackets or the
+        * empty string if there is no such argument.
+        */
        std::string getOpt();
+       /*!
+        * \returns getFullArg('(', ')') including the parentheses or the
+        * empty string if there is no such argument.
+        */
+       std::string getFullParentheseArg();
        /*!
         * \returns the contents of the environment \p name.
         * <tt>\begin{name}</tt> must be parsed already, <tt>\end{name}</tt>
         * is parsed but not returned.
         */
-       std::string getFullParentheseArg();
-       /// \returns getArg('(', ')') including the parentheses
        std::string const verbatimEnvironment(std::string const & name);
-       /// Returns the character of the current token and increments the token position.
+       /*!
+        * Returns the character of the current token and increments
+        * the token position.
+        */
        char getChar();
        ///
        void error(std::string const & msg);