diff --git a/src/core/qgsexpressionlexer.ll b/src/core/qgsexpressionlexer.ll index 6f971fd1d539..7abb33975986 100644 --- a/src/core/qgsexpressionlexer.ll +++ b/src/core/qgsexpressionlexer.ll @@ -132,45 +132,48 @@ string "'"{str_char}*"'" \n yylineno++; } -"NOT" { U_OP(uoNot); return NOT; } -"AND" { B_OP(boAnd); return AND; } -"OR" { B_OP(boOr); return OR; } - -"=" { B_OP(boEQ); return EQ; } -"!=" { B_OP(boNE); return NE; } -"<=" { B_OP(boLE); return LE; } -">=" { B_OP(boGE); return GE; } -"<>" { B_OP(boNE); return NE; } -"<" { B_OP(boLT); return LT; } -">" { B_OP(boGT); return GT; } - -"~" { B_OP(boRegexp); return REGEXP; } -"LIKE" { B_OP(boLike); return LIKE; } -"ILIKE" { B_OP(boILike); return LIKE; } -"IS" { B_OP(boIs); return IS; } -"||" { B_OP(boConcat); return CONCAT; } - -"+" { B_OP(boPlus); return PLUS; } -"-" { B_OP(boMinus); return MINUS; } -"*" { B_OP(boMul); return MUL; } -"//" { B_OP(boIntDiv); return INTDIV; } -"/" { B_OP(boDiv); return DIV; } -"%" { B_OP(boMod); return MOD; } -"^" { B_OP(boPow); return POW; } - -"IN" { return IN; } - -"NULL" { return NULLVALUE; } - -"CASE" { return CASE; } -"WHEN" { return WHEN; } -"THEN" { return THEN; } -"ELSE" { return ELSE; } -"END" { return END; } - -[()] { return yytext[0]; } - -"," { return COMMA; } +"NOT" { U_OP(uoNot); return NOT; } +"AND" { B_OP(boAnd); return AND; } +"OR" { B_OP(boOr); return OR; } + +"=" { B_OP(boEQ); return EQ; } +"!=" { B_OP(boNE); return NE; } +"<=" { B_OP(boLE); return LE; } +">=" { B_OP(boGE); return GE; } +"<>" { B_OP(boNE); return NE; } +"<" { B_OP(boLT); return LT; } +">" { B_OP(boGT); return GT; } + +"~" { B_OP(boRegexp); return REGEXP; } +"LIKE" { B_OP(boLike); return LIKE; } +"NOT"{white}"LIKE" { B_OP(boNotLike); return LIKE; } +"ILIKE" { B_OP(boILike); return LIKE; } +"NOT"{white}"ILIKE" { B_OP(boNotILike); return LIKE; } +"IS" { B_OP(boIs); return IS; } +"IS"{white}"NOT" { B_OP(boIsNot); return IS; } +"||" { B_OP(boConcat); return CONCAT; } + +"+" { B_OP(boPlus); return PLUS; } +"-" { B_OP(boMinus); return MINUS; } +"*" { B_OP(boMul); return MUL; } +"//" { B_OP(boIntDiv); return INTDIV; } +"/" { B_OP(boDiv); return DIV; } +"%" { B_OP(boMod); return MOD; } +"^" { B_OP(boPow); return POW; } + +"IN" { return IN; } + +"NULL" { return NULLVALUE; } + +"CASE" { return CASE; } +"WHEN" { return WHEN; } +"THEN" { return THEN; } +"ELSE" { return ELSE; } +"END" { return END; } + +[()] { return yytext[0]; } + +"," { return COMMA; } {num_float} { yylval->numberFloat = cLocale.toDouble( QString::fromAscii(yytext) ); return NUMBER_FLOAT; } {num_int} { diff --git a/src/core/qgsexpressionparser.yy b/src/core/qgsexpressionparser.yy index 13351cd8ba2e..0135bf7df82c 100644 --- a/src/core/qgsexpressionparser.yy +++ b/src/core/qgsexpressionparser.yy @@ -168,9 +168,7 @@ expression: | expression GT expression { $$ = BINOP($2, $1, $3); } | expression REGEXP expression { $$ = BINOP($2, $1, $3); } | expression LIKE expression { $$ = BINOP($2, $1, $3); } - | expression NOT LIKE expression { $$ = BINOP($3==QgsExpression::boLike ? QgsExpression::boNotLike : QgsExpression::boNotILike, $1, $4); } | expression IS expression { $$ = BINOP($2, $1, $3); } - | expression IS NOT expression { $$ = BINOP(QgsExpression::boIsNot, $1, $4); } | expression PLUS expression { $$ = BINOP($2, $1, $3); } | expression MINUS expression { $$ = BINOP($2, $1, $3); } | expression MUL expression { $$ = BINOP($2, $1, $3); } @@ -181,7 +179,6 @@ expression: | expression CONCAT expression { $$ = BINOP($2, $1, $3); } | NOT expression { $$ = new QgsExpression::NodeUnaryOperator($1, $2); } | '(' expression ')' { $$ = $2; } - | FUNCTION '(' exp_list ')' { int fnIndex = QgsExpression::functionIndex(*$1);