Fix a glitch where an empty line 0 could be created if there are no

constants.
This commit is contained in:
Rob Greene 2018-06-10 22:08:39 -05:00
parent d49a604412
commit 0a31aee7e9

View File

@ -80,6 +80,8 @@ public class ExtractConstantValues extends BaseVisitor {
}
private void injectLine0(Program program) {
Line line = generateLine0(program);
// Bypass if there were no constants
if (line.statements.isEmpty()) return;
// setup a renumber of lines that interfere if we have any
if (program.lines.get(0).lineNumber == 0) {
// start with line #0 should become line #1