mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Lexer: Added ::wasQuoted
This commit is contained in:
parent
88fe152dbe
commit
572da29b79
2 changed files with 12 additions and 0 deletions
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue