private void HandleContinueInOuterLoop(LabeledStatementTranslation labeledStatement, int from, int to, SyntaxListBaseTranslation syntaxList) { var found = labeledStatement.TravelUpNotMe(f => f is WhileStatementTranslation || f is ForStatementTranslation || f is DoStatementTranslation); if (found == null) { return; } var root = labeledStatement.GetRootTranslation(); var continueStatements = new List<ContinueStatementTranslation>(); for (int i = from; i <= to; i++) { var syntax = syntaxList.SyntaxCollection[i]; continueStatements.AddRange(root.ContinueStatements.Where(f => syntax.Syntax.Span.Contains(f.Syntax.Span))); } Random rd = new Random(DateTime.Now.Millisecond + increment++); var label = $"__Outer{rd.Next(100)}"; if (found.Prefix != null && found.Prefix.EndsWith(":")) { label = found.Prefix.Substring(0, found.Prefix.Length - 1); } else { found.Prefix = $"{label}:" + found.Prefix; } foreach (var item in continueStatements) { item.SyntaxString = $"continue {label};"; } }