diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/whitespace.pl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/whitespace.pl b/scripts/whitespace.pl index 1d6548092..ad5380442 100644 --- a/scripts/whitespace.pl +++ b/scripts/whitespace.pl @@ -3,9 +3,10 @@ my $input = $ARGV[0]; my $source = `clang-format $input`; $source =~ s/^(.*each.*\(.*\).*)\n\s*{\s*$/$1 {/img; -$source =~ s/^(.*struct.*)\n\s*{\s*$/$1 {/img; -$source =~ s/^(.*class.*)\n\s*{\s*$/$1 {/img; -$source =~ s/^(\S*::\S*.*)\n\s*: /$1 :\n\t/img; +$source =~ s/^(\s*struct.*)\n\s*{\s*$/$1 {/img; +$source =~ s/^(\s*class.*)\n\s*{\s*$/$1 {/img; +$source =~ s/^(\S*::\S*.*)\n\s*: /$1 : /img; $source =~ s/(?:\G|^)[ ]{6}/\t/mg; +$source =~ s/(?:\G|^)(\t*)[ ]{4}"/$1\t"/mg; open (DIFF, "| diff -u $input -"); print DIFF $source ; |