blob: 27a589def5e6490f5fd1c619b12d5408eee7d9f5 (
plain)
1
2
3
4
5
6
7
8
|
#!/usr/bin/perl -p
# isort -- sort C variable declarations separated by commas
s/([^,]*?)(\S+[,;])/$2/; $prefix = $1;
s/;$/,/; @words = sort split /\s+/;
$_ = $prefix . (join ' ', @words) . "\n";
s/,$/;/;
|