From bfe90bdf042ef19debcd5e5f879beba46091c449 Mon Sep 17 00:00:00 2001 From: jespergravgaard Date: Sun, 25 Aug 2019 15:01:04 +0200 Subject: [PATCH] Better error when encountering continue in switch that is not inside loop. Closes #282 --- .../Pass0GenerateStatementSequence.java | 26 ++++++++++++++----- .../dk/camelot64/kickc/test/TestPrograms.java | 7 +---- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass0GenerateStatementSequence.java b/src/main/java/dk/camelot64/kickc/passes/Pass0GenerateStatementSequence.java index b495e61a3..a422ec557 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass0GenerateStatementSequence.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass0GenerateStatementSequence.java @@ -855,8 +855,12 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor comments = ensureUnusedComments(getCommentsSymbol(ctx)); Label beginJumpLabel = getCurrentScope().addLabelIntermediate(); StatementLabel beginJumpTarget = new StatementLabel(beginJumpLabel.getRef(), StatementSource.doWhile(ctx), comments); @@ -957,7 +961,7 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor