* Licence details can be found in the file COPYING.
*
* \author Alejandro Aguilar Sierra
- * \author Lars Gullik Bjønnes
+ * \author Lars Gullik Bjønnes
* \author Jean-Marc Lasgouttes
* \author John Levon
*
char cc = 0;
is.get(cc);
c = cc;
- if (c >= ' ' && is) {
+ if ((c >= ' ' || c == '\t') && is) {
buff.clear();
if (c == '\\') { // first char == '\\'
buff.push_back(c);
is.get(cc);
c = cc;
- } while (c >= ' ' && c != '\\' && is);
+ } while ((c >= ' ' || c == '\t') && c != '\\' && is);
}
if (c == '\\')
pimpl_->setCommentChar(c);
}
+
int Lexer::lex()
{
return pimpl_->lex();
}
+// same for docstring
+docstring Lexer::quoteString(docstring const & arg)
+{
+ docstring res;
+ res += '"';
+ res += subst(subst(arg, from_ascii("\\"), from_ascii("\\\\")),
+ from_ascii("\""), from_ascii("\\\""));
+ res += '"';
+ return res;
+}
+
+
Lexer & Lexer::operator>>(char const * required)
{
string token;