<commit_before>"Demonstration of a [[ceylon.ast.core::Visitor]] and an [[ceylon.ast.core::Editor]].
 
 It is sometimes desireable to rewrite a body of the form
 ~~~
 if (condition) {
     return a;
 } else {
     return b;
 }
 ~~~
 into a series of statements without intermediate returns, like this:
 ~~~
 value ret;
 if (condition) {
     ret = a;
 } else {
     ret = b;
 }
 ~~~
 However, this is not possible for every block:
 ~~~
 if (condition) {
     return a;
 }
 return b;
 ~~~
 If we replace `return`s with `ret` assignments here,
 the second return would still be reached.
 
 [[hasEarlyReturns]] detects if a body contains such an early return
 by [[visit|ceylon.ast.core::Node.visit]]ing the body;
 [[rewriteReturnsToAssignments]] rewrites a body as shown above.
 
 This could be used for some [compiler optimizations](https://github.com/ceylon/ceylon-compiler/issues/1794)."
shared package ceylon.ast.samples.bodyReturnRewrite;
<commit_msg>Fix doc link in ceylon.ast.samples package<commit_after>"Demonstration of a [[ceylon.ast.core::Visitor]] and an [[ceylon.ast.core::Editor]].
 
 It is sometimes desireable to rewrite a body of the form
 ~~~
 if (condition) {
     return a;
 } else {
     return b;
 }
 ~~~
 into a series of statements without intermediate returns, like this:
 ~~~
 value ret;
 if (condition) {
     ret = a;
 } else {
     ret = b;
 }
 ~~~
 However, this is not possible for every block:
 ~~~
 if (condition) {
     return a;
 }
 return b;
 ~~~
 If we replace `return`s with `ret` assignments here,
 the second return would still be reached.
 
 [[hasEarlyReturns]] detects if a body contains such an early return
 by [[visit|ceylon.ast.core::Node.visit]]ing the body;
 [[RewriteReturnsEditor]] rewrites a body as shown above.
 
 This could be used for some [compiler optimizations](https://github.com/ceylon/ceylon-compiler/issues/1794)."
shared package ceylon.ast.samples.bodyReturnRewrite;

{'fraction_non_alphanumeric': 0.11825726141078838, 'fraction_numerical': 0.004149377593360996, 'mean_word_length': 3.704878048780488, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4439022', 'n_tokens_mistral': 605, 'n_tokens_neox': 569, 'n_words': 215}