UI: RuleTextParser: Simplify processSectionChar()

This commit is contained in:
Nodir Temirkhodjaev 2024-11-05 14:55:02 +05:00
parent 1150a45f55
commit f4683f5b5b
2 changed files with 23 additions and 10 deletions

View File

@ -149,17 +149,11 @@ bool RuleTextParser::parseLineSection()
bool RuleTextParser::processSectionChar()
{
if ((m_charType & (CharListBegin | CharBracketBegin | CharDigit | CharValueBegin)) != 0) {
return processSectionBlock();
}
switch (m_charType) {
case CharListBegin: {
processSectionLines();
} break;
case CharBracketBegin: {
parseBracketValues();
} break;
case CharDigit:
case CharValueBegin: {
parseValue();
} break;
case CharLetter: {
return parseName();
} break;
@ -179,6 +173,24 @@ bool RuleTextParser::processSectionChar()
return false;
}
bool RuleTextParser::processSectionBlock()
{
switch (m_charType) {
case CharListBegin: {
processSectionLines();
} break;
case CharBracketBegin: {
parseBracketValues();
} break;
case CharDigit:
case CharValueBegin: {
parseValue();
} break;
}
return false;
}
void RuleTextParser::processSectionLines()
{
parseLines();

View File

@ -74,6 +74,7 @@ private:
bool parseLine();
bool parseLineSection();
bool processSectionChar();
bool processSectionBlock();
void processSectionLines();
bool parseName();