mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
Continue to improve whitespace cleanup helper
The more I try the cleanup helper, the more corner cases I find... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
6424b162f0
commit
42f32671a8
1 changed files with 4 additions and 1 deletions
|
@ -3,7 +3,10 @@
|
||||||
my $input = $ARGV[0];
|
my $input = $ARGV[0];
|
||||||
my $source = `clang-format $input`;
|
my $source = `clang-format $input`;
|
||||||
$source =~ s/^(.*each.*\(.*\).*)\n\s*{\s*$/$1 {/img;
|
$source =~ s/^(.*each.*\(.*\).*)\n\s*{\s*$/$1 {/img;
|
||||||
$source =~ s/^(\s*struct.*)\n\s*{\s*$/$1 {/img;
|
$source =~ s/^(\s*struct[^()\n]*)\n\s*{\s*$/$1 {/img;
|
||||||
|
$source =~ s/^(\s*static\s+struct[^()\n]*)\n\s*{\s*$/$1 {/img;
|
||||||
|
$source =~ s/^(\s*union[^()\n]*)\n\s*{\s*$/$1 {/img;
|
||||||
|
$source =~ s/^(\s*static\s+union[^()\n]*)\n\s*{\s*$/$1 {/img;
|
||||||
$source =~ s/^(\s*class.*)\n\s*{\s*$/$1 {/img;
|
$source =~ s/^(\s*class.*)\n\s*{\s*$/$1 {/img;
|
||||||
$source =~ s/^(\S*::\S*.*)\n\s*: /$1 : /img;
|
$source =~ s/^(\S*::\S*.*)\n\s*: /$1 : /img;
|
||||||
$source =~ s/(?:\G|^)[ ]{6}/\t/mg;
|
$source =~ s/(?:\G|^)[ ]{6}/\t/mg;
|
||||||
|
|
Loading…
Add table
Reference in a new issue