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

Fixes #12
这个提交包含在:
Albert S. 2020-12-19 12:51:52 +01:00
父节点 33b145e6d2
当前提交 64b87dd595
共有 1 个文件被更改,包括 13 次插入4 次删除

查看文件

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