+ # check for blank lines within/after local decls @@@@@@@@@@@@@@@@@@@@@@@@@@@
+
+ if ($in_block_decls >= 0 &&
+ $in_comment == 0 && !m/^\s*\*?@/ && # not multi-line or intra-line comment
+ !$in_expr && $in_typedecl == 0) {
+ my $blank_line_before = $line > 1 && $code_contents_before =~ m/^\s*(\\\s*)?$/;
+ # essentially blank line: just whitespace (and maybe a trailing '\')
+ if (m/^\s*(void|char|signed|unsigned|int|short|long|float|double|typedef|enum|struct|union|auto|extern|static|const|volatile|register)(\W|$)/ ||
+ (m/[\w)]\s+[*]*\w/ &&
+ !m/^\s*(\}|sizeof|if|else|while|do|for|switch|case|default|break|continue|goto|return)(\W|$)/)) {
+ report_flexibly($line - 1, "blank line within local decls, before", $contents) if $blank_line_before;
+ $in_block_decls++;
+ } elsif ($in_block_decls > 0) {
+ report_flexibly($line, "missing blank line after local decls", "\n$contents_before$contents")
+ unless $blank_line_before;
+ $in_block_decls = -1;
+ }
+ }
+