diff --git a/src/iopae.cpp b/src/iopae.cpp index 888dfb0b62d..306c96c4d6b 100644 --- a/src/iopae.cpp +++ b/src/iopae.cpp @@ -3438,6 +3438,13 @@ bool PAEInput::ConvertRepeatedFigure() figure.push_back(*token); } } + // We are starting a new figure to be repeated + else if (token->m_char == '!') { + token->m_char = 0; + figureToken = &(*token); + figure.clear(); + status = pae::FIGURE_START; + } // We have completed a figure and will be repeating it else if (status == pae::FIGURE_END || status == pae::FIGURE_REPEAT) { // Repeat the figure. That is simply add it to the map @@ -3452,8 +3459,8 @@ bool PAEInput::ConvertRepeatedFigure() --token; status = pae::FIGURE_REPEAT; } - // End of repetitions - this includes the end of a measure - else { + // End of repetitions - this does not include the end of a measure + else if (!this->Was(*token, pae::MEASURE)) { // Make sure we repeated the figure at least once (is this too pedantic?) if (status == pae::FIGURE_END) { LogPAE(ERR_010_REP_UNUSED, *figureToken); @@ -3464,13 +3471,6 @@ bool PAEInput::ConvertRepeatedFigure() figure.clear(); } } - // We are starting a new figure to be repeated - else if (token->m_char == '!') { - token->m_char = 0; - figureToken = &(*token); - figure.clear(); - status = pae::FIGURE_START; - } // We should not have a repeat sign not after a figure end else if (token->m_char == 'f') { LogPAE(ERR_011_REP_NO_FIGURE, *token);