mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-21 17:51:03 +00:00
Dirty Perl script for alphabetizing LyXAction.cpp, in case it
should be needed again.
This commit is contained in:
parent
2fbd9f6405
commit
d29bb7fac7
53
development/tools/alpha_lfuns.pl
Normal file
53
development/tools/alpha_lfuns.pl
Normal file
@ -0,0 +1,53 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
@lines;
|
||||
|
||||
while (<>) { push @lines, $_; }
|
||||
|
||||
$l = 0;
|
||||
$found = 0;
|
||||
while (1) {
|
||||
if ($lines[$l] =~ m{^/\*!}) {
|
||||
last if $found == 2;
|
||||
$found++;
|
||||
}
|
||||
print $lines[$l];
|
||||
$l++;
|
||||
}
|
||||
|
||||
$cmdlines = [$line];
|
||||
%cmds;
|
||||
$cmdname = "";
|
||||
|
||||
while (1) {
|
||||
$line = $lines[$l];
|
||||
if ($line =~ /{ LFUN_NOACTION, "", Noop, Hidden }/) {
|
||||
push @$cmdlines, "\n";
|
||||
$cmds{$cmdname} = $cmdlines;
|
||||
$cmdlines = [$line];
|
||||
last;
|
||||
}
|
||||
if ($line =~ m/^\s*{\s*LFUN_([^,]+)/) {
|
||||
$cmdname = $1;
|
||||
push @$cmdlines, $line;
|
||||
}
|
||||
elsif ($line =~ m{^/\*!}) {
|
||||
push @$cmdlines, "\n";
|
||||
$cmds{$cmdname} = $cmdlines;
|
||||
$cmdlines = [$line];
|
||||
}
|
||||
else {
|
||||
push @$cmdlines, $line;
|
||||
}
|
||||
$l++;
|
||||
}
|
||||
|
||||
# Now output those, in order
|
||||
|
||||
foreach $c (sort keys %cmds) {
|
||||
print @{$cmds{$c}};
|
||||
}
|
||||
|
||||
while ($l < scalar @lines) {
|
||||
print $lines[$l]; $l++;
|
||||
}
|
Loading…
Reference in New Issue
Block a user