shared: qssquery: checkParanthesis(): Ignore paranthesis in quotes

Fixes #12
このコミットが含まれているのは:
Albert S. 2020-12-19 12:51:52 +01:00
コミット 64b87dd595

ファイルの表示

@ -33,7 +33,11 @@ bool QSSQuery::checkParanthesis(QString expression)
QStack<QChar> open;
QStack<QChar> close;
bool inQuotes = false;
for(QChar &c : expression)
{
if(!inQuotes)
{
if(c == '(')
{
@ -44,6 +48,11 @@ bool QSSQuery::checkParanthesis(QString expression)
close.push(c);
}
}
if(c == '"')
{
inQuotes = !inQuotes;
}
}
if(open.size() != close.size())
{
return false;