Skip to content

Commit eeebf5b

Browse files
committedApr 7, 2013
fix #6640
1 parent 22cb38b commit eeebf5b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed
 

‎src/core/qgsexpressionlexer.ll

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,18 @@ string "'"{str_char}*"'"
155155
"," { return COMMA; }
156156
157157
{num_float} { exp_lval.numberFloat = cLocale.toDouble( QString::fromAscii(yytext) ); return NUMBER_FLOAT; }
158-
{num_int} { exp_lval.numberInt = cLocale.toInt( QString::fromAscii(yytext), 0, 10); return NUMBER_INT; }
158+
{num_int} {
159+
bool ok;
160+
exp_lval.numberInt = cLocale.toInt( QString::fromAscii(yytext), &ok, 10 );
161+
if( ok )
162+
return NUMBER_INT;
163+
164+
exp_lval.numberFloat = cLocale.toDouble( QString::fromAscii(yytext), &ok );
165+
if( ok )
166+
return NUMBER_FLOAT;
167+
168+
return Unknown_CHARACTER;
169+
}
159170
160171
{string} { TEXT_FILTER(stripText); return STRING; }
161172

0 commit comments

Comments
 (0)
Please sign in to comment.