use of org.apache.groovy.parser.antlr4.GroovyParser.ContinueStatementContext in project groovy by apache.
the class AstBuilder method visitContinueStatement.
@Override
public ContinueStatement visitContinueStatement(final ContinueStatementContext ctx) {
if (visitingLoopStatementCount == 0) {
throw createParsingFailedException("continue statement is only allowed inside loops", ctx);
}
GroovyParserRuleContext gprc = switchExpressionRuleContextStack.peek();
if (gprc instanceof SwitchExpressionContext) {
throw createParsingFailedException("switch expression does not support `continue`", ctx);
}
String label = asBoolean(ctx.identifier()) ? this.visitIdentifier(ctx.identifier()) : null;
return configureAST(new ContinueStatement(label), ctx);
}
Aggregations