Lexer: Added ::wasQuoted

This commit is contained in:
Paul Beckingham 2016-04-02 16:25:42 -04:00
parent 88fe152dbe
commit 572da29b79
2 changed files with 12 additions and 0 deletions

View file

@ -304,6 +304,17 @@ std::string Lexer::dequote (const std::string& input, const std::string& quotes)
return input;
}
////////////////////////////////////////////////////////////////////////////////
// Detects characters in an input string that indicate quotes were required, or
// escapes, to get them past the shell.
bool Lexer::wasQuoted (const std::string& input)
{
if (input.find_first_of (" \t()<>&~") != std::string::npos)
return true;
return false;
}
////////////////////////////////////////////////////////////////////////////////
bool Lexer::isEOS () const
{

View file

@ -61,6 +61,7 @@ public:
static bool isBoundary (int, int);
static bool isHardBoundary (int, int);
static bool isPunctuation (int);
static bool wasQuoted (const std::string&);
static bool readWord (const std::string&, const std::string&, std::string::size_type&, std::string&);
static bool readWord (const std::string&, std::string::size_type&, std::string&);
static int hexToInt (int);