Fix bug in generation of block labels

This commit is contained in:
Alexey Andreev 2017-03-17 17:19:28 +03:00
parent b28f5a6b71
commit 299485eb96

View File

@ -315,7 +315,7 @@ public class StatementRenderer implements ExprVisitor, StatementVisitor {
private String generateBlockId(int index) { private String generateBlockId(int index) {
int mappedIndex; int mappedIndex;
while (blockIds.size() <= index) { while (blockIds.size() <= index) {
mappedIndex = blockIndexMap.isEmpty() ? -1 : blockIndexMap.get(blockIds.size()); mappedIndex = blockIndexMap.isEmpty() ? -1 : blockIndexMap.get(blockIds.size() - 1);
mappedIndex++; mappedIndex++;
while (RenderingUtil.KEYWORDS.contains(RenderingUtil.indexToId(mappedIndex))) { while (RenderingUtil.KEYWORDS.contains(RenderingUtil.indexToId(mappedIndex))) {
mappedIndex++; mappedIndex++;