mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Lexer: Fixed /from/to/g detection at EOS
This commit is contained in:
parent
8b863c9764
commit
5af3f71ac5
1 changed files with 5 additions and 4 deletions
|
@ -829,7 +829,7 @@ bool Lexer::isPath (std::string& token, Lexer::Type& type)
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Lexer::Type::substitution
|
// Lexer::Type::substitution
|
||||||
// / <unquoted-string> / <unquoted-string> / [g]
|
// / <unquoted-string> / <unquoted-string> / [g] <EOS> | <isWhiteSpace>
|
||||||
bool Lexer::isSubstitution (std::string& token, Lexer::Type& type)
|
bool Lexer::isSubstitution (std::string& token, Lexer::Type& type)
|
||||||
{
|
{
|
||||||
std::size_t marker = _cursor;
|
std::size_t marker = _cursor;
|
||||||
|
@ -845,8 +845,9 @@ bool Lexer::isSubstitution (std::string& token, Lexer::Type& type)
|
||||||
if (_text[_cursor] == 'g')
|
if (_text[_cursor] == 'g')
|
||||||
++_cursor;
|
++_cursor;
|
||||||
|
|
||||||
// Lookahread: <isWhitespace>
|
// Lookahread: <EOS> | <isWhitespace>
|
||||||
if (isWhitespace (_text[_cursor]))
|
if (_text[_cursor] == '\0' ||
|
||||||
|
isWhitespace (_text[_cursor]))
|
||||||
{
|
{
|
||||||
token = _text.substr (marker, _cursor - marker);
|
token = _text.substr (marker, _cursor - marker);
|
||||||
type = Lexer::Type::substitution;
|
type = Lexer::Type::substitution;
|
||||||
|
@ -861,7 +862,7 @@ bool Lexer::isSubstitution (std::string& token, Lexer::Type& type)
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Lexer::Type::pattern
|
// Lexer::Type::pattern
|
||||||
// / <unquoted-string> /
|
// / <unquoted-string> / <EOS> | <isWhiteSpace>
|
||||||
bool Lexer::isPattern (std::string& token, Lexer::Type& type)
|
bool Lexer::isPattern (std::string& token, Lexer::Type& type)
|
||||||
{
|
{
|
||||||
std::size_t marker = _cursor;
|
std::size_t marker = _cursor;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue