Skip to content

Commit 3600046

Browse files
committedFeb 15, 2016
alternate fix for #13938 (folloup 5d989ab)
1 parent 6a3753e commit 3600046

File tree

2 files changed

+42
-42
lines changed

2 files changed

+42
-42
lines changed
 

‎src/core/qgsexpressionlexer.ll

Lines changed: 42 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -132,45 +132,48 @@ string "'"{str_char}*"'"
132132
\n yylineno++;
133133
}
134134
135-
"NOT" { U_OP(uoNot); return NOT; }
136-
"AND" { B_OP(boAnd); return AND; }
137-
"OR" { B_OP(boOr); return OR; }
138-
139-
"=" { B_OP(boEQ); return EQ; }
140-
"!=" { B_OP(boNE); return NE; }
141-
"<=" { B_OP(boLE); return LE; }
142-
">=" { B_OP(boGE); return GE; }
143-
"<>" { B_OP(boNE); return NE; }
144-
"<" { B_OP(boLT); return LT; }
145-
">" { B_OP(boGT); return GT; }
146-
147-
"~" { B_OP(boRegexp); return REGEXP; }
148-
"LIKE" { B_OP(boLike); return LIKE; }
149-
"ILIKE" { B_OP(boILike); return LIKE; }
150-
"IS" { B_OP(boIs); return IS; }
151-
"||" { B_OP(boConcat); return CONCAT; }
152-
153-
"+" { B_OP(boPlus); return PLUS; }
154-
"-" { B_OP(boMinus); return MINUS; }
155-
"*" { B_OP(boMul); return MUL; }
156-
"//" { B_OP(boIntDiv); return INTDIV; }
157-
"/" { B_OP(boDiv); return DIV; }
158-
"%" { B_OP(boMod); return MOD; }
159-
"^" { B_OP(boPow); return POW; }
160-
161-
"IN" { return IN; }
162-
163-
"NULL" { return NULLVALUE; }
164-
165-
"CASE" { return CASE; }
166-
"WHEN" { return WHEN; }
167-
"THEN" { return THEN; }
168-
"ELSE" { return ELSE; }
169-
"END" { return END; }
170-
171-
[()] { return yytext[0]; }
172-
173-
"," { return COMMA; }
135+
"NOT" { U_OP(uoNot); return NOT; }
136+
"AND" { B_OP(boAnd); return AND; }
137+
"OR" { B_OP(boOr); return OR; }
138+
139+
"=" { B_OP(boEQ); return EQ; }
140+
"!=" { B_OP(boNE); return NE; }
141+
"<=" { B_OP(boLE); return LE; }
142+
">=" { B_OP(boGE); return GE; }
143+
"<>" { B_OP(boNE); return NE; }
144+
"<" { B_OP(boLT); return LT; }
145+
">" { B_OP(boGT); return GT; }
146+
147+
"~" { B_OP(boRegexp); return REGEXP; }
148+
"LIKE" { B_OP(boLike); return LIKE; }
149+
"NOT"{white}"LIKE" { B_OP(boNotLike); return LIKE; }
150+
"ILIKE" { B_OP(boILike); return LIKE; }
151+
"NOT"{white}"ILIKE" { B_OP(boNotILike); return LIKE; }
152+
"IS" { B_OP(boIs); return IS; }
153+
"IS"{white}"NOT" { B_OP(boIsNot); return IS; }
154+
"||" { B_OP(boConcat); return CONCAT; }
155+
156+
"+" { B_OP(boPlus); return PLUS; }
157+
"-" { B_OP(boMinus); return MINUS; }
158+
"*" { B_OP(boMul); return MUL; }
159+
"//" { B_OP(boIntDiv); return INTDIV; }
160+
"/" { B_OP(boDiv); return DIV; }
161+
"%" { B_OP(boMod); return MOD; }
162+
"^" { B_OP(boPow); return POW; }
163+
164+
"IN" { return IN; }
165+
166+
"NULL" { return NULLVALUE; }
167+
168+
"CASE" { return CASE; }
169+
"WHEN" { return WHEN; }
170+
"THEN" { return THEN; }
171+
"ELSE" { return ELSE; }
172+
"END" { return END; }
173+
174+
[()] { return yytext[0]; }
175+
176+
"," { return COMMA; }
174177
175178
{num_float} { yylval->numberFloat = cLocale.toDouble( QString::fromAscii(yytext) ); return NUMBER_FLOAT; }
176179
{num_int} {

‎src/core/qgsexpressionparser.yy

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,7 @@ expression:
168168
| expression GT expression { $$ = BINOP($2, $1, $3); }
169169
| expression REGEXP expression { $$ = BINOP($2, $1, $3); }
170170
| expression LIKE expression { $$ = BINOP($2, $1, $3); }
171-
| expression NOT LIKE expression { $$ = BINOP($3==QgsExpression::boLike ? QgsExpression::boNotLike : QgsExpression::boNotILike, $1, $4); }
172171
| expression IS expression { $$ = BINOP($2, $1, $3); }
173-
| expression IS NOT expression { $$ = BINOP(QgsExpression::boIsNot, $1, $4); }
174172
| expression PLUS expression { $$ = BINOP($2, $1, $3); }
175173
| expression MINUS expression { $$ = BINOP($2, $1, $3); }
176174
| expression MUL expression { $$ = BINOP($2, $1, $3); }
@@ -181,7 +179,6 @@ expression:
181179
| expression CONCAT expression { $$ = BINOP($2, $1, $3); }
182180
| NOT expression { $$ = new QgsExpression::NodeUnaryOperator($1, $2); }
183181
| '(' expression ')' { $$ = $2; }
184-
185182
| FUNCTION '(' exp_list ')'
186183
{
187184
int fnIndex = QgsExpression::functionIndex(*$1);

0 commit comments

Comments
 (0)
Please sign in to comment.