Skip to content
Permalink
Browse files

search string parser: fix -a expression (fixes #4025)

  • Loading branch information
jef-n committed Jun 30, 2011
1 parent 890b092 commit 061fba454420701de3babe505763af9e08ccc557
Showing with 14 additions and 1 deletion.
  1. +14 −1 src/core/qgssearchstringparser.yy
@@ -176,7 +176,20 @@ scalar_exp:
| scalar_exp '-' scalar_exp { $$ = new QgsSearchTreeNode(QgsSearchTreeNode::opMINUS,$1, $3); joinTmpNodes($$,$1,$3); }
| '(' scalar_exp ')' { $$ = $2; }
| '+' scalar_exp %prec UMINUS { $$ = $2; }
| '-' scalar_exp %prec UMINUS { $$ = $2; if ($$->type() == QgsSearchTreeNode::tNumber) $$->setNumber(- $$->number()); }
| '-' scalar_exp %prec UMINUS
{
if ( $2->type() == QgsSearchTreeNode::tNumber )
{
$$ = $2;
$$->setNumber(- $$->number());
}
else
{
QgsSearchTreeNode *null = new QgsSearchTreeNode( 0.0 );
$$ = new QgsSearchTreeNode( QgsSearchTreeNode::opMINUS, null, $2);
joinTmpNodes($$, $2, 0);
}
}
| scalar_exp CONCAT scalar_exp { $$ = new QgsSearchTreeNode(QgsSearchTreeNode::opCONCAT, $1, $3); joinTmpNodes($$, $1, $3); }
| ROWNUM { $$ = new QgsSearchTreeNode(QgsSearchTreeNode::opROWNUM, 0, 0); addToTmpNodes($$); }
| AREA { $$ = new QgsSearchTreeNode(QgsSearchTreeNode::opAREA, 0, 0); addToTmpNodes($$); }

0 comments on commit 061fba4

Please sign in to comment.
You can’t perform that action at this time.