shared: qssquery: checkParanthesis(): Ignore paranthesis in quotes
Fixes #12
This commit is contained in:
والد
0cba6f3fa4
کامیت
dd053f87f9
@ -34,7 +34,11 @@ bool QSSQuery::checkParanthesis(QString expression)
|
|||||||
QStack<QChar> open;
|
QStack<QChar> open;
|
||||||
QStack<QChar> close;
|
QStack<QChar> close;
|
||||||
|
|
||||||
|
bool inQuotes = false;
|
||||||
|
|
||||||
for(QChar &c : expression)
|
for(QChar &c : expression)
|
||||||
|
{
|
||||||
|
if(!inQuotes)
|
||||||
{
|
{
|
||||||
if(c == '(')
|
if(c == '(')
|
||||||
{
|
{
|
||||||
@ -45,6 +49,11 @@ bool QSSQuery::checkParanthesis(QString expression)
|
|||||||
close.push(c);
|
close.push(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(c == '"')
|
||||||
|
{
|
||||||
|
inQuotes = ! inQuotes;
|
||||||
|
}
|
||||||
|
}
|
||||||
if(open.size() != close.size())
|
if(open.size() != close.size())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
بارگذاری…
مرجع در شماره جدید
Block a user