mirror of
https://github.com/yokemura/Magical8bitPlug2.git
synced 2025-07-17 11:04:16 -04:00
Slope parser test
This commit is contained in:
@ -36,18 +36,23 @@ std::vector<int> FrameSequenceParser::parseSlope (const String& input,
|
||||
// find index of "in"
|
||||
int inIndex = input.indexOf ("in");
|
||||
|
||||
if (inIndex > input.length() - 3)
|
||||
{
|
||||
*error = kParseErrorMissingSlopeFinalValue;
|
||||
return retval;
|
||||
}
|
||||
|
||||
if (inIndex < 0)
|
||||
{
|
||||
*error = kParseErrorMissingSlopeLengthDelimiter;
|
||||
return retval;
|
||||
}
|
||||
|
||||
if (inIndex > input.length() - 3)
|
||||
{
|
||||
*error = kParseErrorMissingSlopeFrameCount;
|
||||
return retval;
|
||||
}
|
||||
if (inIndex - toIndex < 3)
|
||||
{
|
||||
*error = kParseErrorMissingSlopeFinalValue;
|
||||
return retval;
|
||||
}
|
||||
|
||||
// get 3 substrings separated by "to" and "in" and put them into `from`, `to`, `cntStr`
|
||||
String fromStr = input.substring (0, toIndex);
|
||||
String toStr = input.substring (toIndex + 2, inIndex);
|
||||
|
Reference in New Issue
Block a user