mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
CLI2: Added ::lexArguments to perform *all* lexing
This commit is contained in:
parent
ab367145c6
commit
9d5a10bd89
2 changed files with 24 additions and 15 deletions
38
src/CLI2.cpp
38
src/CLI2.cpp
|
@ -375,21 +375,10 @@ void CLI2::handleArg0 ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Intended to be called after ::add() to perform the final analysis.
|
||||
void CLI2::analyze ()
|
||||
void CLI2::lexArguments ()
|
||||
{
|
||||
if (context.config.getInteger ("debug.parser") >= 3)
|
||||
{
|
||||
context.debug ("---------------------------------------------------------------------------------");
|
||||
context.debug (dump ("CLI2::analyze start"));
|
||||
}
|
||||
|
||||
// Start from scratch.
|
||||
_args.clear ();
|
||||
handleArg0 ();
|
||||
|
||||
// Look at each arg, and decide if it warrants lexing.
|
||||
// Note: Starts interating at index 1.
|
||||
// Note: Starts interating at index 1, because ::handleArg0 has already
|
||||
// processed it.
|
||||
for (unsigned int i = 1; i < _original_args.size (); ++i)
|
||||
{
|
||||
std::string lexeme;
|
||||
|
@ -401,7 +390,26 @@ void CLI2::analyze ()
|
|||
_args.push_back (A2 ("arg", lexeme, type));
|
||||
}
|
||||
|
||||
// Now process _args.
|
||||
if (context.config.getInteger ("debug.parser") >= 3)
|
||||
context.debug (dump ("CLI2::analyze lexArguments"));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Intended to be called after ::add() to perform the final analysis.
|
||||
void CLI2::analyze ()
|
||||
{
|
||||
if (context.config.getInteger ("debug.parser") >= 3)
|
||||
{
|
||||
context.debug ("---------------------------------------------------------------------------------");
|
||||
context.debug (dump ("CLI2::analyze start"));
|
||||
}
|
||||
|
||||
// Process _original_args.
|
||||
_args.clear ();
|
||||
handleArg0 ();
|
||||
lexArguments ();
|
||||
|
||||
// Process _args.
|
||||
aliasExpansion ();
|
||||
findOverrides ();
|
||||
|
||||
|
|
|
@ -111,6 +111,7 @@ private:
|
|||
void addArg (const std::string&);
|
||||
*/
|
||||
void handleArg0 ();
|
||||
void lexArguments ();
|
||||
void aliasExpansion ();
|
||||
void findOverrides ();
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue