Merge pull request #34 from yokemura/bugfix/mainSectionEmptyError

[BUGFIX] Fixed custom envelope main section empty error
This commit is contained in:
Takeshi Yokemura 2022-02-12 17:04:18 +09:00 committed by GitHub
commit b2f6f4f1b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 9 deletions

View File

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

View File

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

View File

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

View File

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