Expressions

- Command line arguments are now handled a little differently.  Each
  argument is subjected to further splitting, to break up expressions
  early in the process, prior to categorization.
- Patterns are now treated as quoted string, where the quote character
  is /.
This commit is contained in:
Paul Beckingham
2011-06-13 23:06:54 -04:00
parent 087cf7e5ed
commit e0abee7f9f
4 changed files with 66 additions and 21 deletions

View File

@@ -45,26 +45,26 @@ Expression::Expression (Arguments& arguments)
{
_args.dump ("Expression::Expression");
if (is_new_style () && context.config.getBoolean ("expressions"))
{
bool new_style = is_new_style () && context.config.getBoolean ("expressions");
if (new_style)
context.debug ("Filter --> new");
expand_sequence ();
expand_tokens ();
postfix ();
}
else
{
context.debug ("Filter --> old");
expand_sequence ();
expand_sequence ();
if (new_style)
{
implicit_and ();
expand_tag ();
expand_pattern ();
expand_attr ();
expand_attmod ();
expand_word ();
expand_tokens ();
postfix ();
}
expand_tokens ();
postfix ();
}
////////////////////////////////////////////////////////////////////////////////
@@ -226,6 +226,9 @@ void Expression::expand_tokens ()
n.getQuoted ('\'', s, true))
temp.push_back (std::make_pair (s, "string"));
else if (n.getQuoted ('/', s, true))
temp.push_back (std::make_pair (s, "pattern"));
else if (n.getOneOf (operators, s))
temp.push_back (std::make_pair (s, "op"));