Skip to content

Commit

Permalink
Fix repeating pattern repetition in PAE parsing. Closes #3570
Browse files Browse the repository at this point in the history
  • Loading branch information
lpugin committed Jan 9, 2024
1 parent 9b86804 commit 6baff71
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/iopae.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 6baff71

Please sign in to comment.