CLI2: ::lexArguments now uses ::readWord to expand escapes

This commit is contained in:
Paul Beckingham
2015-07-10 13:15:16 -04:00
parent b86c079ed5
commit 21be6862db

View File

@@ -436,6 +436,20 @@ void CLI2::lexArguments ()
_args.push_back (a); _args.push_back (a);
} }
else else
{
std::string::size_type cursor = 0;
std::string word;
if (Lexer::readWord ("'" + _original_args[i] + "'", "'", cursor, word))
{
A2 unknown (word, Lexer::Type::word);
if (lex.wasQuoted (_original_args[i]))
unknown.tag ("QUOTED");
_args.push_back (unknown);
}
// This branch may have no use-case.
else
{ {
A2 unknown (_original_args[i], Lexer::Type::word); A2 unknown (_original_args[i], Lexer::Type::word);
if (lex.wasQuoted (_original_args[i])) if (lex.wasQuoted (_original_args[i]))
@@ -444,6 +458,7 @@ void CLI2::lexArguments ()
_args.push_back (unknown); _args.push_back (unknown);
} }
} }
}
if (context.config.getInteger ("debug.parser") >= 3) if (context.config.getInteger ("debug.parser") >= 3)
context.debug (dump ("CLI2::analyze lexArguments")); context.debug (dump ("CLI2::analyze lexArguments"));