Skip the tokens inside brackets when computing the expression under cursor.

This commit is contained in:
Roberto Raggi
2010-01-26 15:09:04 +01:00
parent ab8c19f2f8
commit 204aeb700e

View File

@@ -200,14 +200,17 @@ public:
//qDebug() << "skip:" << blockText.mid(tk.offset, tk.length);
}
if (tk.is(Token::RightParenthesis))
if (tk.is(Token::RightParenthesis) || tk.is(Token::RightBracket))
++skipping;
else if (tk.is(Token::LeftParenthesis)) {
else if (tk.is(Token::LeftParenthesis) || tk.is(Token::LeftBracket)) {
--skipping;
if (! skipping)
tokens.append(tk);
if (index > 0 && originalTokens.at(index - 1).isNot(Token::Identifier))
break;
}
}