mirror of
https://github.com/tnodir/fort
synced 2024-11-14 22:05:12 +00:00
UI: RuleTextParser: Simplify parseLine()
This commit is contained in:
parent
973581ada4
commit
daa710ff4a
@ -134,14 +134,27 @@ bool RuleTextParser::parseLine()
|
||||
if (!parseLineSection(expectedSeparator))
|
||||
break;
|
||||
|
||||
if (m_ruleFilter.isLineEnd || m_ruleFilter.isListEnd)
|
||||
if (!processSectionFilter())
|
||||
break;
|
||||
|
||||
const bool isSectionEnd = m_ruleFilter.isSectionEnd;
|
||||
expectedSeparator = CharColon | CharNewLine;
|
||||
}
|
||||
|
||||
endList(filterIndex);
|
||||
|
||||
return !hasError();
|
||||
}
|
||||
|
||||
bool RuleTextParser::processSectionFilter()
|
||||
{
|
||||
if (m_ruleFilter.isLineEnd || m_ruleFilter.isListEnd)
|
||||
return false;
|
||||
|
||||
if (!checkAddFilter())
|
||||
return false;
|
||||
|
||||
const bool isSectionEnd = m_ruleFilter.isSectionEnd;
|
||||
|
||||
resetFilter();
|
||||
|
||||
// Next default type, if applicable
|
||||
@ -150,12 +163,7 @@ bool RuleTextParser::parseLine()
|
||||
: FORT_RULE_FILTER_TYPE_INVALID;
|
||||
}
|
||||
|
||||
expectedSeparator = CharColon | CharNewLine;
|
||||
}
|
||||
|
||||
endList(filterIndex);
|
||||
|
||||
return !hasError();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RuleTextParser::parseLineSection(RuleCharTypes expectedSeparator)
|
||||
|
@ -96,6 +96,7 @@ private:
|
||||
bool parseLines();
|
||||
bool parseLineComments();
|
||||
bool parseLine();
|
||||
bool processSectionFilter();
|
||||
bool parseLineSection(RuleCharTypes expectedSeparator);
|
||||
bool parseSection();
|
||||
bool parseSectionBlock();
|
||||
|
Loading…
Reference in New Issue
Block a user