Commit 81955e04 authored by Leandro Melo's avatar Leandro Melo
Browse files

Generic highlighter: Renaming a couple of methods.

parent 4fb15071
......@@ -202,7 +202,7 @@ void Highlighter::iterateThroughRules(const QString &text,
if (rule->matchSucceed(text, length, progress)) {
atLeastOneMatch = true;
if (progress->willContinueLine()) {
if (progress->isWillContinueLine()) {
createWillContinueBlock();
progress->setWillContinueLine(false);
} else {
......@@ -247,7 +247,7 @@ void Highlighter::iterateThroughRules(const QString &text,
} else {
applyFormat(progress->offset(), 1, m_currentContext->itemData(),
m_currentContext->definition());
if (progress->onlySpacesSoFar() && !text.at(progress->offset()).isSpace())
if (progress->isOnlySpacesSoFar() && !text.at(progress->offset()).isSpace())
progress->setOnlySpacesSoFar(false);
progress->incrementOffset();
}
......
......@@ -66,13 +66,13 @@ void ProgressData::restoreOffset()
void ProgressData::setOnlySpacesSoFar(const bool onlySpaces)
{ m_onlySpacesSoFar = onlySpaces; }
bool ProgressData::onlySpacesSoFar() const
bool ProgressData::isOnlySpacesSoFar() const
{ return m_onlySpacesSoFar; }
void ProgressData::setWillContinueLine(const bool willContinue)
{ m_willContinueLine = willContinue; }
bool ProgressData::willContinueLine() const
bool ProgressData::isWillContinueLine() const
{ return m_willContinueLine; }
void ProgressData::setCaptures(const QStringList &captures)
......
......@@ -50,10 +50,10 @@ public:
void restoreOffset();
void setOnlySpacesSoFar(const bool onlySpaces);
bool onlySpacesSoFar() const;
bool isOnlySpacesSoFar() const;
void setWillContinueLine(const bool willContinue);
bool willContinueLine() const;
bool isWillContinueLine() const;
void setCaptures(const QStringList &captures);
const QStringList &captures() const;
......
......@@ -162,7 +162,7 @@ bool Rule::charPredicateMatchSucceed(const QString &text,
bool Rule::matchSucceed(const QString &text, const int length, ProgressData *progress) const
{
if (m_firstNonSpace && !progress->onlySpacesSoFar())
if (m_firstNonSpace && !progress->isOnlySpacesSoFar())
return false;
if (m_column != -1 && m_column != progress->offset())
......@@ -170,7 +170,7 @@ bool Rule::matchSucceed(const QString &text, const int length, ProgressData *pro
int original = progress->offset();
if (doMatchSucceed(text, length, progress)) {
if (progress->onlySpacesSoFar() && !m_lookAhead && m_consumesNonSpace)
if (progress->isOnlySpacesSoFar() && !m_lookAhead && m_consumesNonSpace)
progress->setOnlySpacesSoFar(false);
if (m_lookAhead)
......
......@@ -123,7 +123,7 @@ protected:
static const QLatin1Char kN;
static const QLatin1Char kR;
static const QLatin1Char kT;
static const QLatin1Char kV;
static const QLatin1Char kV;
private:
virtual bool doMatchSucceed(const QString &text,
......
......@@ -149,8 +149,8 @@ void tst_SpecificRules::testMatch(const Rule &rule, ProgressData *progress) cons
QTEST(rule.matchSucceed(s, s.length(), progress), "match");
QTEST(progress->offset(), "offset");
QTEST(progress->onlySpacesSoFar(), "only spaces");
QTEST(progress->willContinueLine(), "will continue");
QTEST(progress->isOnlySpacesSoFar(), "only spaces");
QTEST(progress->isWillContinueLine(), "will continue");
}
void tst_SpecificRules::testDetectChar()
......
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