Hold Parser test (and related renames)

This commit is contained in:
Takeshi Yokemura
2021-08-15 15:58:46 +09:00
parent 252a84d618
commit 60068f313a
5 changed files with 35 additions and 15 deletions

View File

@ -116,7 +116,7 @@ std::vector<int> FrameSequenceParser::parseSlope (const String& input,
return retval;
}
std::vector<int> FrameSequenceParser::parseRepeat (const String& input,
std::vector<int> FrameSequenceParser::parseHold (const String& input,
int minValue,
int maxValue,
ParseError* error)
@ -127,13 +127,13 @@ std::vector<int> FrameSequenceParser::parseRepeat (const String& input,
if (xIndex < 1)
{
*error = kParseErrorMissingValueForRepeatDelimiter;
*error = kParseErrorMissingHoldValue;
return retval;
}
if (xIndex > input.length() - 1)
if (xIndex >= input.length() - 1)
{
*error = kParseErrorMissingFrameCountForRepeatDelimiter;
*error = kParseErrorMissingHoldFrameCount;
return retval;
}
@ -195,7 +195,7 @@ std::vector<int> FrameSequenceParser::parseSegment (const String& input,
else if (aToken.contains ("x"))
{
// parse as repeat-fixed-value
parsed = parseRepeat (aToken, minValue, maxValue, error);
parsed = parseHold (aToken, minValue, maxValue, error);
}
else
{