]> git.lyx.org Git - lyx.git/blobdiff - src/tex2lyx/Parser.h
Set CJK document language instead of adding a note.
[lyx.git] / src / tex2lyx / Parser.h
index 5e749e3019f40d8be6897664d0e68fed87ae94cb..59a89d5a75c901f2e9726fad0facc74efeb4bc5e 100644 (file)
@@ -87,8 +87,8 @@ public:
         *        ../mathed/MathParser.cpp (which is the anchestor of this
         *        class) uses a separate char member for this method. I
         *        believe that the intended usage is to not cover tokens with
-        *        catEscape, e.g. \code
-        *        return (cs_.empty() || cat_ == catEscape) ? 0 : cs_[0];
+        *        catEscape or catComment, e.g. \code
+        *        return (cs_.empty() || cat_ == catEscape || cat_ == catComment) ? 0 : cs_[0];
         *        \endcode
         *        All usages of this method should be checked. gb 2011-01-05
         */
@@ -157,18 +157,24 @@ public:
        typedef std::pair<bool, std::string> Arg;
        /*!
         * Get an argument enclosed by \p left and \p right.
+        * If \p allow_escaping is true, a right delimiter escaped by a
+        * backslash does not count as delimiter, but is included in the
+        * argument.
         * \returns wether an argument was found in \p Arg.first and the
         * argument in \p Arg.second. \see getArg().
         */
-       Arg getFullArg(char left, char right);
+       Arg getFullArg(char left, char right, bool allow_escaping = true);
        /*!
         * Get an argument enclosed by \p left and \p right.
+        * If \p allow_escaping is true, a right delimiter escaped by a
+        * backslash does not count as delimiter, but is included in the
+        * argument.
         * \returns the argument (without \p left and \p right) or the empty
         * string if the next non-space token is not \p left. Use
         * getFullArg() if you need to know wether there was an empty
         * argument or no argument at all.
         */
-       std::string getArg(char left, char right);
+       std::string getArg(char left, char right, bool allow_escaping = true);
        /*!
         * Like getOpt(), but distinguishes between a missing argument ""
         * and an empty argument "[]".
@@ -196,6 +202,19 @@ public:
         * is parsed but not returned.
         */
        std::string const verbatimEnvironment(std::string const & name);
+       /*
+        * The same as verbatimEnvironment(std::string const & name) but
+        * \begin and \end commands inside the name environment are not parsed.
+        * This function is designed to parse verbatim environments.
+        */
+       std::string const plainEnvironment(std::string const & name);
+       /*
+        * Basically the same as plainEnvironment(std::string const & name) but
+        * instead of \begin and \end commands the parsing is started/stopped
+        * at given characters.
+        * This function is designed to parse verbatim commands.
+        */
+       std::string const plainCommand(char left, char right, std::string const & name);
        /*!
         * Returns the character of the current token and increments
         * the token position.