Fixed envelope main section empty error

This commit is contained in:
Takeshi Yokemura 2022-02-12 17:01:11 +09:00
parent 68253130fa
commit 1d3c91d6e1
4 changed files with 9 additions and 9 deletions

View File

@ -328,7 +328,6 @@ public:
expect(result30.valueAt(1) == 2); expect(result30.valueAt(1) == 2);
expect(result30.loopStartIndex == 0); expect(result30.loopStartIndex == 0);
expect(result30.releaseSequenceStartIndex == 1); expect(result30.releaseSequenceStartIndex == 1);
expect(error = kParseWarningPreRepeatSegmentEmpty);
beginTest ("Empty segment warning(in-repeat)"); beginTest ("Empty segment warning(in-repeat)");
error = kParseErrorNone; error = kParseErrorNone;

View File

@ -14,10 +14,6 @@ String getParseErrorString (ParseError err, int minValue, int maxValue)
{ {
switch (err) switch (err)
{ {
case kParseWarningPreRepeatSegmentEmpty:
return TRANS ("Main body of the sequence is empty");
break;
case kParseWarningRepeatSegmentEmpty: case kParseWarningRepeatSegmentEmpty:
return TRANS ("Repeat section is empty"); return TRANS ("Repeat section is empty");
break; break;
@ -26,6 +22,10 @@ String getParseErrorString (ParseError err, int minValue, int maxValue)
return TRANS ("Release section is empty"); return TRANS ("Release section is empty");
break; break;
case kParseErrorPreReleaseSegmentEmpty:
return TRANS ("Main body of the sequence is empty");
break;
case kParseErrorDuplicatedReleaseDelimiter: case kParseErrorDuplicatedReleaseDelimiter:
return TRANS ("You cannot use \"|\" more than once"); return TRANS ("You cannot use \"|\" more than once");
break; break;

View File

@ -15,10 +15,10 @@ enum ParseError
{ {
kParseErrorNone = 0, kParseErrorNone = 0,
kParseErrorLevelWarning, kParseErrorLevelWarning,
kParseWarningPreRepeatSegmentEmpty,
kParseWarningRepeatSegmentEmpty, kParseWarningRepeatSegmentEmpty,
kParseWarningReleaseSegmentEmpty, kParseWarningReleaseSegmentEmpty,
kParseErrorLevelFatal, kParseErrorLevelFatal,
kParseErrorPreReleaseSegmentEmpty,
kParseErrorDuplicatedReleaseDelimiter, kParseErrorDuplicatedReleaseDelimiter,
kParseErrorDuplicatedOpenBracket, kParseErrorDuplicatedOpenBracket,
kParseErrorDuplicatedCloseBracket, kParseErrorDuplicatedCloseBracket,

View File

@ -438,9 +438,6 @@ FrameSequence FrameSequenceParser::parse (const String& input,
{ {
return fs; return fs;
} }
if (sequence.size() == 0) {
*error = kParseWarningPreRepeatSegmentEmpty;
}
fs.sequence = sequence; fs.sequence = sequence;
fs.sequence.reserve (1000); fs.sequence.reserve (1000);
@ -470,6 +467,10 @@ FrameSequence FrameSequenceParser::parse (const String& input,
// Set repeatEndIndex according to current working frameSequence length // Set repeatEndIndex according to current working frameSequence length
fs.releaseSequenceStartIndex = (int)fs.sequence.size(); fs.releaseSequenceStartIndex = (int)fs.sequence.size();
} }
if (fs.sequence.size() == 0) {
*error = kParseErrorPreReleaseSegmentEmpty;
}
if (hasRelease) // If release exists: if (hasRelease) // If release exists:
{ {