Commit 6c7c3331 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Cleanup

parent a5156e62
...@@ -40,12 +40,13 @@ enum { MAX_NUM_LINES = 20 }; ...@@ -40,12 +40,13 @@ enum { MAX_NUM_LINES = 20 };
static bool maybeOverrideChar(const QChar &ch) static bool maybeOverrideChar(const QChar &ch)
{ {
if (ch == QLatin1Char(')')) return true; switch (ch.unicode()) {
else if (ch == QLatin1Char(']')) return true; case ')': case ']': case ';': case '"': case '\'':
else if (ch == QLatin1Char(';')) return true; return true;
else if (ch == QLatin1Char('"')) return true;
else if (ch == QLatin1Char('\'')) return true; default:
else return false; return false;
}
} }
static bool isCompleteStringLiteral(const BackwardsScanner &tk, int index, int startToken) static bool isCompleteStringLiteral(const BackwardsScanner &tk, int index, int startToken)
...@@ -76,22 +77,18 @@ static bool isCompleteCharLiteral(const BackwardsScanner &tk, int index, int sta ...@@ -76,22 +77,18 @@ static bool isCompleteCharLiteral(const BackwardsScanner &tk, int index, int sta
static bool shouldInsertMatchingText(const QChar &lookAhead) static bool shouldInsertMatchingText(const QChar &lookAhead)
{ {
if (lookAhead.isSpace()) switch (lookAhead.unicode()) {
return true; case '{': case '}':
else if (lookAhead == QLatin1Char('{')) case ']': case ')':
return true; case ';': case ',':
else if (lookAhead == QLatin1Char('}'))
return true;
else if (lookAhead == QLatin1Char(']'))
return true;
else if (lookAhead == QLatin1Char(')'))
return true;
else if (lookAhead == QLatin1Char(';'))
return true;
else if (lookAhead == QLatin1Char(','))
return true; return true;
return false; default:
if (lookAhead.isSpace())
return true;
return false;
} // switch
} }
MatchingText::MatchingText() MatchingText::MatchingText()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment