mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
12 lines
361 B
Perl
12 lines
361 B
Perl
|
#! /usr/bin/perl
|
||
|
|
||
|
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/(?:\G|^)[ ]{6}/\t/mg;
|
||
|
open (DIFF, "| diff -u $input -");
|
||
|
print DIFF $source ;
|