mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-27 00:57:19 +02:00
Lexer: Improved ::decomposePattern to extract raw string
This commit is contained in:
parent
41a76c6798
commit
4f0e32b69b
1 changed files with 5 additions and 7 deletions
|
@ -1395,18 +1395,16 @@ bool Lexer::decomposePattern (
|
|||
std::string& pattern,
|
||||
std::string& flags)
|
||||
{
|
||||
std::string parsed_pattern;
|
||||
std::string ignored;
|
||||
std::string::size_type cursor = 0;
|
||||
if (readWord (text, "/", cursor, parsed_pattern) &&
|
||||
parsed_pattern.length ())
|
||||
if (readWord (text, "/", cursor, ignored) &&
|
||||
ignored.length ())
|
||||
{
|
||||
std::string parsed_flags = text.substr (cursor);
|
||||
auto parsed_flags = text.substr (cursor);
|
||||
if (parsed_flags.find ("/") == std::string::npos)
|
||||
{
|
||||
dequote (parsed_pattern, "/");
|
||||
|
||||
pattern = parsed_pattern;
|
||||
flags = parsed_flags;
|
||||
pattern = text.substr (1, cursor - 2 - flags.length ());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue