shared: qssquery: checkParanthesis(): Ignore paranthesis in quotes
Fixes #12
This commit is contained in:
parent
0cba6f3fa4
commit
dd053f87f9
@ -34,7 +34,11 @@ bool QSSQuery::checkParanthesis(QString expression)
|
||||
QStack<QChar> open;
|
||||
QStack<QChar> close;
|
||||
|
||||
bool inQuotes = false;
|
||||
|
||||
for(QChar &c : expression)
|
||||
{
|
||||
if(!inQuotes)
|
||||
{
|
||||
if(c == '(')
|
||||
{
|
||||
@ -45,6 +49,11 @@ bool QSSQuery::checkParanthesis(QString expression)
|
||||
close.push(c);
|
||||
}
|
||||
}
|
||||
if(c == '"')
|
||||
{
|
||||
inQuotes = ! inQuotes;
|
||||
}
|
||||
}
|
||||
if(open.size() != close.size())
|
||||
{
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user